View Javadoc

1   /*
2    * Copyright [2005] [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.metadata;
18  
19  import java.util.List;
20  
21  import javax.xml.namespace.QName;
22  
23  import org.opensaml.common.SignableSAMLObject;
24  import org.opensaml.common.xml.SAMLConstants;
25  import org.opensaml.saml2.common.CacheableSAMLObject;
26  import org.opensaml.saml2.common.Extensions;
27  import org.opensaml.saml2.common.TimeBoundSAMLObject;
28  import org.opensaml.xml.AttributeExtensibleXMLObject;
29  
30  /**
31   * SAML 2.0 Metadata EntityDescriptor
32   */
33  public interface EntityDescriptor extends SignableSAMLObject, TimeBoundSAMLObject, CacheableSAMLObject,
34          AttributeExtensibleXMLObject {
35  
36      /** Element name, no namespace */
37      public final static String DEFAULT_ELEMENT_LOCAL_NAME = "EntityDescriptor";
38      
39      /** Default element name */
40      public final static QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20MD_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
41      
42      /** Local name of the XSI type */
43      public final static String TYPE_LOCAL_NAME = "EntityDescriptorType"; 
44          
45      /** QName of the XSI type */
46      public final static QName TYPE_NAME = new QName(SAMLConstants.SAML20MD_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
47  
48      /** Element QName, no prefix */
49      public final static QName ELEMENT_QNAME = new QName(SAMLConstants.SAML20MD_NS, DEFAULT_ELEMENT_LOCAL_NAME);
50  
51      /** "ID" attribute name */
52      public final static String ID_ATTRIB_NAME = "ID";
53  
54      /** "Name" attribute name */
55      public final static String ENTITY_ID_ATTRIB_NAME = "entityID";
56  
57      /**
58       * Gets the entity ID for this entity descriptor.
59       * 
60       * @return the entity ID for this entity descriptor
61       */
62      public String getEntityID();
63  
64      /**
65       * Sets the entity ID for this entity descriptor.
66       * 
67       * @param id the entity ID for this entity descriptor
68       */
69      public void setEntityID(String id);
70  
71      /**
72       * Gets the ID for this entity descriptor.
73       * 
74       * @return the ID for this entity descriptor
75       */
76      public String getID();
77  
78      /**
79       * Sets the ID for this entity descriptor.
80       * 
81       * @param newID the ID for this entity descriptor
82       */
83      public void setID(String newID);
84  
85      /**
86       * Gets the Extensions child of this object.
87       * 
88       * @return the Extensions child of this object
89       */
90      public Extensions getExtensions();
91  
92      /**
93       * Sets the Extensions child of this object.
94       * 
95       * @param extensions the Extensions child of this object
96       * 
97       * @throws IllegalArgumentException thrown if the given extensions Object is already a child of another SAMLObject
98       */
99      public void setExtensions(Extensions extensions) throws IllegalArgumentException;
100 
101     /**
102      * Gets all the role descriptors for this entity descriptor.
103      * 
104      * @return the role descriptors for this entity descriptor
105      */
106     public List<RoleDescriptor> getRoleDescriptors();
107 
108     /**
109      * Gets all the role descriptors for this entity descriptor that match the supplied QName parameter.
110      * 
111      * @param typeOrName the name of the role
112      * 
113      * @return the role descriptors for this entity descriptor
114      */
115     public List<RoleDescriptor> getRoleDescriptors(QName typeOrName);
116     
117     /**
118      * Gets all the role descriptors for this entity that support the given protocol.
119      * 
120      * @param typeOrName the name of the role
121      * @param supportedProtocol the supported protocol
122      * 
123      * @return the list of role descriptors that support the given protocol
124      */
125     public List<RoleDescriptor> getRoleDescriptors(QName typeOrName, String supportedProtocol);
126 
127     /**
128      * Gets the first {@link IDPSSODescriptor} role descriptor for this entity that supports the given protocol.
129      * 
130      * @return the {@link IDPSSODescriptor} role descriptor
131      */
132     public IDPSSODescriptor getIDPSSODescriptor(String supportedProtocol);
133 
134     /**
135      * Gets the first {@link SPSSODescriptor} role descriptor for this entity that supports the given protocol.
136      * 
137      * @return the {@link SPSSODescriptor} role descriptor
138      */
139     public SPSSODescriptor getSPSSODescriptor(String supportedProtocol);
140 
141     /**
142      * Gets the first {@link AuthnAuthorityDescriptor} role descriptor for this entity that supports the given protocol.
143      * 
144      * @return the {@link AuthnAuthorityDescriptor} role descriptor
145      */
146     public AuthnAuthorityDescriptor getAuthnAuthorityDescriptor(String supportedProtocol);
147 
148     /**
149      * Gets the first {@link AttributeAuthorityDescriptor} role descriptor for this entity that supports the given protocol.
150      * 
151      * @return the {@link AttributeAuthorityDescriptor} role descriptor
152      */
153     public AttributeAuthorityDescriptor getAttributeAuthorityDescriptor(String supportedProtocol);
154 
155     /**
156      * Gets the first {@link PDPDescriptor} role descriptor for this entity that supports the given protocol.
157      * 
158      * @return the {@link PDPDescriptor} role descriptor
159      */
160     public PDPDescriptor getPDPDescriptor(String supportedProtocol);
161 
162     /**
163      * Gets the affiliation descriptor for this entity.
164      * 
165      * @return the affiliation descriptor for this entity
166      */
167     public AffiliationDescriptor getAffiliationDescriptor();
168 
169     /**
170      * Sets the affiliation descriptor for this entity.
171      * 
172      * @param descriptor the affiliation descriptor for this entity
173      * 
174      * @throws IllegalArgumentException thrown if the descriptor is owned by another entity or if this entity already
175      *             has one or more role descriptors associated with it
176      */
177     public void setAffiliationDescriptor(AffiliationDescriptor descriptor) throws IllegalArgumentException;
178 
179     /**
180      * Gets the organization for this entity.
181      * 
182      * @return the organization for this entity
183      */
184     public Organization getOrganization();
185 
186     /**
187      * Sets the organization for this entity.
188      * 
189      * @param organization the organization for this entity
190      * 
191      * @throws IllegalArgumentException thrown if this organization belongs to another entity
192      */
193     public void setOrganization(Organization organization) throws IllegalArgumentException;
194 
195     /**
196      * Get the contact people for this entity.
197      * 
198      * @return the contact people for this entity
199      */
200     public List<ContactPerson> getContactPersons();
201 
202     /**
203      * Gets the additional metadata locations for this entity.
204      * 
205      * @return the additional metadata locations for this entity
206      */
207     public List<AdditionalMetadataLocation> getAdditionalMetadataLocations();
208 }