View Javadoc

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.SAML1NameIdentifierAttributeDefinition;
20  
21  /** Factory bean for creating {@link SAML1NameIdentifierentifierAttributeDefinition}s. */
22  public class SAML1NameIdentifierAttributeDefinitionFactoryBean extends BaseAttributeDefinitionFactoryBean {
23  
24      /** Format of the NameIdentifier. */
25      private String nameIdentifierFormat;
26  
27      /** Name qualifier for the NameIdentifier. */
28      private String nameIdentifierQualifier;
29  
30      /** {@inheritDoc} */
31      public Class getObjectType() {
32          return SAML1NameIdentifierAttributeDefinition.class;
33      }
34  
35      /**
36       * Gets the format for the NameIdentifier used as an attribute value.
37       * 
38       * @return format for the NameIdentifier used as an attribute value
39       */
40      public String getNameIdentifierFormat() {
41          return nameIdentifierFormat;
42      }
43  
44      /**
45       * Sets the format for the NameIdentifier used as an attribute value.
46       * 
47       * @param format format for the NameIdentifier used as an attribute value
48       */
49      public void setNameIdentifierFormat(String format) {
50          nameIdentifierFormat = format;
51      }
52  
53      /**
54       * Gets the NameIdentifier qualifier for the NameIdentifier used as an attribute value.
55       * 
56       * @return NameIdentifier qualifier for the NameIdentifier used as an attribute value
57       */
58      public String getNameIdentifierQualifier() {
59          return nameIdentifierQualifier;
60      }
61  
62      /**
63       * Sets the NameIdentifier qualifier for the NameIdentifier used as an attribute value.
64       * 
65       * @param qualifier NameIdentifier qualifier for the NameIdentifier used as an attribute value
66       */
67      public void setNameIdentifierQualifier(String qualifier) {
68          nameIdentifierQualifier = qualifier;
69      }
70  
71      /** {@inheritDoc} */
72      protected Object createInstance() throws Exception {
73          SAML1NameIdentifierAttributeDefinition definition = new SAML1NameIdentifierAttributeDefinition();
74          populateAttributeDefinition(definition);
75  
76          definition.setNameIdQualifier(nameIdentifierQualifier);
77          definition.setNameIdFormat(nameIdentifierFormat);
78  
79          return definition;
80      }
81  }