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.SAML2NameIDAttributeDefinition; 21 22 /** Factory bean for creating {@link SAML2NameIDAttributeDefinition}s. */ 23 public class SAML2NameIDAttributeDefinitionFactoryBean extends BaseAttributeDefinitionFactoryBean { 24 25 /** Format of the NameID. */ 26 private String nameIdFormat; 27 28 /** NameQualifier for the NameID. */ 29 private String nameIdQualifier; 30 31 /** SPNameQualifier for the NameID. */ 32 private String nameIdSPQualifier; 33 34 /** {@inheritDoc} */ 35 public Class getObjectType() { 36 return SAML2NameIDAttributeDefinition.class; 37 } 38 39 /** 40 * Gets the format for the NameID used as an attribute value. 41 * 42 * @return format for the NameID used as an attribute value 43 */ 44 public String getNameIdFormat() { 45 return nameIdFormat; 46 } 47 48 /** 49 * Sets the format for the NameID used as an attribute value. 50 * 51 * @param format format for the NameID used as an attribute value 52 */ 53 public void setNameIdFormat(String format) { 54 nameIdFormat = format; 55 } 56 57 /** 58 * Gets the NameQualifier for the NameID used as an attribute value. 59 * 60 * @return NameQualifier for the NameID used as an attribute value 61 */ 62 public String getNameIdQualifier() { 63 return nameIdQualifier; 64 } 65 66 /** 67 * Sets the NameQualifier for the NameID used as an attribute value. 68 * 69 * @param qualifier NameQualifier for the NameID used as an attribute value 70 */ 71 public void setNameIdQualifier(String qualifier) { 72 nameIdQualifier = qualifier; 73 } 74 75 76 /** 77 * Gets the SPNameQualifier for the NameID used as an attribute value. 78 * 79 * @return SPNameQualifier for the NameID used as an attribute value 80 */ 81 public String getNameIdSPQualifier() { 82 return nameIdSPQualifier; 83 } 84 85 /** 86 * Sets the SPNameQualifier for the NameID used as an attribute value. 87 * 88 * @param qualifier SPNameQualifier for the NameID used as an attribute value 89 */ 90 public void setNameIdSPQualifier(String qualifier) { 91 nameIdSPQualifier = qualifier; 92 } 93 94 /** {@inheritDoc} */ 95 protected Object createInstance() throws Exception { 96 SAML2NameIDAttributeDefinition definition = new SAML2NameIDAttributeDefinition(); 97 populateAttributeDefinition(definition); 98 99 definition.setNameIdFormat(nameIdFormat); 100 definition.setNameIdQualifier(nameIdQualifier); 101 definition.setNameIdSPQualifier(nameIdSPQualifier); 102 103 return definition; 104 } 105 }