1 /* 2 * Copyright 2008 University Corporation for Advanced Internet Development, Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package edu.internet2.middleware.shibboleth.common.config.attribute.resolver.attributeDefinition; 18 19 import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.SAML2NameIDAttributeDefinition; 20 21 /** Factory bean for creating {@link SAML2NameIDAttributeDefinition}s. */ 22 public class SAML2NameIDAttributeDefinitionFactoryBean extends BaseAttributeDefinitionFactoryBean { 23 24 /** Format of the NameID. */ 25 private String nameIdFormat; 26 27 /** NameQualifier for the NameID. */ 28 private String nameIdQualifier; 29 30 /** SPNameQualifier for the NameID. */ 31 private String nameIdSPQualifier; 32 33 /** {@inheritDoc} */ 34 public Class getObjectType() { 35 return SAML2NameIDAttributeDefinition.class; 36 } 37 38 /** 39 * Gets the format for the NameID used as an attribute value. 40 * 41 * @return format for the NameID used as an attribute value 42 */ 43 public String getNameIdFormat() { 44 return nameIdFormat; 45 } 46 47 /** 48 * Sets the format for the NameID used as an attribute value. 49 * 50 * @param format format for the NameID used as an attribute value 51 */ 52 public void setNameIdFormat(String format) { 53 nameIdFormat = format; 54 } 55 56 /** 57 * Gets the NameQualifier for the NameID used as an attribute value. 58 * 59 * @return NameQualifier for the NameID used as an attribute value 60 */ 61 public String getNameIdQualifier() { 62 return nameIdQualifier; 63 } 64 65 /** 66 * Sets the NameQualifier for the NameID used as an attribute value. 67 * 68 * @param qualifier NameQualifier for the NameID used as an attribute value 69 */ 70 public void setNameIdQualifier(String qualifier) { 71 nameIdQualifier = qualifier; 72 } 73 74 75 /** 76 * Gets the SPNameQualifier for the NameID used as an attribute value. 77 * 78 * @return SPNameQualifier for the NameID used as an attribute value 79 */ 80 public String getNameIdSPQualifier() { 81 return nameIdSPQualifier; 82 } 83 84 /** 85 * Sets the SPNameQualifier for the NameID used as an attribute value. 86 * 87 * @param qualifier SPNameQualifier for the NameID used as an attribute value 88 */ 89 public void setNameIdSPQualifier(String qualifier) { 90 nameIdSPQualifier = qualifier; 91 } 92 93 /** {@inheritDoc} */ 94 protected Object createInstance() throws Exception { 95 SAML2NameIDAttributeDefinition definition = new SAML2NameIDAttributeDefinition(); 96 populateAttributeDefinition(definition); 97 98 definition.setNameIdFormat(nameIdFormat); 99 definition.setNameIdQualifier(nameIdQualifier); 100 definition.setNameIdSPQualifier(nameIdSPQualifier); 101 102 return definition; 103 } 104 }