1 /* 2 * Licensed to the University Corporation for Advanced Internet Development, 3 * Inc. (UCAID) under one or more contributor license agreements. See the 4 * NOTICE file distributed with this work for additional information regarding 5 * copyright ownership. The UCAID licenses this file to You under the Apache 6 * License, Version 2.0 (the "License"); you may not use this file except in 7 * compliance with the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package edu.internet2.middleware.shibboleth.common.config.attribute.resolver.attributeDefinition; 19 20 import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.SAML1NameIdentifierAttributeDefinition; 21 22 /** Factory bean for creating {@link SAML1NameIdentifierAttributeDefinition}s. */ 23 public class SAML1NameIdentifierAttributeDefinitionFactoryBean extends BaseAttributeDefinitionFactoryBean { 24 25 /** Format of the NameIdentifier. */ 26 private String nameIdentifierFormat; 27 28 /** Name qualifier for the NameIdentifier. */ 29 private String nameIdentifierQualifier; 30 31 /** {@inheritDoc} */ 32 public Class getObjectType() { 33 return SAML1NameIdentifierAttributeDefinition.class; 34 } 35 36 /** 37 * Gets the format for the NameIdentifier used as an attribute value. 38 * 39 * @return format for the NameIdentifier used as an attribute value 40 */ 41 public String getNameIdentifierFormat() { 42 return nameIdentifierFormat; 43 } 44 45 /** 46 * Sets the format for the NameIdentifier used as an attribute value. 47 * 48 * @param format format for the NameIdentifier used as an attribute value 49 */ 50 public void setNameIdentifierFormat(String format) { 51 nameIdentifierFormat = format; 52 } 53 54 /** 55 * Gets the NameIdentifier qualifier for the NameIdentifier used as an attribute value. 56 * 57 * @return NameIdentifier qualifier for the NameIdentifier used as an attribute value 58 */ 59 public String getNameIdentifierQualifier() { 60 return nameIdentifierQualifier; 61 } 62 63 /** 64 * Sets the NameIdentifier qualifier for the NameIdentifier used as an attribute value. 65 * 66 * @param qualifier NameIdentifier qualifier for the NameIdentifier used as an attribute value 67 */ 68 public void setNameIdentifierQualifier(String qualifier) { 69 nameIdentifierQualifier = qualifier; 70 } 71 72 /** {@inheritDoc} */ 73 protected Object createInstance() throws Exception { 74 SAML1NameIdentifierAttributeDefinition definition = new SAML1NameIdentifierAttributeDefinition(); 75 populateAttributeDefinition(definition); 76 77 definition.setNameIdQualifier(nameIdentifierQualifier); 78 definition.setNameIdFormat(nameIdentifierFormat); 79 80 return definition; 81 } 82 }