Removed unnecessary class from string literals.
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / Metadata.h
1 /*
2  *  Copyright 2001-2006 Internet2
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 /**
18  * @file saml/saml2/metadata/Metadata.h
19  * 
20  * XMLObjects representing the SAML 2.0 Metadata schema
21  */
22
23 #ifndef __saml2_metadata_h__
24 #define __saml2_metadata_h__
25
26 #include <saml/saml2/core/Assertions.h>
27 #include <ctime>
28
29 #define DECL_SAML2MDOBJECTBUILDER(cname) \
30     DECL_XMLOBJECTBUILDER(SAML_API,cname,samlconstants::SAML20MD_NS,samlconstants::SAML20MD_PREFIX)
31
32 namespace opensaml {
33
34     /**
35      * @namespace opensaml::saml2md
36      * SAML 2.0 metadata namespace
37      */
38     namespace saml2md {
39         
40         /**
41          * Base class for metadata objects that feature a cacheDuration attribute.
42          */
43         class SAML_API CacheableSAMLObject : public virtual xmltooling::XMLObject
44         {
45         protected:
46             CacheableSAMLObject() {}
47         public:
48             ~CacheableSAMLObject() {}
49             DECL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION);
50         };
51
52         /**
53          * Base class for metadata objects that feature a validUntil attribute.
54          */
55         class SAML_API TimeBoundSAMLObject : public virtual xmltooling::XMLObject
56         {
57         protected:
58             TimeBoundSAMLObject() {}
59         public:
60             ~TimeBoundSAMLObject() {}
61             DECL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL);
62             /** Returns true iff the object is valid at the current time. */
63             bool isValid() const {
64                 return time(NULL) <= getValidUntilEpoch();
65             }
66         };
67
68         DECL_XMLOBJECT_SIMPLE(SAML_API,AffiliateMember,ID,SAML 2.0 AffiliateMember element);
69         DECL_XMLOBJECT_SIMPLE(SAML_API,AttributeProfile,ProfileURI,SAML 2.0 AttributeProfile element);
70         DECL_XMLOBJECT_SIMPLE(SAML_API,Company,Name,SAML 2.0 Company element);
71         DECL_XMLOBJECT_SIMPLE(SAML_API,EmailAddress,Address,SAML 2.0 EmailAddress element);
72         DECL_XMLOBJECT_SIMPLE(SAML_API,GivenName,Name,SAML 2.0 GivenName element);
73         DECL_XMLOBJECT_SIMPLE(SAML_API,NameIDFormat,Format,SAML 2.0 NameIDFormat element);
74         DECL_XMLOBJECT_SIMPLE(SAML_API,SurName,Name,SAML 2.0 SurName element);
75         DECL_XMLOBJECT_SIMPLE(SAML_API,TelephoneNumber,Number,SAML 2.0 TelephoneNumber element);
76         
77         DECL_XMLOBJECT_SIMPLE(SAML_API,ActionNamespace,Namespace,SAML 2.0 Metadata Extension ActionNamespace element);
78         DECL_XMLOBJECT_SIMPLE(SAML_API,SourceID,ID,SAML 1.x Metadata Profile SourceID element);
79
80         BEGIN_XMLOBJECT(SAML_API,localizedNameType,xmltooling::XMLObject,SAML 2.0 localizedNameType type);
81             DECL_STRING_ATTRIB(Lang,LANG);
82             /** localizedNameType local name */
83             static const XMLCh TYPE_NAME[];
84         END_XMLOBJECT;
85
86         BEGIN_XMLOBJECT(SAML_API,localizedURIType,xmltooling::XMLObject,SAML 2.0 localizedURIType type);
87             DECL_STRING_ATTRIB(Lang,LANG);
88             /** localizedURIType local name */
89             static const XMLCh TYPE_NAME[];
90         END_XMLOBJECT;
91
92         BEGIN_XMLOBJECT(SAML_API,OrganizationName,localizedNameType,SAML 2.0 OrganizationName element);
93             DECL_SIMPLE_CONTENT(Name);
94         END_XMLOBJECT;
95
96         BEGIN_XMLOBJECT(SAML_API,OrganizationDisplayName,localizedNameType,SAML 2.0 OrganizationDisplayName element);
97             DECL_SIMPLE_CONTENT(Name);
98         END_XMLOBJECT;
99
100         BEGIN_XMLOBJECT(SAML_API,OrganizationURL,localizedURIType,SAML 2.0 OrganizationURL element);
101             DECL_SIMPLE_CONTENT(URL);
102         END_XMLOBJECT;
103         
104         BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementProxy,SAML 2.0 Extensions element);
105             /** ExtensionsType local name */
106             static const XMLCh TYPE_NAME[];
107         END_XMLOBJECT;
108
109         BEGIN_XMLOBJECT(SAML_API,Organization,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 Organization element);
110             DECL_TYPED_CHILD(Extensions);
111             DECL_TYPED_CHILDREN(OrganizationName);
112             DECL_TYPED_CHILDREN(OrganizationDisplayName);
113             DECL_TYPED_CHILDREN(OrganizationURL);
114             /** OrganizationType local name */
115             static const XMLCh TYPE_NAME[];
116         END_XMLOBJECT;
117
118         BEGIN_XMLOBJECT(SAML_API,ContactPerson,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 ContactPerson element);
119             DECL_STRING_ATTRIB(ContactType,CONTACTTYPE);
120             DECL_TYPED_CHILD(Extensions);
121             DECL_TYPED_CHILD(Company);
122             DECL_TYPED_CHILD(GivenName);
123             DECL_TYPED_CHILD(SurName);
124             DECL_TYPED_CHILDREN(EmailAddress);
125             DECL_TYPED_CHILDREN(TelephoneNumber);
126             /** ContactType local name */
127             static const XMLCh TYPE_NAME[];
128             /** technical Contact Type */
129             static const XMLCh CONTACT_TECHNICAL[];
130             /** support Contact Type */
131             static const XMLCh CONTACT_SUPPORT[];
132             /** administrative Contact Type */
133             static const XMLCh CONTACT_ADMINISTRATIVE[];
134             /** billing Contact Type */
135             static const XMLCh CONTACT_BILLING[];
136             /** other Contact Type */
137             static const XMLCh CONTACT_OTHER[];
138         END_XMLOBJECT;
139
140         BEGIN_XMLOBJECT(SAML_API,AdditionalMetadataLocation,xmltooling::XMLObject,SAML 2.0 AdditionalMetadataLocation element);
141             DECL_STRING_ATTRIB(Namespace,NAMESPACE);
142             DECL_SIMPLE_CONTENT(Location);
143             /** AdditionalMetadataLocationType local name */
144             static const XMLCh TYPE_NAME[];
145         END_XMLOBJECT;
146
147         BEGIN_XMLOBJECT(SAML_API,KeyDescriptor,xmltooling::XMLObject,SAML 2.0 KeyDescriptor element);
148             DECL_STRING_ATTRIB(Use,USE);
149             DECL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
150             DECL_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption);
151             /** KeyDescriptorType local name */
152             static const XMLCh TYPE_NAME[];
153             /** encryption Key Type */
154             static const XMLCh KEYTYPE_ENCRYPTION[];
155             /** signing Key Type */
156             static const XMLCh KEYTYPE_SIGNING[];
157         END_XMLOBJECT;
158
159         BEGIN_XMLOBJECT4(SAML_API,RoleDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject,
160                 CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 RoleDescriptor abstract element);
161             DECL_STRING_ATTRIB(ID,ID);
162             DECL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION);
163             /** Searches the ProtocolSupportEnumeration attribute for the indicated protocol. */
164             virtual bool hasSupport(const XMLCh* protocol) const=0;
165             DECL_STRING_ATTRIB(ErrorURL,ERRORURL);
166             DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
167             DECL_TYPED_CHILD(Extensions);
168             DECL_TYPED_CHILDREN(KeyDescriptor);
169             DECL_TYPED_CHILD(Organization);
170             DECL_TYPED_CHILDREN(ContactPerson);
171         END_XMLOBJECT;
172
173         BEGIN_XMLOBJECT2(SAML_API,EndpointType,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 EndpointType type);
174             DECL_STRING_ATTRIB(Binding,BINDING);
175             DECL_STRING_ATTRIB(Location,LOCATION);
176             DECL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION);
177             /** EndpointType local name */
178             static const XMLCh TYPE_NAME[];
179         END_XMLOBJECT;
180
181         BEGIN_XMLOBJECT(SAML_API,IndexedEndpointType,EndpointType,SAML 2.0 IndexedEndpointType type);
182             DECL_INTEGER_ATTRIB(Index,INDEX);
183             DECL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,false);
184             /** IndexedEndpointType local name */
185             static const XMLCh TYPE_NAME[];
186         END_XMLOBJECT;
187
188         BEGIN_XMLOBJECT(SAML_API,ArtifactResolutionService,IndexedEndpointType,SAML 2.0 ArtifactResolutionService element);
189         END_XMLOBJECT;
190
191         BEGIN_XMLOBJECT(SAML_API,SingleLogoutService,EndpointType,SAML 2.0 SingleLogoutService element);
192         END_XMLOBJECT;
193
194         BEGIN_XMLOBJECT(SAML_API,ManageNameIDService,EndpointType,SAML 2.0 ManageNameIDService element);
195         END_XMLOBJECT;
196
197         BEGIN_XMLOBJECT(SAML_API,SSODescriptorType,RoleDescriptor,SAML 2.0 SSODescriptorType abstract type);
198             DECL_TYPED_CHILDREN(ArtifactResolutionService);
199             DECL_TYPED_CHILDREN(SingleLogoutService);
200             DECL_TYPED_CHILDREN(ManageNameIDService);
201             DECL_TYPED_CHILDREN(NameIDFormat);
202             /** SSODescriptorType local name */
203             static const XMLCh TYPE_NAME[];
204         END_XMLOBJECT;
205
206         BEGIN_XMLOBJECT(SAML_API,SingleSignOnService,EndpointType,SAML 2.0 SingleSignOnService element);
207         END_XMLOBJECT;
208
209         BEGIN_XMLOBJECT(SAML_API,NameIDMappingService,EndpointType,SAML 2.0 NameIDMappingService element);
210         END_XMLOBJECT;
211
212         BEGIN_XMLOBJECT(SAML_API,AssertionIDRequestService,EndpointType,SAML 2.0 AssertionIDRequestService element);
213         END_XMLOBJECT;
214
215         BEGIN_XMLOBJECT(SAML_API,IDPSSODescriptor,SSODescriptorType,SAML 2.0 IDPSSODescriptor element);
216             DECL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned,WANTAUTHNREQUESTSSIGNED,false);
217             DECL_TYPED_CHILDREN(SingleSignOnService);
218             DECL_TYPED_CHILDREN(NameIDMappingService);
219             DECL_TYPED_CHILDREN(AssertionIDRequestService);
220             DECL_TYPED_CHILDREN(AttributeProfile);
221             DECL_TYPED_FOREIGN_CHILDREN(Attribute,saml2);
222             /** IDPSSODescriptorType local name */
223             static const XMLCh TYPE_NAME[];
224         END_XMLOBJECT;
225
226         BEGIN_XMLOBJECT(SAML_API,ServiceName,localizedNameType,SAML 2.0 ServiceName element);
227             DECL_SIMPLE_CONTENT(Name);
228         END_XMLOBJECT;
229
230         BEGIN_XMLOBJECT(SAML_API,ServiceDescription,localizedNameType,SAML 2.0 ServiceDescription element);
231             DECL_SIMPLE_CONTENT(Description);
232         END_XMLOBJECT;
233
234         BEGIN_XMLOBJECT(SAML_API,RequestedAttribute,saml2::Attribute,SAML 2.0 RequestedAttribute element);
235             DECL_BOOLEAN_ATTRIB(isRequired,ISREQUIRED,false);
236             /** RequestedAttributeType local name */
237             static const XMLCh TYPE_NAME[];
238         END_XMLOBJECT;
239
240         BEGIN_XMLOBJECT(SAML_API,AttributeConsumingService,xmltooling::XMLObject,SAML 2.0 AttributeConsumingService element);
241             DECL_INTEGER_ATTRIB(Index,INDEX);
242             DECL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,false);
243             DECL_TYPED_CHILDREN(ServiceName);
244             DECL_TYPED_CHILDREN(ServiceDescription);
245             DECL_TYPED_CHILDREN(RequestedAttribute);
246             /** AttributeConsumingServiceType local name */
247             static const XMLCh TYPE_NAME[];
248         END_XMLOBJECT;
249
250         BEGIN_XMLOBJECT(SAML_API,AssertionConsumerService,IndexedEndpointType,SAML 2.0 AssertionConsumerService element);
251         END_XMLOBJECT;
252
253         BEGIN_XMLOBJECT(SAML_API,SPSSODescriptor,SSODescriptorType,SAML 2.0 SPSSODescriptor element);
254             DECL_BOOLEAN_ATTRIB(AuthnRequestsSigned,AUTHNREQUESTSSIGNED,false);
255             DECL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,false);
256             DECL_TYPED_CHILDREN(AssertionConsumerService);
257             DECL_TYPED_CHILDREN(AttributeConsumingService);
258             /** SPSSODescriptorType local name */
259             static const XMLCh TYPE_NAME[];
260         END_XMLOBJECT;
261
262         BEGIN_XMLOBJECT(SAML_API,AuthnQueryService,EndpointType,SAML 2.0 AuthnQueryService element);
263         END_XMLOBJECT;
264
265         BEGIN_XMLOBJECT(SAML_API,AuthnAuthorityDescriptor,RoleDescriptor,SAML 2.0 AuthnAuthorityDescriptor element);
266             DECL_TYPED_CHILDREN(AuthnQueryService);
267             DECL_TYPED_CHILDREN(AssertionIDRequestService);
268             DECL_TYPED_CHILDREN(NameIDFormat);
269             /** AuthnAuthorityDescriptorType local name */
270             static const XMLCh TYPE_NAME[];
271         END_XMLOBJECT;
272
273         BEGIN_XMLOBJECT(SAML_API,AuthzService,EndpointType,SAML 2.0 AuthzService element);
274         END_XMLOBJECT;
275
276         BEGIN_XMLOBJECT(SAML_API,PDPDescriptor,RoleDescriptor,SAML 2.0 PDPDescriptor element);
277             DECL_TYPED_CHILDREN(AuthzService);
278             DECL_TYPED_CHILDREN(AssertionIDRequestService);
279             DECL_TYPED_CHILDREN(NameIDFormat);
280             /** PDPDescriptorType local name */
281             static const XMLCh TYPE_NAME[];
282         END_XMLOBJECT;
283
284         BEGIN_XMLOBJECT(SAML_API,AttributeService,EndpointType,SAML 2.0 AttributeService element);
285         END_XMLOBJECT;
286
287         BEGIN_XMLOBJECT(SAML_API,AttributeAuthorityDescriptor,RoleDescriptor,SAML 2.0 AttributeAuthorityDescriptor element);
288             DECL_TYPED_CHILDREN(AttributeService);
289             DECL_TYPED_CHILDREN(AssertionIDRequestService);
290             DECL_TYPED_CHILDREN(NameIDFormat);
291             DECL_TYPED_CHILDREN(AttributeProfile);
292             DECL_TYPED_FOREIGN_CHILDREN(Attribute,saml2);
293             /** AttributeAuthorityDescriptorType local name */
294             static const XMLCh TYPE_NAME[];
295         END_XMLOBJECT;
296
297         BEGIN_XMLOBJECT(SAML_API,QueryDescriptorType,RoleDescriptor,SAML 2.0 QueryDescriptorType abstract type);
298             DECL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,false);
299             DECL_TYPED_CHILDREN(NameIDFormat);
300             /** QueryDescriptorType local name */
301             static const XMLCh TYPE_NAME[];
302         END_XMLOBJECT;
303
304         BEGIN_XMLOBJECT(SAML_API,AuthnQueryDescriptorType,QueryDescriptorType,SAML 2.0 AuthnQueryDescriptorType extension type);
305             /** AuthnQueryDescriptorType local name */
306             static const XMLCh TYPE_NAME[];
307         END_XMLOBJECT;
308
309         BEGIN_XMLOBJECT(SAML_API,AttributeQueryDescriptorType,QueryDescriptorType,SAML 2.0 AttributeQueryDescriptorType extension type);
310             DECL_TYPED_CHILDREN(AttributeConsumingService);
311             /** AttributeQueryDescriptorType local name */
312             static const XMLCh TYPE_NAME[];
313         END_XMLOBJECT;
314
315         BEGIN_XMLOBJECT(SAML_API,AuthzDecisionQueryDescriptorType,QueryDescriptorType,SAML 2.0 AuthzDecisionQueryDescriptorType extension type);
316             DECL_TYPED_CHILDREN(ActionNamespace);
317             /** AuthzDecisionQueryDescriptorType local name */
318             static const XMLCh TYPE_NAME[];
319         END_XMLOBJECT;
320
321         BEGIN_XMLOBJECT4(SAML_API,AffiliationDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject,
322                 CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 AffiliationDescriptor element);
323             DECL_STRING_ATTRIB(ID,ID);
324             DECL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID);
325             DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
326             DECL_TYPED_CHILD(Extensions);
327             DECL_TYPED_CHILDREN(AffiliateMember);
328             DECL_TYPED_CHILDREN(KeyDescriptor);
329             /** AffiliationDescriptorType local name */
330             static const XMLCh TYPE_NAME[];
331         END_XMLOBJECT;
332
333         BEGIN_XMLOBJECT4(SAML_API,EntityDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject,
334                 CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 EntityDescriptor element);
335             DECL_STRING_ATTRIB(ID,ID);
336             DECL_STRING_ATTRIB(EntityID,ENTITYID);
337             DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
338             DECL_TYPED_CHILD(Extensions);
339             DECL_TYPED_CHILD(AffiliationDescriptor);
340             DECL_TYPED_CHILDREN(RoleDescriptor);
341             DECL_TYPED_CHILDREN(IDPSSODescriptor);
342             DECL_TYPED_CHILDREN(SPSSODescriptor);
343             DECL_TYPED_CHILDREN(AuthnAuthorityDescriptor);
344             DECL_TYPED_CHILDREN(AttributeAuthorityDescriptor);
345             DECL_TYPED_CHILDREN(PDPDescriptor);
346             DECL_TYPED_CHILDREN(AuthnQueryDescriptorType);
347             DECL_TYPED_CHILDREN(AttributeQueryDescriptorType);
348             DECL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType);
349             /** Finds an IDP role supporting a given protocol. */
350             virtual const IDPSSODescriptor* getIDPSSODescriptor(const XMLCh* protocol) const=0;
351             /** Finds an SP role supporting a given protocol. */
352             virtual const SPSSODescriptor* getSPSSODescriptor(const XMLCh* protocol) const=0;
353             /** Finds an Authn Authority role supporting a given protocol. */
354             virtual const AuthnAuthorityDescriptor* getAuthnAuthorityDescriptor(const XMLCh* protocol) const=0;
355             /** Finds an Attribute Authority role supporting a given protocol. */
356             virtual const AttributeAuthorityDescriptor* getAttributeAuthorityDescriptor(const XMLCh* protocol) const=0;
357             /** Finds a PDP role supporting a given protocol. */
358             virtual const PDPDescriptor* getPDPDescriptor(const XMLCh* protocol) const=0;
359             /** Finds an AuthnQuery role supporting a given protocol. */
360             virtual const AuthnQueryDescriptorType* getAuthnQueryDescriptorType(const XMLCh* protocol) const=0;
361             /** Finds an AttributeQuery role supporting a given protocol. */
362             virtual const AttributeQueryDescriptorType* getAttributeQueryDescriptorType(const XMLCh* protocol) const=0;
363             /** Finds an AuthzDecisionQuery role supporting a given protocol. */
364             virtual const AuthzDecisionQueryDescriptorType* getAuthzDecisionQueryDescriptorType(const XMLCh* protocol) const=0;
365             /** Finds an extension role supporting a given protocol. */
366             virtual const RoleDescriptor* getRoleDescriptor(const xmltooling::QName& qname, const XMLCh* protocol) const=0;
367             /** EntityDescriptorType local name */
368             static const XMLCh TYPE_NAME[];
369         END_XMLOBJECT;
370
371         BEGIN_XMLOBJECT3(SAML_API,EntitiesDescriptor,SignableObject,CacheableSAMLObject,
372                 TimeBoundSAMLObject,SAML 2.0 EntitiesDescriptor element);
373             DECL_STRING_ATTRIB(ID,ID);
374             DECL_STRING_ATTRIB(Name,NAME);
375             DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
376             DECL_TYPED_CHILD(Extensions);
377             DECL_TYPED_CHILDREN(EntityDescriptor);
378             DECL_TYPED_CHILDREN(EntitiesDescriptor);
379             /** EntitiesDescriptorType local name */
380             static const XMLCh TYPE_NAME[];
381         END_XMLOBJECT;
382
383         DECL_SAML2MDOBJECTBUILDER(AdditionalMetadataLocation);
384         DECL_SAML2MDOBJECTBUILDER(AffiliateMember);
385         DECL_SAML2MDOBJECTBUILDER(AffiliationDescriptor);
386         DECL_SAML2MDOBJECTBUILDER(ArtifactResolutionService);
387         DECL_SAML2MDOBJECTBUILDER(AssertionConsumerService);
388         DECL_SAML2MDOBJECTBUILDER(AssertionIDRequestService);
389         DECL_SAML2MDOBJECTBUILDER(AttributeAuthorityDescriptor);
390         DECL_SAML2MDOBJECTBUILDER(AttributeConsumingService);
391         DECL_SAML2MDOBJECTBUILDER(AttributeProfile);
392         DECL_SAML2MDOBJECTBUILDER(AttributeService);
393         DECL_SAML2MDOBJECTBUILDER(AuthnAuthorityDescriptor);
394         DECL_SAML2MDOBJECTBUILDER(AuthnQueryService);
395         DECL_SAML2MDOBJECTBUILDER(AuthzService);
396         DECL_SAML2MDOBJECTBUILDER(Company);
397         DECL_SAML2MDOBJECTBUILDER(ContactPerson);
398         DECL_SAML2MDOBJECTBUILDER(EmailAddress);
399         DECL_SAML2MDOBJECTBUILDER(EntitiesDescriptor);
400         DECL_SAML2MDOBJECTBUILDER(EntityDescriptor);
401         DECL_SAML2MDOBJECTBUILDER(Extensions);
402         DECL_SAML2MDOBJECTBUILDER(GivenName);
403         DECL_SAML2MDOBJECTBUILDER(IDPSSODescriptor);
404         DECL_SAML2MDOBJECTBUILDER(KeyDescriptor);
405         DECL_SAML2MDOBJECTBUILDER(ManageNameIDService);
406         DECL_SAML2MDOBJECTBUILDER(NameIDFormat);
407         DECL_SAML2MDOBJECTBUILDER(NameIDMappingService);
408         DECL_SAML2MDOBJECTBUILDER(Organization);
409         DECL_SAML2MDOBJECTBUILDER(OrganizationName);
410         DECL_SAML2MDOBJECTBUILDER(OrganizationDisplayName);
411         DECL_SAML2MDOBJECTBUILDER(OrganizationURL);
412         DECL_SAML2MDOBJECTBUILDER(PDPDescriptor);
413         DECL_SAML2MDOBJECTBUILDER(RequestedAttribute);
414         DECL_SAML2MDOBJECTBUILDER(ServiceDescription);
415         DECL_SAML2MDOBJECTBUILDER(ServiceName);
416         DECL_SAML2MDOBJECTBUILDER(SingleLogoutService);
417         DECL_SAML2MDOBJECTBUILDER(SingleSignOnService);
418         DECL_SAML2MDOBJECTBUILDER(SPSSODescriptor);
419         DECL_SAML2MDOBJECTBUILDER(SurName);
420         DECL_SAML2MDOBJECTBUILDER(TelephoneNumber);
421         
422         DECL_XMLOBJECTBUILDER(SAML_API,ActionNamespace,samlconstants::SAML20MD_QUERY_EXT_NS,samlconstants::SAML20MD_QUERY_EXT_PREFIX);
423         DECL_XMLOBJECTBUILDER(SAML_API,SourceID,samlconstants::SAML1MD_NS,samlconstants::SAML1MD_PREFIX);
424
425         /**
426          * Builder for localizedNameType objects.
427          * 
428          * This is customized to force the element name to be specified.
429          */
430         class SAML_API localizedNameTypeBuilder : public xmltooling::XMLObjectBuilder {
431         public:
432             virtual ~localizedNameTypeBuilder() {}
433             /** Builder that allows element/type override. */
434             virtual localizedNameType* buildObject(
435                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
436                 ) const;
437         
438             /** Singleton builder. */
439             static localizedNameType* buildlocalizedNameType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
440                 const localizedNameTypeBuilder* b = dynamic_cast<const localizedNameTypeBuilder*>(
441                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,localizedNameType::TYPE_NAME))
442                     );
443                 if (b) {
444                     xmltooling::QName schemaType(samlconstants::SAML20MD_NS,localizedNameType::TYPE_NAME,samlconstants::SAML20MD_PREFIX);
445                     return b->buildObject(nsURI, localName, prefix, &schemaType);
446                 }
447                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for localizedNameType.");
448             }
449         };
450
451         /**
452          * Builder for localizedURIType objects.
453          * 
454          * This is customized to force the element name to be specified.
455          */
456         class SAML_API localizedURITypeBuilder : public xmltooling::XMLObjectBuilder {
457         public:
458             virtual ~localizedURITypeBuilder() {}
459             /** Builder that allows element/type override. */
460             virtual localizedURIType* buildObject(
461                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
462                 ) const;
463         
464             /** Singleton builder. */
465             static localizedURIType* buildlocalizedURIType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
466                 const localizedURITypeBuilder* b = dynamic_cast<const localizedURITypeBuilder*>(
467                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,localizedURIType::TYPE_NAME))
468                     );
469                 if (b) {
470                     xmltooling::QName schemaType(samlconstants::SAML20MD_NS,localizedURIType::TYPE_NAME,samlconstants::SAML20MD_PREFIX);
471                     return b->buildObject(nsURI, localName, prefix, &schemaType);
472                 }
473                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for localizedURIType.");
474             }
475         };
476
477         /**
478          * Builder for EndpointType objects.
479          * 
480          * This is customized to force the element name to be specified.
481          */
482         class SAML_API EndpointTypeBuilder : public xmltooling::XMLObjectBuilder {
483         public:
484             virtual ~EndpointTypeBuilder() {}
485             /** Builder that allows element/type override. */
486             virtual EndpointType* buildObject(
487                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
488                 ) const;
489         
490             /** Singleton builder. */
491             static EndpointType* buildEndpointType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
492                 const EndpointTypeBuilder* b = dynamic_cast<const EndpointTypeBuilder*>(
493                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,EndpointType::TYPE_NAME))
494                     );
495                 if (b) {
496                     xmltooling::QName schemaType(samlconstants::SAML20MD_NS,EndpointType::TYPE_NAME,samlconstants::SAML20MD_PREFIX);
497                     return b->buildObject(nsURI, localName, prefix, &schemaType);
498                 }
499                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for EndpointType.");
500             }
501         };
502
503         /**
504          * Builder for IndexedEndpointType objects.
505          * 
506          * This is customized to force the element name to be specified.
507          */
508         class SAML_API IndexedEndpointTypeBuilder : public xmltooling::XMLObjectBuilder {
509         public:
510             virtual ~IndexedEndpointTypeBuilder() {}
511             /** Builder that allows element/type override. */
512             virtual IndexedEndpointType* buildObject(
513                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
514                 ) const;
515         
516             /** Singleton builder. */
517             static IndexedEndpointType* buildIndexedEndpointType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
518                 const IndexedEndpointTypeBuilder* b = dynamic_cast<const IndexedEndpointTypeBuilder*>(
519                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME))
520                     );
521                 if (b) {
522                     xmltooling::QName schemaType(samlconstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME,samlconstants::SAML20MD_PREFIX);
523                     return b->buildObject(nsURI, localName, prefix, &schemaType);
524                 }
525                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for IndexedEndpointType.");
526             }
527         };
528
529         /**
530          * Builder for AuthnQueryDescriptorType objects.
531          * 
532          * This is customized to return a RoleDescriptor element with an
533          * xsi:type of AuthnQueryDescriptorType.
534          */
535         class SAML_API AuthnQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
536         public:
537             virtual ~AuthnQueryDescriptorTypeBuilder() {}
538             /** Default builder. */
539             virtual AuthnQueryDescriptorType* buildObject() const {
540                 xmltooling::QName schemaType(
541                     samlconstants::SAML20_NS,AuthnQueryDescriptorType::TYPE_NAME,samlconstants::SAML20MD_QUERY_EXT_PREFIX
542                     );
543                 return buildObject(
544                     samlconstants::SAML20_NS,AuthnQueryDescriptorType::LOCAL_NAME,samlconstants::SAML20_PREFIX,&schemaType
545                     );
546             }
547             /** Builder that allows element/type override. */
548             virtual AuthnQueryDescriptorType* buildObject(
549                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
550                 ) const;
551         
552             /** Singleton builder. */
553             static AuthnQueryDescriptorType* buildAuthnQueryDescriptorType() {
554                 const AuthnQueryDescriptorTypeBuilder* b = dynamic_cast<const AuthnQueryDescriptorTypeBuilder*>(
555                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_QUERY_EXT_NS,AuthnQueryDescriptorType::TYPE_NAME))
556                     );
557                 if (b)
558                     return b->buildObject();
559                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthnQueryDescriptorType.");
560             }
561         };
562
563         /**
564          * Builder for AttributeQueryDescriptorType objects.
565          * 
566          * This is customized to return a RoleDescriptor element with an
567          * xsi:type of AttributeQueryDescriptorType.
568          */
569         class SAML_API AttributeQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
570         public:
571             virtual ~AttributeQueryDescriptorTypeBuilder() {}
572             /** Default builder. */
573             virtual AttributeQueryDescriptorType* buildObject() const {
574                 xmltooling::QName schemaType(
575                     samlconstants::SAML20_NS,AttributeQueryDescriptorType::TYPE_NAME,samlconstants::SAML20MD_QUERY_EXT_PREFIX
576                     );
577                 return buildObject(
578                     samlconstants::SAML20_NS,AttributeQueryDescriptorType::LOCAL_NAME,samlconstants::SAML20_PREFIX,&schemaType
579                     );
580             }
581             /** Builder that allows element/type override. */
582             virtual AttributeQueryDescriptorType* buildObject(
583                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
584                 ) const;
585         
586             /** Singleton builder. */
587             static AttributeQueryDescriptorType* buildAttributeQueryDescriptorType() {
588                 const AttributeQueryDescriptorTypeBuilder* b = dynamic_cast<const AttributeQueryDescriptorTypeBuilder*>(
589                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_QUERY_EXT_NS,AttributeQueryDescriptorType::TYPE_NAME))
590                     );
591                 if (b)
592                     return b->buildObject();
593                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for AttributeQueryDescriptorType.");
594             }
595         };
596
597         /**
598          * Builder for AuthzDecisionQueryDescriptorType objects.
599          * 
600          * This is customized to return a RoleDescriptor element with an
601          * xsi:type of AuthzDecisionQueryDescriptorType.
602          */
603         class SAML_API AuthzDecisionQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
604         public:
605             virtual ~AuthzDecisionQueryDescriptorTypeBuilder() {}
606             /** Default builder. */
607             virtual AuthzDecisionQueryDescriptorType* buildObject() const {
608                 xmltooling::QName schemaType(
609                     samlconstants::SAML20_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME,samlconstants::SAML20MD_QUERY_EXT_PREFIX
610                     );
611                 return buildObject(
612                     samlconstants::SAML20_NS,AuthzDecisionQueryDescriptorType::LOCAL_NAME,samlconstants::SAML20_PREFIX,&schemaType
613                     );
614             }
615             /** Builder that allows element/type override. */
616             virtual AuthzDecisionQueryDescriptorType* buildObject(
617                 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
618                 ) const;
619         
620             /** Singleton builder. */
621             static AuthzDecisionQueryDescriptorType* buildAuthzDecisionQueryDescriptorType() {
622                 const AuthzDecisionQueryDescriptorTypeBuilder* b = dynamic_cast<const AuthzDecisionQueryDescriptorTypeBuilder*>(
623                     XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME))
624                     );
625                 if (b)
626                     return b->buildObject();
627                 throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthzDecisionQueryDescriptorType.");
628             }
629         };
630
631         /**
632          * Registers builders and validators for SAML 2.0 Metadata classes into the runtime.
633          */
634         void SAML_API registerMetadataClasses();
635     };
636 };
637
638 #endif /* __saml2_metadata_h__ */