View Javadoc

1   /*
2    * Copyright [2006] [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 org.opensaml.saml2.core;
18  
19  import java.util.List;
20  
21  import javax.xml.namespace.QName;
22  
23  import org.opensaml.common.SAMLObject;
24  import org.opensaml.common.xml.SAMLConstants;
25  import org.opensaml.xml.AttributeExtensibleXMLObject;
26  import org.opensaml.xml.XMLObject;
27  
28  /**
29   * SAML 2.0 Core Attribute.
30   */
31  public interface Attribute extends SAMLObject, AttributeExtensibleXMLObject {
32  
33      /** Local name of the Attribute element. */
34      public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Attribute";
35  
36      /** Default element name. */
37      public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
38              SAMLConstants.SAML20_PREFIX);
39  
40      /** Local name of the XSI type. */
41      public static final String TYPE_LOCAL_NAME = "AttributeType";
42  
43      /** QName of the XSI type. */
44      public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
45              SAMLConstants.SAML20_PREFIX);
46  
47      /** Name of the Name attribute. */
48      public static final String NAME_ATTTRIB_NAME = "Name";
49  
50      /** Name for the NameFormat attribute. */
51      public static final String NAME_FORMAT_ATTRIB_NAME = "NameFormat";
52  
53      /** Name of the FriendlyName attribute. */
54      public static final String FRIENDLY_NAME_ATTRIB_NAME = "FriendlyName";
55  
56      /** Unspecified attribute format ID. */
57      public static final String UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
58  
59      /** URI reference attribute format ID. */
60      public static final String URI_REFERENCE = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
61  
62      /** Basic attribute format ID. */
63      public static final String BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
64  
65      /**
66       * Get the name of this attribute.
67       * 
68       * @return the name of this attribute
69       */
70      public String getName();
71  
72      /**
73       * Sets the name of this attribute.
74       * 
75       * @param name the name of this attribute
76       */
77      public void setName(String name);
78  
79      /**
80       * Get the name format of this attribute.
81       * 
82       * @return the name format of this attribute
83       */
84      public String getNameFormat();
85  
86      /**
87       * Sets the name format of this attribute.
88       * 
89       * @param nameFormat the name format of this attribute
90       */
91      public void setNameFormat(String nameFormat);
92  
93      /**
94       * Get the friendly name of this attribute.
95       * 
96       * @return the friendly name of this attribute
97       */
98      public String getFriendlyName();
99  
100     /**
101      * Sets the friendly name of this attribute.
102      * 
103      * @param friendlyName the friendly name of this attribute
104      */
105     public void setFriendlyName(String friendlyName);
106 
107     /**
108      * Gets the list of attribute values for this attribute.
109      * 
110      * @return the list of attribute values for this attribute
111      */
112     public List<XMLObject> getAttributeValues();
113 }