2 * Copyright 2001-2006 Internet2
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * Implementation classes for SAML 2.0 Assertions schema
24 #include "exceptions.h"
25 #include "saml2/metadata/Metadata.h"
27 #include <xmltooling/AbstractChildlessElement.h>
28 #include <xmltooling/AbstractComplexElement.h>
29 #include <xmltooling/AbstractElementProxy.h>
30 #include <xmltooling/AbstractSimpleElement.h>
31 #include <xmltooling/impl/AnyElement.h>
32 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
33 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
34 #include <xmltooling/util/XMLHelper.h>
37 #include <xercesc/util/XMLUniDefs.hpp>
39 using namespace opensaml::saml2md;
40 using namespace opensaml::saml2;
41 using namespace opensaml;
42 using namespace xmlencryption;
43 using namespace xmlsignature;
44 using namespace xmltooling;
47 #if defined (_MSC_VER)
48 #pragma warning( push )
49 #pragma warning( disable : 4250 4251 )
55 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AffiliateMember);
56 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AttributeProfile);
57 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Company);
58 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,EmailAddress);
59 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,GivenName);
60 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,NameIDFormat);
61 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SurName);
62 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,TelephoneNumber);
64 class SAML_DLLLOCAL localizedNameTypeImpl : public virtual localizedNameType,
65 public AbstractSimpleElement,
66 public AbstractChildlessElement,
67 public AbstractDOMCachingXMLObject,
68 public AbstractXMLObjectMarshaller,
69 public AbstractXMLObjectUnmarshaller
76 localizedNameTypeImpl() {
81 virtual ~localizedNameTypeImpl() {
82 XMLString::release(&m_Lang);
85 localizedNameTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
86 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
90 localizedNameTypeImpl(const localizedNameTypeImpl& src)
91 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
93 setLang(src.getLang());
96 IMPL_XMLOBJECT_CLONE(localizedNameType);
97 IMPL_XMLOBJECT_CONTENT;
98 IMPL_STRING_ATTRIB(Lang);
101 void marshallAttributes(DOMElement* domElement) const {
102 MARSHALL_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
105 void processAttribute(const DOMAttr* attribute) {
106 PROC_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
107 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
111 class SAML_DLLLOCAL localizedURITypeImpl : public virtual localizedURIType,
112 public AbstractSimpleElement,
113 public AbstractChildlessElement,
114 public AbstractDOMCachingXMLObject,
115 public AbstractXMLObjectMarshaller,
116 public AbstractXMLObjectUnmarshaller
123 localizedURITypeImpl() {
128 virtual ~localizedURITypeImpl() {
129 XMLString::release(&m_Lang);
132 localizedURITypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
133 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
137 localizedURITypeImpl(const localizedURITypeImpl& src)
138 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
140 setLang(src.getLang());
143 IMPL_XMLOBJECT_CLONE(localizedURIType);
144 IMPL_XMLOBJECT_CONTENT;
145 IMPL_STRING_ATTRIB(Lang);
148 void marshallAttributes(DOMElement* domElement) const {
149 MARSHALL_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
152 void processAttribute(const DOMAttr* attribute) {
153 PROC_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
154 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
158 class SAML_DLLLOCAL OrganizationNameImpl : public virtual OrganizationName, public localizedNameTypeImpl
161 virtual ~OrganizationNameImpl() {}
163 OrganizationNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
164 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
166 OrganizationNameImpl(const OrganizationNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
168 IMPL_XMLOBJECT_CLONE(OrganizationName);
169 localizedNameType* clonelocalizedNameType() const {
170 return new OrganizationNameImpl(*this);
174 class SAML_DLLLOCAL OrganizationDisplayNameImpl : public virtual OrganizationDisplayName, public localizedNameTypeImpl
177 virtual ~OrganizationDisplayNameImpl() {}
179 OrganizationDisplayNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
180 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
182 OrganizationDisplayNameImpl(const OrganizationDisplayNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
184 IMPL_XMLOBJECT_CLONE(OrganizationDisplayName);
185 localizedNameType* clonelocalizedNameType() const {
186 return new OrganizationDisplayNameImpl(*this);
190 class SAML_DLLLOCAL OrganizationURLImpl : public virtual OrganizationURL, public localizedURITypeImpl
193 virtual ~OrganizationURLImpl() {}
195 OrganizationURLImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
196 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
198 OrganizationURLImpl(const OrganizationURLImpl& src) : AbstractXMLObject(src), localizedURITypeImpl(src) {}
200 IMPL_XMLOBJECT_CLONE(OrganizationURL);
201 localizedURIType* clonelocalizedURIType() const {
202 return new OrganizationURLImpl(*this);
206 class SAML_DLLLOCAL ServiceNameImpl : public virtual ServiceName, public localizedNameTypeImpl
209 virtual ~ServiceNameImpl() {}
211 ServiceNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
212 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
214 ServiceNameImpl(const ServiceNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
216 IMPL_XMLOBJECT_CLONE(ServiceName);
217 localizedNameType* clonelocalizedNameType() const {
218 return new ServiceNameImpl(*this);
222 class SAML_DLLLOCAL ServiceDescriptionImpl : public virtual ServiceDescription, public localizedNameTypeImpl
225 virtual ~ServiceDescriptionImpl() {}
227 ServiceDescriptionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
228 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
230 ServiceDescriptionImpl(const ServiceDescriptionImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
232 IMPL_XMLOBJECT_CLONE(ServiceDescription);
233 localizedNameType* clonelocalizedNameType() const {
234 return new ServiceDescriptionImpl(*this);
238 class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
239 public AbstractElementProxy,
240 public AbstractDOMCachingXMLObject,
241 public AbstractXMLObjectMarshaller,
242 public AbstractXMLObjectUnmarshaller
245 virtual ~ExtensionsImpl() {}
247 ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
248 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
251 ExtensionsImpl(const ExtensionsImpl& src)
252 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src) {
253 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
255 getXMLObjects().push_back((*i)->clone());
260 IMPL_XMLOBJECT_CLONE(Extensions);
263 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
265 const XMLCh* nsURI=root->getNamespaceURI();
266 if (!XMLString::equals(nsURI,SAMLConstants::SAML20MD_NS) && nsURI && *nsURI) {
267 getXMLObjects().push_back(childXMLObject);
271 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
275 class SAML_DLLLOCAL OrganizationImpl : public virtual Organization,
276 public AbstractComplexElement,
277 public AbstractAttributeExtensibleXMLObject,
278 public AbstractDOMCachingXMLObject,
279 public AbstractXMLObjectMarshaller,
280 public AbstractXMLObjectUnmarshaller
282 list<XMLObject*>::iterator m_pos_OrganizationDisplayName;
283 list<XMLObject*>::iterator m_pos_OrganizationURL;
286 m_children.push_back(NULL);
287 m_children.push_back(NULL);
288 m_children.push_back(NULL);
290 m_pos_Extensions=m_children.begin();
291 m_pos_OrganizationDisplayName=m_pos_Extensions;
292 ++m_pos_OrganizationDisplayName;
293 m_pos_OrganizationURL=m_pos_OrganizationDisplayName;
294 ++m_pos_OrganizationURL;
297 virtual ~OrganizationImpl() {}
299 OrganizationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
300 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
304 OrganizationImpl(const OrganizationImpl& src)
305 : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
307 if (src.getExtensions())
308 setExtensions(src.getExtensions()->cloneExtensions());
309 VectorOf(OrganizationName) v=getOrganizationNames();
310 for (vector<OrganizationName*>::const_iterator i=src.m_OrganizationNames.begin(); i!=src.m_OrganizationNames.end(); i++) {
312 v.push_back((*i)->cloneOrganizationName());
315 VectorOf(OrganizationDisplayName) w=getOrganizationDisplayNames();
316 for (vector<OrganizationDisplayName*>::const_iterator j=src.m_OrganizationDisplayNames.begin(); j!=src.m_OrganizationDisplayNames.end(); j++) {
318 w.push_back((*j)->cloneOrganizationDisplayName());
321 VectorOf(OrganizationURL) x=getOrganizationURLs();
322 for (vector<OrganizationURL*>::const_iterator k=src.m_OrganizationURLs.begin(); k!=src.m_OrganizationURLs.end(); k++) {
324 x.push_back((*k)->cloneOrganizationURL());
329 IMPL_XMLOBJECT_CLONE(Organization);
330 IMPL_TYPED_CHILD(Extensions);
331 IMPL_TYPED_CHILDREN(OrganizationName,m_pos_OrganizationDisplayName);
332 IMPL_TYPED_CHILDREN(OrganizationDisplayName,m_pos_OrganizationURL);
333 IMPL_TYPED_CHILDREN(OrganizationURL,m_children.end());
336 void marshallAttributes(DOMElement* domElement) const {
337 // Take care of wildcard.
338 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
339 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
340 if (i->first.hasPrefix())
341 attr->setPrefix(i->first.getPrefix());
342 attr->setNodeValue(i->second);
343 domElement->setAttributeNode(attr);
347 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
348 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
349 PROC_TYPED_CHILDREN(OrganizationName,SAMLConstants::SAML20MD_NS,false);
350 PROC_TYPED_CHILDREN(OrganizationDisplayName,SAMLConstants::SAML20MD_NS,false);
351 PROC_TYPED_CHILDREN(OrganizationURL,SAMLConstants::SAML20MD_NS,false);
352 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
355 void processAttribute(const DOMAttr* attribute) {
356 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
357 setAttribute(q,attribute->getNodeValue());
361 class SAML_DLLLOCAL ContactPersonImpl : public virtual ContactPerson,
362 public AbstractComplexElement,
363 public AbstractAttributeExtensibleXMLObject,
364 public AbstractDOMCachingXMLObject,
365 public AbstractXMLObjectMarshaller,
366 public AbstractXMLObjectUnmarshaller
368 list<XMLObject*>::iterator m_pos_TelephoneNumber;
372 m_children.push_back(NULL);
373 m_children.push_back(NULL);
374 m_children.push_back(NULL);
375 m_children.push_back(NULL);
376 m_children.push_back(NULL);
381 m_pos_Extensions=m_children.begin();
382 m_pos_Company=m_pos_Extensions;
384 m_pos_GivenName=m_pos_Company;
386 m_pos_SurName=m_pos_GivenName;
388 m_pos_TelephoneNumber=m_pos_SurName;
389 ++m_pos_TelephoneNumber;
392 virtual ~ContactPersonImpl() {}
394 ContactPersonImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
395 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
399 ContactPersonImpl(const ContactPersonImpl& src)
400 : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
402 if (src.getExtensions())
403 setExtensions(src.getExtensions()->cloneExtensions());
404 if (src.getCompany())
405 setCompany(src.getCompany()->cloneCompany());
406 if (src.getGivenName())
407 setGivenName(src.getGivenName()->cloneGivenName());
408 if (src.getSurName())
409 setSurName(src.getSurName()->cloneSurName());
411 VectorOf(EmailAddress) v=getEmailAddresss();
412 for (vector<EmailAddress*>::const_iterator i=src.m_EmailAddresss.begin(); i!=src.m_EmailAddresss.end(); i++) {
414 v.push_back((*i)->cloneEmailAddress());
417 VectorOf(TelephoneNumber) w=getTelephoneNumbers();
418 for (vector<TelephoneNumber*>::const_iterator j=src.m_TelephoneNumbers.begin(); j!=src.m_TelephoneNumbers.end(); j++) {
420 w.push_back((*j)->cloneTelephoneNumber());
425 IMPL_XMLOBJECT_CLONE(ContactPerson);
426 IMPL_STRING_ATTRIB(ContactType);
427 IMPL_TYPED_CHILD(Extensions);
428 IMPL_TYPED_CHILD(Company);
429 IMPL_TYPED_CHILD(GivenName);
430 IMPL_TYPED_CHILD(SurName);
431 IMPL_TYPED_CHILDREN(EmailAddress,m_pos_TelephoneNumber);
432 IMPL_TYPED_CHILDREN(TelephoneNumber,m_children.end());
434 void setAttribute(QName& qualifiedName, const XMLCh* value) {
435 if (!qualifiedName.hasNamespaceURI()) {
436 if (XMLString::equals(qualifiedName.getLocalPart(),CONTACTTYPE_ATTRIB_NAME)) {
437 setContactType(value);
441 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
445 void marshallAttributes(DOMElement* domElement) const {
446 MARSHALL_STRING_ATTRIB(ContactType,CONTACTTYPE,NULL);
448 // Take care of wildcard.
449 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
450 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
451 if (i->first.hasPrefix())
452 attr->setPrefix(i->first.getPrefix());
453 attr->setNodeValue(i->second);
454 domElement->setAttributeNode(attr);
458 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
459 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
460 PROC_TYPED_CHILD(Company,SAMLConstants::SAML20MD_NS,false);
461 PROC_TYPED_CHILD(GivenName,SAMLConstants::SAML20MD_NS,false);
462 PROC_TYPED_CHILD(SurName,SAMLConstants::SAML20MD_NS,false);
463 PROC_TYPED_CHILDREN(EmailAddress,SAMLConstants::SAML20MD_NS,false);
464 PROC_TYPED_CHILDREN(TelephoneNumber,SAMLConstants::SAML20MD_NS,false);
465 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
468 void processAttribute(const DOMAttr* attribute) {
469 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
470 setAttribute(q,attribute->getNodeValue());
474 class SAML_DLLLOCAL AdditionalMetadataLocationImpl : public virtual AdditionalMetadataLocation,
475 public AbstractSimpleElement,
476 public AbstractChildlessElement,
477 public AbstractDOMCachingXMLObject,
478 public AbstractXMLObjectMarshaller,
479 public AbstractXMLObjectUnmarshaller
486 virtual ~AdditionalMetadataLocationImpl() {
487 XMLString::release(&m_Namespace);
490 AdditionalMetadataLocationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
491 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
495 AdditionalMetadataLocationImpl(const AdditionalMetadataLocationImpl& src)
496 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
500 IMPL_XMLOBJECT_CLONE(AdditionalMetadataLocation);
501 IMPL_XMLOBJECT_CONTENT;
502 IMPL_STRING_ATTRIB(Namespace);
505 void marshallAttributes(DOMElement* domElement) const {
506 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
509 void processAttribute(const DOMAttr* attribute) {
510 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
511 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
515 class SAML_DLLLOCAL KeyDescriptorImpl : public virtual KeyDescriptor,
516 public AbstractComplexElement,
517 public AbstractDOMCachingXMLObject,
518 public AbstractXMLObjectMarshaller,
519 public AbstractXMLObjectUnmarshaller
524 m_children.push_back(NULL);
525 m_pos_KeyInfo=m_children.begin();
528 virtual ~KeyDescriptorImpl() {
529 XMLString::release(&m_Use);
532 KeyDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
533 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
537 KeyDescriptorImpl(const KeyDescriptorImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
539 setUse(src.getUse());
540 if (src.getKeyInfo())
541 setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
542 VectorOf(EncryptionMethod) v=getEncryptionMethods();
543 for (vector<EncryptionMethod*>::const_iterator i=src.m_EncryptionMethods.begin(); i!=src.m_EncryptionMethods.end(); i++) {
545 v.push_back((*i)->cloneEncryptionMethod());
550 IMPL_XMLOBJECT_CLONE(KeyDescriptor);
551 IMPL_STRING_ATTRIB(Use);
552 IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
553 IMPL_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption,m_children.end());
556 void marshallAttributes(DOMElement* domElement) const {
557 MARSHALL_STRING_ATTRIB(Use,USE,NULL);
560 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
561 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLConstants::XMLSIG_NS,false);
562 PROC_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption,SAMLConstants::SAML20MD_NS,false);
563 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
566 void processAttribute(const DOMAttr* attribute) {
567 PROC_STRING_ATTRIB(Use,USE,NULL);
568 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
572 class SAML_DLLLOCAL EndpointTypeImpl : public virtual EndpointType,
573 public AbstractElementProxy,
574 public AbstractAttributeExtensibleXMLObject,
575 public AbstractDOMCachingXMLObject,
576 public AbstractXMLObjectMarshaller,
577 public AbstractXMLObjectUnmarshaller
580 m_Binding=m_Location=m_ResponseLocation=NULL;
589 virtual ~EndpointTypeImpl() {
590 XMLString::release(&m_Binding);
591 XMLString::release(&m_Location);
592 XMLString::release(&m_ResponseLocation);
595 EndpointTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
596 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
599 EndpointTypeImpl(const EndpointTypeImpl& src)
600 : AbstractXMLObject(src), AbstractElementProxy(src),
601 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
602 setBinding(src.getBinding());
603 setLocation(src.getLocation());
604 setResponseLocation(src.getResponseLocation());
605 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
607 getXMLObjects().push_back((*i)->clone());
612 IMPL_XMLOBJECT_CLONE(EndpointType);
613 IMPL_STRING_ATTRIB(Binding);
614 IMPL_STRING_ATTRIB(Location);
615 IMPL_STRING_ATTRIB(ResponseLocation);
617 void setAttribute(QName& qualifiedName, const XMLCh* value) {
618 if (!qualifiedName.hasNamespaceURI()) {
619 if (XMLString::equals(qualifiedName.getLocalPart(),BINDING_ATTRIB_NAME)) {
623 else if (XMLString::equals(qualifiedName.getLocalPart(),LOCATION_ATTRIB_NAME)) {
627 else if (XMLString::equals(qualifiedName.getLocalPart(),RESPONSELOCATION_ATTRIB_NAME)) {
628 setResponseLocation(value);
632 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
635 void marshallAttributes(DOMElement* domElement) const {
636 MARSHALL_STRING_ATTRIB(Binding,BINDING,NULL);
637 MARSHALL_STRING_ATTRIB(Location,LOCATION,NULL);
638 MARSHALL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION,NULL);
640 // Take care of wildcard.
641 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
642 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
643 if (i->first.hasPrefix())
644 attr->setPrefix(i->first.getPrefix());
645 attr->setNodeValue(i->second);
646 domElement->setAttributeNode(attr);
650 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
652 const XMLCh* nsURI=root->getNamespaceURI();
653 if (!XMLString::equals(nsURI,SAMLConstants::SAML20MD_NS) && nsURI && *nsURI) {
654 getXMLObjects().push_back(childXMLObject);
658 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
661 void processAttribute(const DOMAttr* attribute) {
662 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
663 setAttribute(q,attribute->getNodeValue());
667 class SAML_DLLLOCAL IndexedEndpointTypeImpl : public virtual IndexedEndpointType, public EndpointTypeImpl
671 m_isDefault=XMLConstants::XML_BOOL_NULL;
675 IndexedEndpointTypeImpl() {
679 virtual ~IndexedEndpointTypeImpl() {
680 XMLString::release(&m_Index);
683 IndexedEndpointTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
684 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
686 IndexedEndpointTypeImpl(const IndexedEndpointTypeImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {
687 setIndex(src.m_Index);
688 isDefault(src.m_isDefault);
691 IMPL_XMLOBJECT_CLONE(IndexedEndpointType);
692 EndpointType* cloneEndpointType() const {
693 return new IndexedEndpointTypeImpl(*this);
696 IMPL_INTEGER_ATTRIB(Index);
697 IMPL_BOOLEAN_ATTRIB(isDefault);
699 void setAttribute(QName& qualifiedName, const XMLCh* value) {
700 if (!qualifiedName.hasNamespaceURI()) {
701 if (XMLString::equals(qualifiedName.getLocalPart(),INDEX_ATTRIB_NAME)) {
705 else if (XMLString::equals(qualifiedName.getLocalPart(),ISDEFAULT_ATTRIB_NAME)) {
710 EndpointTypeImpl::setAttribute(qualifiedName, value);
714 void marshallAttributes(DOMElement* domElement) const {
715 MARSHALL_INTEGER_ATTRIB(Index,INDEX,NULL);
716 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
717 EndpointTypeImpl::marshallAttributes(domElement);
721 class SAML_DLLLOCAL ArtifactResolutionServiceImpl : public virtual ArtifactResolutionService, public IndexedEndpointTypeImpl
724 virtual ~ArtifactResolutionServiceImpl() {}
726 ArtifactResolutionServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
727 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
729 ArtifactResolutionServiceImpl(const ArtifactResolutionServiceImpl& src) : AbstractXMLObject(src), IndexedEndpointTypeImpl(src) {}
731 IMPL_XMLOBJECT_CLONE(ArtifactResolutionService);
732 IndexedEndpointType* cloneIndexedEndpointType() const {
733 return new ArtifactResolutionServiceImpl(*this);
735 EndpointType* cloneEndpointType() const {
736 return new ArtifactResolutionServiceImpl(*this);
740 class SAML_DLLLOCAL SingleLogoutServiceImpl : public virtual SingleLogoutService, public EndpointTypeImpl
743 virtual ~SingleLogoutServiceImpl() {}
745 SingleLogoutServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
746 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
748 SingleLogoutServiceImpl(const SingleLogoutServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
750 IMPL_XMLOBJECT_CLONE(SingleLogoutService);
751 EndpointType* cloneEndpointType() const {
752 return new SingleLogoutServiceImpl(*this);
756 class SAML_DLLLOCAL ManageNameIDServiceImpl : public virtual ManageNameIDService, public EndpointTypeImpl
759 virtual ~ManageNameIDServiceImpl() {}
761 ManageNameIDServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
762 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
764 ManageNameIDServiceImpl(const ManageNameIDServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
766 IMPL_XMLOBJECT_CLONE(ManageNameIDService);
767 EndpointType* cloneEndpointType() const {
768 return new ManageNameIDServiceImpl(*this);
772 class SAML_DLLLOCAL SingleSignOnServiceImpl : public virtual SingleSignOnService, public EndpointTypeImpl
775 virtual ~SingleSignOnServiceImpl() {}
777 SingleSignOnServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
778 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
780 SingleSignOnServiceImpl(const SingleSignOnServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
782 IMPL_XMLOBJECT_CLONE(SingleSignOnService);
783 EndpointType* cloneEndpointType() const {
784 return new SingleSignOnServiceImpl(*this);
788 class SAML_DLLLOCAL NameIDMappingServiceImpl : public virtual NameIDMappingService, public EndpointTypeImpl
791 virtual ~NameIDMappingServiceImpl() {}
793 NameIDMappingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
794 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
796 NameIDMappingServiceImpl(const NameIDMappingServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
798 IMPL_XMLOBJECT_CLONE(NameIDMappingService);
799 EndpointType* cloneEndpointType() const {
800 return new NameIDMappingServiceImpl(*this);
804 class SAML_DLLLOCAL AssertionIDRequestServiceImpl : public virtual AssertionIDRequestService, public EndpointTypeImpl
807 virtual ~AssertionIDRequestServiceImpl() {}
809 AssertionIDRequestServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
810 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
812 AssertionIDRequestServiceImpl(const AssertionIDRequestServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
814 IMPL_XMLOBJECT_CLONE(AssertionIDRequestService);
815 EndpointType* cloneEndpointType() const {
816 return new AssertionIDRequestServiceImpl(*this);
820 class SAML_DLLLOCAL AssertionConsumerServiceImpl : public virtual AssertionConsumerService, public IndexedEndpointTypeImpl
823 virtual ~AssertionConsumerServiceImpl() {}
825 AssertionConsumerServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
826 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
828 AssertionConsumerServiceImpl(const AssertionConsumerServiceImpl& src) : AbstractXMLObject(src), IndexedEndpointTypeImpl(src) {}
830 IMPL_XMLOBJECT_CLONE(AssertionConsumerService);
831 EndpointType* cloneEndpointType() const {
832 return new AssertionConsumerServiceImpl(*this);
834 IndexedEndpointType* cloneIndexedEndpointType() const {
835 return new AssertionConsumerServiceImpl(*this);
839 class SAML_DLLLOCAL AuthnQueryServiceImpl : public virtual AuthnQueryService, public EndpointTypeImpl
842 virtual ~AuthnQueryServiceImpl() {}
844 AuthnQueryServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
845 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
847 AuthnQueryServiceImpl(const AuthnQueryServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
849 IMPL_XMLOBJECT_CLONE(AuthnQueryService);
850 EndpointType* cloneEndpointType() const {
851 return new AuthnQueryServiceImpl(*this);
855 class SAML_DLLLOCAL AuthzServiceImpl : public virtual AuthzService, public EndpointTypeImpl
858 virtual ~AuthzServiceImpl() {}
860 AuthzServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
861 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
863 AuthzServiceImpl(const AuthzServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
865 IMPL_XMLOBJECT_CLONE(AuthzService);
866 EndpointType* cloneEndpointType() const {
867 return new AuthzServiceImpl(*this);
871 class SAML_DLLLOCAL AttributeServiceImpl : public virtual AttributeService, public EndpointTypeImpl
874 virtual ~AttributeServiceImpl() {}
876 AttributeServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
877 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
879 AttributeServiceImpl(const AttributeServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
881 IMPL_XMLOBJECT_CLONE(AttributeService);
882 EndpointType* cloneEndpointType() const {
883 return new AttributeServiceImpl(*this);
887 class SAML_DLLLOCAL RoleDescriptorImpl : public virtual RoleDescriptor,
888 public virtual SignableObject,
889 public AbstractComplexElement,
890 public AbstractAttributeExtensibleXMLObject,
891 public AbstractDOMCachingXMLObject,
892 public AbstractXMLObjectMarshaller,
893 public AbstractXMLObjectUnmarshaller
896 m_ID=m_ProtocolSupportEnumeration=m_ErrorURL=NULL;
897 m_ValidUntil=m_CacheDuration=NULL;
898 m_children.push_back(NULL);
899 m_children.push_back(NULL);
900 m_children.push_back(NULL);
901 m_children.push_back(NULL);
905 m_pos_Signature=m_children.begin();
906 m_pos_Extensions=m_pos_Signature;
908 m_pos_Organization=m_pos_Extensions;
909 ++m_pos_Organization;
910 m_pos_ContactPerson=m_pos_Organization;
911 ++m_pos_ContactPerson;
915 list<XMLObject*>::iterator m_pos_ContactPerson;
917 RoleDescriptorImpl() {
922 virtual ~RoleDescriptorImpl() {
923 XMLString::release(&m_ID);
924 XMLString::release(&m_ProtocolSupportEnumeration);
925 XMLString::release(&m_ErrorURL);
927 delete m_CacheDuration;
930 RoleDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
931 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
935 RoleDescriptorImpl(const RoleDescriptorImpl& src)
936 : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
939 setProtocolSupportEnumeration(src.getProtocolSupportEnumeration());
940 setErrorURL(src.getErrorURL());
941 setValidUntil(src.getValidUntil());
942 setCacheDuration(src.getCacheDuration());
943 if (src.getSignature())
944 setSignature(src.getSignature()->cloneSignature());
945 if (src.getExtensions())
946 setExtensions(src.getExtensions()->cloneExtensions());
947 if (src.getOrganization())
948 setOrganization(src.getOrganization()->cloneOrganization());
950 VectorOf(KeyDescriptor) v=getKeyDescriptors();
951 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
953 v.push_back((*i)->cloneKeyDescriptor());
956 VectorOf(ContactPerson) w=getContactPersons();
957 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
959 w.push_back((*j)->cloneContactPerson());
964 const XMLCh* getId() const {
968 //IMPL_TYPED_CHILD(Signature);
969 // Need customized setter.
971 Signature* m_Signature;
972 list<XMLObject*>::iterator m_pos_Signature;
974 Signature* getSignature() const {
978 void setSignature(Signature* sig) {
979 prepareForAssignment(m_Signature,sig);
980 *m_pos_Signature=m_Signature=sig;
981 // Sync content reference back up.
983 m_Signature->setContentReference(new opensaml::ContentReference(*this));
986 IMPL_STRING_ATTRIB(ID);
987 IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
988 IMPL_STRING_ATTRIB(ErrorURL);
989 IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
990 IMPL_DATETIME_ATTRIB(CacheDuration,0);
991 IMPL_TYPED_CHILD(Extensions);
992 IMPL_TYPED_CHILDREN(KeyDescriptor,m_pos_Organization);
993 IMPL_TYPED_CHILD(Organization);
994 IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
996 bool hasSupport(const XMLCh* protocol) const {
997 if (m_ProtocolSupportEnumeration) {
998 // Look for first character.
999 unsigned int len=XMLString::stringLen(protocol);
1001 int index=XMLString::indexOf(m_ProtocolSupportEnumeration,protocol[0],pos);
1003 // Only possible match is if it's the first character or a space comes before it.
1004 if (index==0 || m_ProtocolSupportEnumeration[index-1]==chSpace) {
1005 // See if rest of protocol string is present.
1006 if (0==XMLString::compareNString(m_ProtocolSupportEnumeration+index+1,protocol+1,len-1)) {
1007 // Only possible match is if it's the last character or a space comes after it.
1008 if (m_ProtocolSupportEnumeration[index+len]==chNull || m_ProtocolSupportEnumeration[index+len]==chSpace)
1014 // Move past last search and start again.
1019 // Move past last search and start again.
1022 index=XMLString::indexOf(m_ProtocolSupportEnumeration,protocol[0],pos);
1028 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1029 if (!qualifiedName.hasNamespaceURI()) {
1030 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
1034 else if (XMLString::equals(qualifiedName.getLocalPart(),PROTOCOLSUPPORTENUMERATION_ATTRIB_NAME)) {
1035 setProtocolSupportEnumeration(value);
1038 else if (XMLString::equals(qualifiedName.getLocalPart(),ERRORURL_ATTRIB_NAME)) {
1042 else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
1043 setValidUntil(value);
1046 else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
1047 setCacheDuration(value);
1051 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
1055 void marshallAttributes(DOMElement* domElement) const {
1056 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1057 MARSHALL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION,NULL);
1058 MARSHALL_STRING_ATTRIB(ErrorURL,ERRORURL,NULL);
1059 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
1060 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
1062 // Take care of wildcard.
1063 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
1064 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
1065 if (i->first.hasPrefix())
1066 attr->setPrefix(i->first.getPrefix());
1067 attr->setNodeValue(i->second);
1068 domElement->setAttributeNode(attr);
1072 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1073 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
1074 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
1075 PROC_TYPED_CHILDREN(KeyDescriptor,SAMLConstants::SAML20MD_NS,false);
1076 PROC_TYPED_CHILD(Organization,SAMLConstants::SAML20MD_NS,false);
1077 PROC_TYPED_CHILDREN(ContactPerson,SAMLConstants::SAML20MD_NS,false);
1078 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1081 void processAttribute(const DOMAttr* attribute) {
1082 PROC_ID_ATTRIB(ID,ID,NULL);
1083 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
1084 setAttribute(q,attribute->getNodeValue());
1088 class SAML_DLLLOCAL SSODescriptorTypeImpl : public virtual SSODescriptorType, public RoleDescriptorImpl
1091 m_children.push_back(NULL);
1092 m_children.push_back(NULL);
1093 m_children.push_back(NULL);
1094 m_children.push_back(NULL);
1095 m_pos_ArtifactResolutionService=m_pos_ContactPerson;
1096 ++m_pos_ArtifactResolutionService;
1097 m_pos_SingleLogoutService=m_pos_ArtifactResolutionService;
1098 ++m_pos_SingleLogoutService;
1099 m_pos_ManageNameIDService=m_pos_SingleLogoutService;
1100 ++m_pos_ManageNameIDService;
1101 m_pos_NameIDFormat=m_pos_ManageNameIDService;
1102 ++m_pos_NameIDFormat;
1106 list<XMLObject*>::iterator m_pos_ArtifactResolutionService;
1107 list<XMLObject*>::iterator m_pos_SingleLogoutService;
1108 list<XMLObject*>::iterator m_pos_ManageNameIDService;
1109 list<XMLObject*>::iterator m_pos_NameIDFormat;
1111 SSODescriptorTypeImpl() {
1116 virtual ~SSODescriptorTypeImpl() {}
1118 SSODescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1119 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1123 SSODescriptorTypeImpl(const SSODescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1125 VectorOf(ArtifactResolutionService) v=getArtifactResolutionServices();
1126 for (vector<ArtifactResolutionService*>::const_iterator i=src.m_ArtifactResolutionServices.begin(); i!=src.m_ArtifactResolutionServices.end(); i++) {
1128 v.push_back((*i)->cloneArtifactResolutionService());
1131 VectorOf(SingleLogoutService) w=getSingleLogoutServices();
1132 for (vector<SingleLogoutService*>::const_iterator j=src.m_SingleLogoutServices.begin(); j!=src.m_SingleLogoutServices.end(); j++) {
1134 w.push_back((*j)->cloneSingleLogoutService());
1137 VectorOf(ManageNameIDService) x=getManageNameIDServices();
1138 for (vector<ManageNameIDService*>::const_iterator k=src.m_ManageNameIDServices.begin(); k!=src.m_ManageNameIDServices.end(); k++) {
1140 x.push_back((*k)->cloneManageNameIDService());
1143 VectorOf(NameIDFormat) y=getNameIDFormats();
1144 for (vector<NameIDFormat*>::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) {
1146 y.push_back((*m)->cloneNameIDFormat());
1151 IMPL_TYPED_CHILDREN(ArtifactResolutionService,m_pos_ArtifactResolutionService);
1152 IMPL_TYPED_CHILDREN(SingleLogoutService,m_pos_SingleLogoutService);
1153 IMPL_TYPED_CHILDREN(ManageNameIDService,m_pos_ManageNameIDService);
1154 IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1157 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1158 PROC_TYPED_CHILDREN(ArtifactResolutionService,SAMLConstants::SAML20MD_NS,false);
1159 PROC_TYPED_CHILDREN(SingleLogoutService,SAMLConstants::SAML20MD_NS,false);
1160 PROC_TYPED_CHILDREN(ManageNameIDService,SAMLConstants::SAML20MD_NS,false);
1161 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1162 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1166 class SAML_DLLLOCAL IDPSSODescriptorImpl : public virtual IDPSSODescriptor, public SSODescriptorTypeImpl
1168 list<XMLObject*>::iterator m_pos_SingleSignOnService;
1169 list<XMLObject*>::iterator m_pos_NameIDMappingService;
1170 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1171 list<XMLObject*>::iterator m_pos_AttributeProfile;
1174 m_WantAuthnRequestsSigned=XMLConstants::XML_BOOL_NULL;
1175 m_children.push_back(NULL);
1176 m_children.push_back(NULL);
1177 m_children.push_back(NULL);
1178 m_children.push_back(NULL);
1179 m_pos_SingleSignOnService=m_pos_NameIDFormat;
1180 ++m_pos_SingleSignOnService;
1181 m_pos_NameIDMappingService=m_pos_SingleSignOnService;
1182 ++m_pos_NameIDMappingService;
1183 m_pos_AssertionIDRequestService=m_pos_NameIDMappingService;
1184 ++m_pos_AssertionIDRequestService;
1185 m_pos_AttributeProfile=m_pos_AssertionIDRequestService;
1186 ++m_pos_AttributeProfile;
1190 virtual ~IDPSSODescriptorImpl() {}
1192 IDPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1193 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1197 IDPSSODescriptorImpl(const IDPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1199 WantAuthnRequestsSigned(src.m_WantAuthnRequestsSigned);
1200 VectorOf(SingleSignOnService) v=getSingleSignOnServices();
1201 for (vector<SingleSignOnService*>::const_iterator i=src.m_SingleSignOnServices.begin(); i!=src.m_SingleSignOnServices.end(); i++) {
1203 v.push_back((*i)->cloneSingleSignOnService());
1206 VectorOf(NameIDMappingService) w=getNameIDMappingServices();
1207 for (vector<NameIDMappingService*>::const_iterator j=src.m_NameIDMappingServices.begin(); j!=src.m_NameIDMappingServices.end(); j++) {
1209 w.push_back((*j)->cloneNameIDMappingService());
1212 VectorOf(AssertionIDRequestService) x=getAssertionIDRequestServices();
1213 for (vector<AssertionIDRequestService*>::const_iterator k=src.m_AssertionIDRequestServices.begin(); k!=src.m_AssertionIDRequestServices.end(); k++) {
1215 x.push_back((*k)->cloneAssertionIDRequestService());
1218 VectorOf(AttributeProfile) y=getAttributeProfiles();
1219 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1221 y.push_back((*m)->cloneAttributeProfile());
1224 VectorOf(Attribute) z=getAttributes();
1225 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1227 z.push_back((*n)->cloneAttribute());
1232 IMPL_XMLOBJECT_CLONE(IDPSSODescriptor);
1233 SSODescriptorType* cloneSSODescriptorType() const {
1234 return new IDPSSODescriptorImpl(*this);
1236 RoleDescriptor* cloneRoleDescriptor() const {
1237 return new IDPSSODescriptorImpl(*this);
1240 IMPL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned);
1241 IMPL_TYPED_CHILDREN(SingleSignOnService,m_pos_SingleSignOnService);
1242 IMPL_TYPED_CHILDREN(NameIDMappingService,m_pos_NameIDMappingService);
1243 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1244 IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1245 IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1247 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1248 if (!qualifiedName.hasNamespaceURI()) {
1249 if (XMLString::equals(qualifiedName.getLocalPart(),WANTAUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1250 setWantAuthnRequestsSigned(value);
1254 RoleDescriptorImpl::setAttribute(qualifiedName, value);
1258 void marshallAttributes(DOMElement* domElement) const {
1259 MARSHALL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned,WANTAUTHNREQUESTSSIGNED,NULL);
1260 RoleDescriptorImpl::marshallAttributes(domElement);
1263 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1264 PROC_TYPED_CHILDREN(SingleSignOnService,SAMLConstants::SAML20MD_NS,false);
1265 PROC_TYPED_CHILDREN(NameIDMappingService,SAMLConstants::SAML20MD_NS,false);
1266 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1267 PROC_TYPED_CHILDREN(AttributeProfile,SAMLConstants::SAML20MD_NS,false);
1268 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
1269 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1273 class SAML_DLLLOCAL RequestedAttributeImpl : public virtual RequestedAttribute,
1274 public AbstractComplexElement,
1275 public AbstractAttributeExtensibleXMLObject,
1276 public AbstractDOMCachingXMLObject,
1277 public AbstractXMLObjectMarshaller,
1278 public AbstractXMLObjectUnmarshaller
1281 m_Name=m_NameFormat=m_FriendlyName=NULL;
1282 m_isRequired=XMLConstants::XML_BOOL_NULL;
1285 virtual ~RequestedAttributeImpl() {
1286 XMLString::release(&m_Name);
1287 XMLString::release(&m_NameFormat);
1288 XMLString::release(&m_FriendlyName);
1291 RequestedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1292 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1296 RequestedAttributeImpl(const RequestedAttributeImpl& src)
1297 : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1299 setName(src.getName());
1300 setNameFormat(src.getNameFormat());
1301 setFriendlyName(src.getFriendlyName());
1302 isRequired(src.m_isRequired);
1303 VectorOf(XMLObject) v=getAttributeValues();
1304 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1306 v.push_back((*i)->clone());
1311 IMPL_XMLOBJECT_CLONE(RequestedAttribute);
1312 Attribute* cloneAttribute() const {
1313 return new RequestedAttributeImpl(*this);
1316 IMPL_STRING_ATTRIB(Name);
1317 IMPL_STRING_ATTRIB(NameFormat);
1318 IMPL_STRING_ATTRIB(FriendlyName);
1319 IMPL_BOOLEAN_ATTRIB(isRequired);
1320 IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1322 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1323 if (!qualifiedName.hasNamespaceURI()) {
1324 if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1328 else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1329 setNameFormat(value);
1332 else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1333 setFriendlyName(value);
1336 else if (XMLString::equals(qualifiedName.getLocalPart(),ISREQUIRED_ATTRIB_NAME)) {
1337 setisRequired(value);
1341 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
1345 void marshallAttributes(DOMElement* domElement) const {
1346 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1347 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1348 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1349 MARSHALL_BOOLEAN_ATTRIB(isRequired,ISREQUIRED,NULL);
1351 // Take care of wildcard.
1352 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
1353 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
1354 if (i->first.hasPrefix())
1355 attr->setPrefix(i->first.getPrefix());
1356 attr->setNodeValue(i->second);
1357 domElement->setAttributeNode(attr);
1361 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1362 getAttributeValues().push_back(childXMLObject);
1365 void processAttribute(const DOMAttr* attribute) {
1366 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
1367 setAttribute(q,attribute->getNodeValue());
1371 class SAML_DLLLOCAL AttributeConsumingServiceImpl : public virtual AttributeConsumingService,
1372 public AbstractComplexElement,
1373 public AbstractDOMCachingXMLObject,
1374 public AbstractXMLObjectMarshaller,
1375 public AbstractXMLObjectUnmarshaller
1377 list<XMLObject*>::iterator m_pos_ServiceDescription;
1378 list<XMLObject*>::iterator m_pos_RequestedAttribute;
1382 m_isDefault=XMLConstants::XML_BOOL_NULL;
1383 m_children.push_back(NULL);
1384 m_children.push_back(NULL);
1385 m_pos_ServiceDescription=m_children.begin();
1386 m_pos_RequestedAttribute=m_pos_ServiceDescription;
1387 ++m_pos_RequestedAttribute;
1391 virtual ~AttributeConsumingServiceImpl() {
1392 XMLString::release(&m_Index);
1395 AttributeConsumingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1396 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1400 AttributeConsumingServiceImpl(const AttributeConsumingServiceImpl& src)
1401 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
1403 setIndex(src.m_Index);
1404 isDefault(src.m_isDefault);
1405 VectorOf(ServiceName) v=getServiceNames();
1406 for (vector<ServiceName*>::const_iterator i=src.m_ServiceNames.begin(); i!=src.m_ServiceNames.end(); i++) {
1408 v.push_back((*i)->cloneServiceName());
1411 VectorOf(ServiceDescription) w=getServiceDescriptions();
1412 for (vector<ServiceDescription*>::const_iterator j=src.m_ServiceDescriptions.begin(); j!=src.m_ServiceDescriptions.end(); j++) {
1414 w.push_back((*j)->cloneServiceDescription());
1417 VectorOf(RequestedAttribute) x=getRequestedAttributes();
1418 for (vector<RequestedAttribute*>::const_iterator k=src.m_RequestedAttributes.begin(); k!=src.m_RequestedAttributes.end(); k++) {
1420 x.push_back((*k)->cloneRequestedAttribute());
1425 IMPL_XMLOBJECT_CLONE(AttributeConsumingService);
1426 IMPL_INTEGER_ATTRIB(Index);
1427 IMPL_BOOLEAN_ATTRIB(isDefault);
1428 IMPL_TYPED_CHILDREN(ServiceName,m_pos_ServiceDescription);
1429 IMPL_TYPED_CHILDREN(ServiceDescription,m_pos_RequestedAttribute);
1430 IMPL_TYPED_CHILDREN(RequestedAttribute,m_children.end());
1433 void marshallAttributes(DOMElement* domElement) const {
1434 MARSHALL_INTEGER_ATTRIB(Index,INDEX,NULL);
1435 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
1438 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1439 PROC_TYPED_CHILDREN(ServiceName,SAMLConstants::SAML20MD_NS,false);
1440 PROC_TYPED_CHILDREN(ServiceDescription,SAMLConstants::SAML20MD_NS,false);
1441 PROC_TYPED_CHILDREN(RequestedAttribute,SAMLConstants::SAML20MD_NS,false);
1442 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1445 void processAttribute(const DOMAttr* attribute) {
1446 PROC_INTEGER_ATTRIB(Index,INDEX,NULL);
1447 PROC_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
1448 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1452 class SAML_DLLLOCAL SPSSODescriptorImpl : public virtual SPSSODescriptor, public SSODescriptorTypeImpl
1454 list<XMLObject*>::iterator m_pos_AssertionConsumerService;
1457 m_AuthnRequestsSigned=XMLConstants::XML_BOOL_NULL;
1458 m_WantAssertionsSigned=XMLConstants::XML_BOOL_NULL;
1459 m_children.push_back(NULL);
1460 m_pos_AssertionConsumerService=m_pos_NameIDFormat;
1461 ++m_pos_AssertionConsumerService;
1465 virtual ~SPSSODescriptorImpl() {}
1467 SPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1468 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1472 SPSSODescriptorImpl(const SPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1474 AuthnRequestsSigned(src.m_AuthnRequestsSigned);
1475 WantAssertionsSigned(src.m_WantAssertionsSigned);
1476 VectorOf(AssertionConsumerService) v=getAssertionConsumerServices();
1477 for (vector<AssertionConsumerService*>::const_iterator i=src.m_AssertionConsumerServices.begin(); i!=src.m_AssertionConsumerServices.end(); i++) {
1479 v.push_back((*i)->cloneAssertionConsumerService());
1482 VectorOf(AttributeConsumingService) w=getAttributeConsumingServices();
1483 for (vector<AttributeConsumingService*>::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) {
1485 w.push_back((*j)->cloneAttributeConsumingService());
1490 IMPL_XMLOBJECT_CLONE(SPSSODescriptor);
1491 SSODescriptorType* cloneSSODescriptorType() const {
1492 return cloneSPSSODescriptor();
1494 RoleDescriptor* cloneRoleDescriptor() const {
1495 return cloneSPSSODescriptor();
1498 IMPL_BOOLEAN_ATTRIB(AuthnRequestsSigned);
1499 IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned);
1500 IMPL_TYPED_CHILDREN(AssertionConsumerService,m_pos_AssertionConsumerService);
1501 IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end());
1503 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1504 if (!qualifiedName.hasNamespaceURI()) {
1505 if (XMLString::equals(qualifiedName.getLocalPart(),AUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1506 setAuthnRequestsSigned(value);
1509 else if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) {
1510 setWantAssertionsSigned(value);
1514 RoleDescriptorImpl::setAttribute(qualifiedName, value);
1518 void marshallAttributes(DOMElement* domElement) const {
1519 MARSHALL_BOOLEAN_ATTRIB(AuthnRequestsSigned,AUTHNREQUESTSSIGNED,NULL);
1520 MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,NULL);
1521 RoleDescriptorImpl::marshallAttributes(domElement);
1524 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1525 PROC_TYPED_CHILDREN(AssertionConsumerService,SAMLConstants::SAML20MD_NS,false);
1526 PROC_TYPED_CHILDREN(AttributeConsumingService,SAMLConstants::SAML20MD_NS,false);
1527 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1531 class SAML_DLLLOCAL AuthnAuthorityDescriptorImpl : public virtual AuthnAuthorityDescriptor, public RoleDescriptorImpl
1533 list<XMLObject*>::iterator m_pos_AuthnQueryService;
1534 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1537 m_children.push_back(NULL);
1538 m_children.push_back(NULL);
1539 m_pos_AuthnQueryService=m_pos_ContactPerson;
1540 ++m_pos_AuthnQueryService;
1541 m_pos_AssertionIDRequestService=m_pos_AuthnQueryService;
1542 ++m_pos_AssertionIDRequestService;
1546 virtual ~AuthnAuthorityDescriptorImpl() {}
1548 AuthnAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1549 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1553 AuthnAuthorityDescriptorImpl(const AuthnAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1555 VectorOf(AuthnQueryService) v=getAuthnQueryServices();
1556 for (vector<AuthnQueryService*>::const_iterator i=src.m_AuthnQueryServices.begin(); i!=src.m_AuthnQueryServices.end(); i++) {
1558 v.push_back((*i)->cloneAuthnQueryService());
1561 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1562 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1564 w.push_back((*j)->cloneAssertionIDRequestService());
1567 VectorOf(NameIDFormat) x=getNameIDFormats();
1568 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1570 x.push_back((*k)->cloneNameIDFormat());
1575 IMPL_XMLOBJECT_CLONE(AuthnAuthorityDescriptor);
1576 RoleDescriptor* cloneRoleDescriptor() const {
1577 return cloneAuthnAuthorityDescriptor();
1580 IMPL_TYPED_CHILDREN(AuthnQueryService,m_pos_AuthnQueryService);
1581 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1582 IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1585 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1586 PROC_TYPED_CHILDREN(AuthnQueryService,SAMLConstants::SAML20MD_NS,false);
1587 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1588 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1589 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1593 class SAML_DLLLOCAL PDPDescriptorImpl : public virtual PDPDescriptor, public RoleDescriptorImpl
1595 list<XMLObject*>::iterator m_pos_AuthzService;
1596 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1599 m_children.push_back(NULL);
1600 m_children.push_back(NULL);
1601 m_pos_AuthzService=m_pos_ContactPerson;
1602 ++m_pos_AuthzService;
1603 m_pos_AssertionIDRequestService=m_pos_AuthzService;
1604 ++m_pos_AssertionIDRequestService;
1608 virtual ~PDPDescriptorImpl() {}
1610 PDPDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1611 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1615 PDPDescriptorImpl(const PDPDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1617 VectorOf(AuthzService) v=getAuthzServices();
1618 for (vector<AuthzService*>::const_iterator i=src.m_AuthzServices.begin(); i!=src.m_AuthzServices.end(); i++) {
1620 v.push_back((*i)->cloneAuthzService());
1623 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1624 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1626 w.push_back((*j)->cloneAssertionIDRequestService());
1629 VectorOf(NameIDFormat) x=getNameIDFormats();
1630 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1632 x.push_back((*k)->cloneNameIDFormat());
1637 IMPL_XMLOBJECT_CLONE(PDPDescriptor);
1638 RoleDescriptor* cloneRoleDescriptor() const {
1639 return clonePDPDescriptor();
1642 IMPL_TYPED_CHILDREN(AuthzService,m_pos_AuthzService);
1643 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1644 IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1647 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1648 PROC_TYPED_CHILDREN(AuthzService,SAMLConstants::SAML20MD_NS,false);
1649 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1650 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1651 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1655 class SAML_DLLLOCAL AttributeAuthorityDescriptorImpl : public virtual AttributeAuthorityDescriptor, public RoleDescriptorImpl
1657 list<XMLObject*>::iterator m_pos_AttributeService;
1658 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1659 list<XMLObject*>::iterator m_pos_NameIDFormat;
1660 list<XMLObject*>::iterator m_pos_AttributeProfile;
1663 m_children.push_back(NULL);
1664 m_children.push_back(NULL);
1665 m_children.push_back(NULL);
1666 m_children.push_back(NULL);
1667 m_pos_AttributeService=m_pos_ContactPerson;
1668 ++m_pos_AttributeService;
1669 m_pos_AssertionIDRequestService=m_pos_AttributeService;
1670 ++m_pos_AssertionIDRequestService;
1671 m_pos_NameIDFormat=m_pos_AssertionIDRequestService;
1672 ++m_pos_NameIDFormat;
1673 m_pos_AttributeProfile=m_pos_NameIDFormat;
1674 ++m_pos_AttributeProfile;
1678 virtual ~AttributeAuthorityDescriptorImpl() {}
1680 AttributeAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1681 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1685 AttributeAuthorityDescriptorImpl(const AttributeAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1687 VectorOf(AttributeService) v=getAttributeServices();
1688 for (vector<AttributeService*>::const_iterator i=src.m_AttributeServices.begin(); i!=src.m_AttributeServices.end(); i++) {
1690 v.push_back((*i)->cloneAttributeService());
1693 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1694 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1696 w.push_back((*j)->cloneAssertionIDRequestService());
1699 VectorOf(NameIDFormat) x=getNameIDFormats();
1700 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1702 x.push_back((*k)->cloneNameIDFormat());
1705 VectorOf(AttributeProfile) y=getAttributeProfiles();
1706 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1708 y.push_back((*m)->cloneAttributeProfile());
1711 VectorOf(Attribute) z=getAttributes();
1712 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1714 z.push_back((*n)->cloneAttribute());
1719 IMPL_XMLOBJECT_CLONE(AttributeAuthorityDescriptor);
1720 RoleDescriptor* cloneRoleDescriptor() const {
1721 return cloneAttributeAuthorityDescriptor();
1724 IMPL_TYPED_CHILDREN(AttributeService,m_pos_AttributeService);
1725 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1726 IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1727 IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1728 IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1731 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1732 PROC_TYPED_CHILDREN(AttributeService,SAMLConstants::SAML20MD_NS,false);
1733 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1734 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1735 PROC_TYPED_CHILDREN(AttributeProfile,SAMLConstants::SAML20MD_NS,false);
1736 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
1737 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1741 class SAML_DLLLOCAL AffiliationDescriptorImpl : public virtual AffiliationDescriptor,
1742 public virtual SignableObject,
1743 public AbstractComplexElement,
1744 public AbstractAttributeExtensibleXMLObject,
1745 public AbstractDOMCachingXMLObject,
1746 public AbstractXMLObjectMarshaller,
1747 public AbstractXMLObjectUnmarshaller
1749 list<XMLObject*>::iterator m_pos_AffiliateMember;
1752 m_ID=m_AffiliationOwnerID=NULL;
1753 m_ValidUntil=m_CacheDuration=NULL;
1754 m_children.push_back(NULL);
1755 m_children.push_back(NULL);
1756 m_children.push_back(NULL);
1759 m_pos_Signature=m_children.begin();
1760 m_pos_Extensions=m_pos_Signature;
1762 m_pos_AffiliateMember=m_pos_Extensions;
1763 ++m_pos_AffiliateMember;
1767 virtual ~AffiliationDescriptorImpl() {
1768 XMLString::release(&m_ID);
1769 XMLString::release(&m_AffiliationOwnerID);
1770 delete m_ValidUntil;
1771 delete m_CacheDuration;
1774 AffiliationDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1775 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1779 AffiliationDescriptorImpl(const AffiliationDescriptorImpl& src)
1780 : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1783 setAffiliationOwnerID(src.getAffiliationOwnerID());
1784 setValidUntil(src.getValidUntil());
1785 setCacheDuration(src.getCacheDuration());
1786 if (src.getSignature())
1787 setSignature(src.getSignature()->cloneSignature());
1788 if (src.getExtensions())
1789 setExtensions(src.getExtensions()->cloneExtensions());
1791 VectorOf(KeyDescriptor) v=getKeyDescriptors();
1792 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
1794 v.push_back((*i)->cloneKeyDescriptor());
1797 VectorOf(AffiliateMember) w=getAffiliateMembers();
1798 for (vector<AffiliateMember*>::const_iterator j=src.m_AffiliateMembers.begin(); j!=src.m_AffiliateMembers.end(); j++) {
1800 w.push_back((*j)->cloneAffiliateMember());
1805 IMPL_XMLOBJECT_CLONE(AffiliationDescriptor);
1807 const XMLCh* getId() const {
1811 //IMPL_TYPED_CHILD(Signature);
1812 // Need customized setter.
1814 Signature* m_Signature;
1815 list<XMLObject*>::iterator m_pos_Signature;
1817 Signature* getSignature() const {
1821 void setSignature(Signature* sig) {
1822 prepareForAssignment(m_Signature,sig);
1823 *m_pos_Signature=m_Signature=sig;
1824 // Sync content reference back up.
1826 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1829 IMPL_STRING_ATTRIB(ID);
1830 IMPL_STRING_ATTRIB(AffiliationOwnerID);
1831 IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
1832 IMPL_DATETIME_ATTRIB(CacheDuration,0);
1833 IMPL_TYPED_CHILD(Extensions);
1834 IMPL_TYPED_CHILDREN(AffiliateMember,m_pos_AffiliateMember);
1835 IMPL_TYPED_CHILDREN(KeyDescriptor,m_children.end());
1837 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1838 if (!qualifiedName.hasNamespaceURI()) {
1839 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
1843 else if (XMLString::equals(qualifiedName.getLocalPart(),AFFILIATIONOWNERID_ATTRIB_NAME)) {
1844 setAffiliationOwnerID(value);
1847 else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
1848 setValidUntil(value);
1851 else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
1852 setCacheDuration(value);
1856 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
1860 void marshallAttributes(DOMElement* domElement) const {
1861 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1862 MARSHALL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID,NULL);
1863 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
1864 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
1866 // Take care of wildcard.
1867 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
1868 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
1869 if (i->first.hasPrefix())
1870 attr->setPrefix(i->first.getPrefix());
1871 attr->setNodeValue(i->second);
1872 domElement->setAttributeNode(attr);
1876 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1877 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
1878 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
1879 PROC_TYPED_CHILDREN(AffiliateMember,SAMLConstants::SAML20MD_NS,false);
1880 PROC_TYPED_CHILDREN(KeyDescriptor,SAMLConstants::SAML20MD_NS,false);
1881 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1884 void processAttribute(const DOMAttr* attribute) {
1885 PROC_ID_ATTRIB(ID,ID,NULL);
1886 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
1887 setAttribute(q,attribute->getNodeValue());
1891 class SAML_DLLLOCAL EntityDescriptorImpl : public virtual EntityDescriptor,
1892 public virtual SignableObject,
1893 public AbstractComplexElement,
1894 public AbstractAttributeExtensibleXMLObject,
1895 public AbstractDOMCachingXMLObject,
1896 public AbstractXMLObjectMarshaller,
1897 public AbstractXMLObjectUnmarshaller
1899 list<XMLObject*>::iterator m_pos_ContactPerson;
1902 m_ID=m_EntityID=NULL;
1903 m_ValidUntil=m_CacheDuration=NULL;
1904 m_children.push_back(NULL);
1905 m_children.push_back(NULL);
1906 m_children.push_back(NULL);
1907 m_children.push_back(NULL);
1908 m_children.push_back(NULL);
1911 m_AffiliationDescriptor=NULL;
1912 m_Organization=NULL;
1913 m_pos_Signature=m_children.begin();
1914 m_pos_Extensions=m_pos_Signature;
1916 m_pos_AffiliationDescriptor=m_pos_Extensions;
1917 ++m_pos_AffiliationDescriptor;
1918 m_pos_Organization=m_pos_AffiliationDescriptor;
1919 ++m_pos_Organization;
1920 m_pos_ContactPerson=m_pos_Organization;
1921 ++m_pos_ContactPerson;
1925 virtual ~EntityDescriptorImpl() {
1926 XMLString::release(&m_ID);
1927 XMLString::release(&m_EntityID);
1928 delete m_ValidUntil;
1929 delete m_CacheDuration;
1932 EntityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1933 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1937 EntityDescriptorImpl(const EntityDescriptorImpl& src)
1938 : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1941 setEntityID(src.getEntityID());
1942 setValidUntil(src.getValidUntil());
1943 setCacheDuration(src.getCacheDuration());
1944 if (src.getSignature())
1945 setSignature(src.getSignature()->cloneSignature());
1946 if (src.getExtensions())
1947 setExtensions(src.getExtensions()->cloneExtensions());
1948 if (src.getAffiliationDescriptor())
1949 setAffiliationDescriptor(src.getAffiliationDescriptor()->cloneAffiliationDescriptor());
1950 if (src.getOrganization())
1951 setOrganization(src.getOrganization()->cloneOrganization());
1953 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1955 IDPSSODescriptor* idp=dynamic_cast<IDPSSODescriptor*>(*i);
1957 getIDPSSODescriptors().push_back(idp->cloneIDPSSODescriptor());
1961 SPSSODescriptor* sp=dynamic_cast<SPSSODescriptor*>(*i);
1963 getSPSSODescriptors().push_back(sp->cloneSPSSODescriptor());
1967 AuthnAuthorityDescriptor* authn=dynamic_cast<AuthnAuthorityDescriptor*>(*i);
1969 getAuthnAuthorityDescriptors().push_back(authn->cloneAuthnAuthorityDescriptor());
1973 AttributeAuthorityDescriptor* attr=dynamic_cast<AttributeAuthorityDescriptor*>(*i);
1975 getAttributeAuthorityDescriptors().push_back(attr->cloneAttributeAuthorityDescriptor());
1979 PDPDescriptor* pdp=dynamic_cast<PDPDescriptor*>(*i);
1981 getPDPDescriptors().push_back(pdp->clonePDPDescriptor());
1985 RoleDescriptor* role=dynamic_cast<RoleDescriptor*>(*i);
1987 getRoleDescriptors().push_back(role->cloneRoleDescriptor());
1993 VectorOf(ContactPerson) v=getContactPersons();
1994 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
1996 v.push_back((*j)->cloneContactPerson());
1999 VectorOf(AdditionalMetadataLocation) w=getAdditionalMetadataLocations();
2000 for (vector<AdditionalMetadataLocation*>::const_iterator k=src.m_AdditionalMetadataLocations.begin(); k!=src.m_AdditionalMetadataLocations.end(); k++) {
2002 w.push_back((*k)->cloneAdditionalMetadataLocation());
2007 IMPL_XMLOBJECT_CLONE(EntityDescriptor);
2009 const XMLCh* getId() const {
2013 //IMPL_TYPED_CHILD(Signature);
2014 // Need customized setter.
2016 Signature* m_Signature;
2017 list<XMLObject*>::iterator m_pos_Signature;
2019 Signature* getSignature() const {
2023 void setSignature(Signature* sig) {
2024 prepareForAssignment(m_Signature,sig);
2025 *m_pos_Signature=m_Signature=sig;
2026 // Sync content reference back up.
2028 m_Signature->setContentReference(new opensaml::ContentReference(*this));
2031 IMPL_STRING_ATTRIB(ID);
2032 IMPL_STRING_ATTRIB(EntityID);
2033 IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
2034 IMPL_DATETIME_ATTRIB(CacheDuration,0);
2035 IMPL_TYPED_CHILD(Extensions);
2036 IMPL_TYPED_CHILDREN(RoleDescriptor,m_pos_AffiliationDescriptor);
2037 IMPL_TYPED_CHILDREN(IDPSSODescriptor,m_pos_AffiliationDescriptor);
2038 IMPL_TYPED_CHILDREN(SPSSODescriptor,m_pos_AffiliationDescriptor);
2039 IMPL_TYPED_CHILDREN(AuthnAuthorityDescriptor,m_pos_AffiliationDescriptor);
2040 IMPL_TYPED_CHILDREN(AttributeAuthorityDescriptor,m_pos_AffiliationDescriptor);
2041 IMPL_TYPED_CHILDREN(PDPDescriptor,m_pos_AffiliationDescriptor);
2042 IMPL_TYPED_CHILD(AffiliationDescriptor);
2043 IMPL_TYPED_CHILD(Organization);
2044 IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
2045 IMPL_TYPED_CHILDREN(AdditionalMetadataLocation,m_children.end());
2047 void setAttribute(QName& qualifiedName, const XMLCh* value) {
2048 if (!qualifiedName.hasNamespaceURI()) {
2049 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
2053 else if (XMLString::equals(qualifiedName.getLocalPart(),ENTITYID_ATTRIB_NAME)) {
2057 else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
2058 setValidUntil(value);
2061 else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
2062 setCacheDuration(value);
2066 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
2069 const IDPSSODescriptor* getIDPSSODescriptor(const XMLCh* protocol) const {
2070 for (vector<IDPSSODescriptor*>::const_iterator i=m_IDPSSODescriptors.begin(); i!=m_IDPSSODescriptors.end(); i++) {
2071 if ((*i)->hasSupport(protocol) && (*i)->isValid())
2077 const SPSSODescriptor* getSPSSODescriptor(const XMLCh* protocol) const {
2078 for (vector<SPSSODescriptor*>::const_iterator i=m_SPSSODescriptors.begin(); i!=m_SPSSODescriptors.end(); i++) {
2079 if ((*i)->hasSupport(protocol) && (*i)->isValid())
2085 const AuthnAuthorityDescriptor* getAuthnAuthorityDescriptor(const XMLCh* protocol) const {
2086 for (vector<AuthnAuthorityDescriptor*>::const_iterator i=m_AuthnAuthorityDescriptors.begin(); i!=m_AuthnAuthorityDescriptors.end(); i++) {
2087 if ((*i)->hasSupport(protocol) && (*i)->isValid())
2093 const AttributeAuthorityDescriptor* getAttributeAuthorityDescriptor(const XMLCh* protocol) const {
2094 for (vector<AttributeAuthorityDescriptor*>::const_iterator i=m_AttributeAuthorityDescriptors.begin(); i!=m_AttributeAuthorityDescriptors.end(); i++) {
2095 if ((*i)->hasSupport(protocol) && (*i)->isValid())
2101 const PDPDescriptor* getPDPDescriptor(const XMLCh* protocol) const {
2102 for (vector<PDPDescriptor*>::const_iterator i=m_PDPDescriptors.begin(); i!=m_PDPDescriptors.end(); i++) {
2103 if ((*i)->hasSupport(protocol) && (*i)->isValid())
2109 const RoleDescriptor* getRoleDescriptor(xmltooling::QName& qname, const XMLCh* protocol) const {
2110 for (vector<RoleDescriptor*>::const_iterator i=m_RoleDescriptors.begin(); i!=m_RoleDescriptors.end(); i++) {
2111 if ((*i)->getSchemaType() && qname==(*((*i)->getSchemaType())) && (*i)->hasSupport(protocol) && (*i)->isValid())
2118 void marshallAttributes(DOMElement* domElement) const {
2119 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2120 MARSHALL_STRING_ATTRIB(EntityID,ENTITYID,NULL);
2121 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2122 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2124 // Take care of wildcard.
2125 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
2126 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
2127 if (i->first.hasPrefix())
2128 attr->setPrefix(i->first.getPrefix());
2129 attr->setNodeValue(i->second);
2130 domElement->setAttributeNode(attr);
2134 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2135 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
2136 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
2137 PROC_TYPED_CHILDREN(RoleDescriptor,SAMLConstants::SAML20MD_NS,false);
2138 PROC_TYPED_CHILDREN(IDPSSODescriptor,SAMLConstants::SAML20MD_NS,false);
2139 PROC_TYPED_CHILDREN(SPSSODescriptor,SAMLConstants::SAML20MD_NS,false);
2140 PROC_TYPED_CHILDREN(AuthnAuthorityDescriptor,SAMLConstants::SAML20MD_NS,false);
2141 PROC_TYPED_CHILDREN(AttributeAuthorityDescriptor,SAMLConstants::SAML20MD_NS,false);
2142 PROC_TYPED_CHILDREN(PDPDescriptor,SAMLConstants::SAML20MD_NS,false);
2143 PROC_TYPED_CHILD(AffiliationDescriptor,SAMLConstants::SAML20MD_NS,false);
2144 PROC_TYPED_CHILD(Organization,SAMLConstants::SAML20MD_NS,false);
2145 PROC_TYPED_CHILDREN(ContactPerson,SAMLConstants::SAML20MD_NS,false);
2146 PROC_TYPED_CHILDREN(AdditionalMetadataLocation,SAMLConstants::SAML20MD_NS,false);
2147 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2150 void processAttribute(const DOMAttr* attribute) {
2151 PROC_ID_ATTRIB(ID,ID,NULL);
2152 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
2153 setAttribute(q,attribute->getNodeValue());
2157 class SAML_DLLLOCAL EntitiesDescriptorImpl : public virtual EntitiesDescriptor,
2158 public virtual SignableObject,
2159 public AbstractComplexElement,
2160 public AbstractDOMCachingXMLObject,
2161 public AbstractXMLObjectMarshaller,
2162 public AbstractXMLObjectUnmarshaller
2166 m_ValidUntil=m_CacheDuration=NULL;
2167 m_children.push_back(NULL);
2168 m_children.push_back(NULL);
2171 m_pos_Signature=m_children.begin();
2172 m_pos_Extensions=m_pos_Signature;
2177 virtual ~EntitiesDescriptorImpl() {
2178 XMLString::release(&m_ID);
2179 XMLString::release(&m_Name);
2180 delete m_ValidUntil;
2181 delete m_CacheDuration;
2184 EntitiesDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
2185 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2189 EntitiesDescriptorImpl(const EntitiesDescriptorImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
2192 setName(src.getName());
2193 setValidUntil(src.getValidUntil());
2194 setCacheDuration(src.getCacheDuration());
2195 if (src.getSignature())
2196 setSignature(src.getSignature()->cloneSignature());
2197 if (src.getExtensions())
2198 setExtensions(src.getExtensions()->cloneExtensions());
2200 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2202 EntityDescriptor* e=dynamic_cast<EntityDescriptor*>(*i);
2204 getEntityDescriptors().push_back(e->cloneEntityDescriptor());
2208 EntitiesDescriptor* es=dynamic_cast<EntitiesDescriptor*>(*i);
2210 getEntitiesDescriptors().push_back(es->cloneEntitiesDescriptor());
2217 IMPL_XMLOBJECT_CLONE(EntitiesDescriptor);
2219 const XMLCh* getId() const {
2223 //IMPL_TYPED_CHILD(Signature);
2224 // Need customized setter.
2226 Signature* m_Signature;
2227 list<XMLObject*>::iterator m_pos_Signature;
2229 Signature* getSignature() const {
2233 void setSignature(Signature* sig) {
2234 prepareForAssignment(m_Signature,sig);
2235 *m_pos_Signature=m_Signature=sig;
2236 // Sync content reference back up.
2238 m_Signature->setContentReference(new opensaml::ContentReference(*this));
2241 IMPL_STRING_ATTRIB(ID);
2242 IMPL_STRING_ATTRIB(Name);
2243 IMPL_DATETIME_ATTRIB(ValidUntil,LLONG_MAX);
2244 IMPL_DATETIME_ATTRIB(CacheDuration,0);
2245 IMPL_TYPED_CHILD(Extensions);
2246 IMPL_TYPED_CHILDREN(EntityDescriptor,m_children.end());
2247 IMPL_TYPED_CHILDREN(EntitiesDescriptor,m_children.end());
2250 void marshallAttributes(DOMElement* domElement) const {
2251 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2252 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
2253 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2254 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2257 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2258 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
2259 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
2260 PROC_TYPED_CHILDREN(EntityDescriptor,SAMLConstants::SAML20MD_NS,false);
2261 PROC_TYPED_CHILDREN(EntitiesDescriptor,SAMLConstants::SAML20MD_NS,false);
2262 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2265 void processAttribute(const DOMAttr* attribute) {
2266 PROC_ID_ATTRIB(ID,ID,NULL);
2267 PROC_STRING_ATTRIB(Name,NAME,NULL);
2268 PROC_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2269 PROC_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2276 #if defined (_MSC_VER)
2277 #pragma warning( pop )
2280 // Builder Implementations
2282 IMPL_XMLOBJECTBUILDER(AdditionalMetadataLocation);
2283 IMPL_XMLOBJECTBUILDER(AffiliateMember);
2284 IMPL_XMLOBJECTBUILDER(AffiliationDescriptor);
2285 IMPL_XMLOBJECTBUILDER(ArtifactResolutionService);
2286 IMPL_XMLOBJECTBUILDER(AssertionConsumerService);
2287 IMPL_XMLOBJECTBUILDER(AssertionIDRequestService);
2288 IMPL_XMLOBJECTBUILDER(AttributeAuthorityDescriptor);
2289 IMPL_XMLOBJECTBUILDER(AttributeConsumingService);
2290 IMPL_XMLOBJECTBUILDER(AttributeProfile);
2291 IMPL_XMLOBJECTBUILDER(AttributeService);
2292 IMPL_XMLOBJECTBUILDER(AuthnAuthorityDescriptor);
2293 IMPL_XMLOBJECTBUILDER(AuthnQueryService);
2294 IMPL_XMLOBJECTBUILDER(AuthzService);
2295 IMPL_XMLOBJECTBUILDER(Company);
2296 IMPL_XMLOBJECTBUILDER(ContactPerson);
2297 IMPL_XMLOBJECTBUILDER(EmailAddress);
2298 IMPL_XMLOBJECTBUILDER(EndpointType);
2299 IMPL_XMLOBJECTBUILDER(EntitiesDescriptor);
2300 IMPL_XMLOBJECTBUILDER(EntityDescriptor);
2301 IMPL_XMLOBJECTBUILDER(Extensions);
2302 IMPL_XMLOBJECTBUILDER(GivenName);
2303 IMPL_XMLOBJECTBUILDER(IDPSSODescriptor);
2304 IMPL_XMLOBJECTBUILDER(IndexedEndpointType);
2305 IMPL_XMLOBJECTBUILDER(KeyDescriptor);
2306 IMPL_XMLOBJECTBUILDER(localizedNameType);
2307 IMPL_XMLOBJECTBUILDER(localizedURIType);
2308 IMPL_XMLOBJECTBUILDER(ManageNameIDService);
2309 IMPL_XMLOBJECTBUILDER(NameIDFormat);
2310 IMPL_XMLOBJECTBUILDER(NameIDMappingService);
2311 IMPL_XMLOBJECTBUILDER(Organization);
2312 IMPL_XMLOBJECTBUILDER(OrganizationName);
2313 IMPL_XMLOBJECTBUILDER(OrganizationDisplayName);
2314 IMPL_XMLOBJECTBUILDER(OrganizationURL);
2315 IMPL_XMLOBJECTBUILDER(PDPDescriptor);
2316 IMPL_XMLOBJECTBUILDER(RequestedAttribute);
2317 IMPL_XMLOBJECTBUILDER(ServiceDescription);
2318 IMPL_XMLOBJECTBUILDER(ServiceName);
2319 IMPL_XMLOBJECTBUILDER(SingleLogoutService);
2320 IMPL_XMLOBJECTBUILDER(SingleSignOnService);
2321 IMPL_XMLOBJECTBUILDER(SPSSODescriptor);
2322 IMPL_XMLOBJECTBUILDER(SurName);
2323 IMPL_XMLOBJECTBUILDER(TelephoneNumber);
2325 const XMLCh AdditionalMetadataLocation::LOCAL_NAME[] = UNICODE_LITERAL_26(A,d,d,i,t,i,o,n,a,l,M,e,t,a,d,a,t,a,L,o,c,a,t,i,o,n);
2326 const XMLCh AdditionalMetadataLocation::TYPE_NAME[] = UNICODE_LITERAL_30(A,d,d,i,t,i,o,n,a,l,M,e,t,a,d,a,t,a,L,o,c,a,t,i,o,n,T,y,p,e);
2327 const XMLCh AdditionalMetadataLocation::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(n,a,m,e,s,p,a,c,e);
2328 const XMLCh AffiliateMember::LOCAL_NAME[] = UNICODE_LITERAL_15(A,f,f,i,l,i,a,t,e,M,e,m,b,e,r);
2329 const XMLCh AffiliationDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_21(A,f,f,i,l,i,a,t,i,o,n,D,e,s,c,r,i,p,t,o,r);
2330 const XMLCh AffiliationDescriptor::TYPE_NAME[] = UNICODE_LITERAL_25(A,f,f,i,l,i,a,t,i,o,n,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2331 const XMLCh AffiliationDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2332 const XMLCh AffiliationDescriptor::AFFILIATIONOWNERID_ATTRIB_NAME[] = UNICODE_LITERAL_18(a,f,f,i,l,i,a,t,i,o,n,O,w,n,e,r,I,D);
2333 const XMLCh ArtifactResolutionService::LOCAL_NAME[] = UNICODE_LITERAL_25(A,r,t,i,f,a,c,t,R,e,s,o,l,u,t,i,o,n,S,e,r,v,i,c,e);
2334 const XMLCh AssertionConsumerService::LOCAL_NAME[] = UNICODE_LITERAL_24(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e);
2335 const XMLCh AssertionIDRequestService::LOCAL_NAME[] = UNICODE_LITERAL_25(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t,S,e,r,v,i,c,e);
2336 const XMLCh AttributeAuthorityDescriptor::LOCAL_NAME[] =UNICODE_LITERAL_28(A,t,t,r,i,b,u,t,e,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r);
2337 const XMLCh AttributeAuthorityDescriptor::TYPE_NAME[] = UNICODE_LITERAL_32(A,t,t,r,i,b,u,t,e,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2338 const XMLCh AttributeConsumingService::LOCAL_NAME[] = UNICODE_LITERAL_25(A,t,t,r,i,b,u,t,e,C,o,n,s,u,m,i,n,g,S,e,r,v,i,c,e);
2339 const XMLCh AttributeConsumingService::TYPE_NAME[] = UNICODE_LITERAL_29(A,t,t,r,i,b,u,t,e,C,o,n,s,u,m,i,n,g,S,e,r,v,i,c,e,T,y,p,e);
2340 const XMLCh AttributeConsumingService::INDEX_ATTRIB_NAME[] = UNICODE_LITERAL_5(i,n,d,e,x);
2341 const XMLCh AttributeConsumingService::ISDEFAULT_ATTRIB_NAME[] = UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2342 const XMLCh AttributeProfile::LOCAL_NAME[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,P,r,o,f,i,l,e);
2343 const XMLCh AttributeService::LOCAL_NAME[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,S,e,r,v,i,c,e);
2344 const XMLCh AuthnAuthorityDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_24(A,u,t,h,n,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r);
2345 const XMLCh AuthnAuthorityDescriptor::TYPE_NAME[] = UNICODE_LITERAL_28(A,u,t,h,n,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2346 const XMLCh AuthnQueryService::LOCAL_NAME[] = UNICODE_LITERAL_17(A,u,t,h,n,Q,u,e,r,y,S,e,r,v,i,c,e);
2347 const XMLCh AuthzService::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,z,S,e,r,v,i,c,e);
2348 const XMLCh CacheableSAMLObject::CACHEDURATION_ATTRIB_NAME[] = UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2349 const XMLCh Company::LOCAL_NAME[] = UNICODE_LITERAL_7(C,o,m,p,a,n,y);
2350 const XMLCh ContactPerson::LOCAL_NAME[] = UNICODE_LITERAL_13(C,o,n,t,a,c,t,P,e,r,s,o,n);
2351 const XMLCh ContactPerson::TYPE_NAME[] = UNICODE_LITERAL_11(C,o,n,t,a,c,t,T,y,p,e);
2352 const XMLCh ContactPerson::CONTACTTYPE_ATTRIB_NAME[] = UNICODE_LITERAL_11(c,o,n,t,a,c,t,T,y,p,e);
2353 const XMLCh ContactPerson::CONTACT_TECHNICAL[] = UNICODE_LITERAL_9(t,e,c,h,n,i,c,a,l);
2354 const XMLCh ContactPerson::CONTACT_SUPPORT[] = UNICODE_LITERAL_7(s,u,p,p,o,r,t);
2355 const XMLCh ContactPerson::CONTACT_ADMINISTRATIVE[] = UNICODE_LITERAL_14(a,d,m,i,n,i,s,t,r,a,t,i,v,e);
2356 const XMLCh ContactPerson::CONTACT_BILLING[] = UNICODE_LITERAL_7(b,i,l,l,i,n,g);
2357 const XMLCh ContactPerson::CONTACT_OTHER[] = UNICODE_LITERAL_5(o,t,h,e,r);
2358 const XMLCh EmailAddress::LOCAL_NAME[] = UNICODE_LITERAL_12(E,m,a,i,l,A,d,d,r,e,s,s);
2359 const XMLCh EndpointType::LOCAL_NAME[] = {chNull};
2360 const XMLCh EndpointType::TYPE_NAME[] = UNICODE_LITERAL_12(E,n,d,p,o,i,n,t,T,y,p,e);
2361 const XMLCh EndpointType::BINDING_ATTRIB_NAME[] = UNICODE_LITERAL_7(B,i,n,d,i,n,g);
2362 const XMLCh EndpointType::LOCATION_ATTRIB_NAME[] = UNICODE_LITERAL_8(L,o,c,a,t,i,o,n);
2363 const XMLCh EndpointType::RESPONSELOCATION_ATTRIB_NAME[] = UNICODE_LITERAL_16(R,e,s,p,o,n,s,e,L,o,c,a,t,i,o,n);
2364 const XMLCh EntitiesDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,t,i,t,i,e,s,D,e,s,c,r,i,p,t,o,r);
2365 const XMLCh EntitiesDescriptor::TYPE_NAME[] = UNICODE_LITERAL_22(E,n,t,i,t,i,e,s,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2366 const XMLCh EntitiesDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2367 const XMLCh EntitiesDescriptor::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
2368 const XMLCh EntityDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_16(E,n,t,i,t,y,D,e,s,c,r,i,p,t,o,r);
2369 const XMLCh EntityDescriptor::TYPE_NAME[] = UNICODE_LITERAL_20(E,n,t,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2370 const XMLCh EntityDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2371 const XMLCh EntityDescriptor::ENTITYID_ATTRIB_NAME[] = UNICODE_LITERAL_8(e,n,t,i,t,y,I,D);
2372 const XMLCh Extensions::LOCAL_NAME[] = UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
2373 const XMLCh Extensions::TYPE_NAME[] = UNICODE_LITERAL_14(E,x,t,e,n,s,i,o,n,s,T,y,p,e);
2374 const XMLCh GivenName::LOCAL_NAME[] = UNICODE_LITERAL_9(G,i,v,e,n,N,a,m,e);
2375 const XMLCh IDPSSODescriptor::LOCAL_NAME[] = UNICODE_LITERAL_16(I,D,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2376 const XMLCh IDPSSODescriptor::TYPE_NAME[] = UNICODE_LITERAL_20(I,D,P,S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2377 const XMLCh IDPSSODescriptor::WANTAUTHNREQUESTSSIGNED_ATTRIB_NAME[] = UNICODE_LITERAL_23(W,a,n,t,A,u,t,h,n,R,e,q,u,e,s,t,s,S,i,g,n,e,d);
2378 const XMLCh IndexedEndpointType::LOCAL_NAME[] = {chNull};
2379 const XMLCh IndexedEndpointType::TYPE_NAME[] = UNICODE_LITERAL_19(I,n,d,e,x,e,d,E,n,d,p,o,i,n,t,T,y,p,e);
2380 const XMLCh IndexedEndpointType::INDEX_ATTRIB_NAME[] = UNICODE_LITERAL_5(i,n,d,e,x);
2381 const XMLCh IndexedEndpointType::ISDEFAULT_ATTRIB_NAME[] = UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2382 const XMLCh KeyDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_13(K,e,y,D,e,s,c,r,i,p,t,o,r);
2383 const XMLCh KeyDescriptor::TYPE_NAME[] = UNICODE_LITERAL_17(K,e,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2384 const XMLCh KeyDescriptor::USE_ATTRIB_NAME[] = UNICODE_LITERAL_3(u,s,e);
2385 const XMLCh KeyDescriptor::KEYTYPE_ENCRYPTION[] = UNICODE_LITERAL_10(e,n,c,r,y,p,t,i,o,n);
2386 const XMLCh KeyDescriptor::KEYTYPE_SIGNING[] = UNICODE_LITERAL_7(s,i,g,n,i,n,g);
2387 const XMLCh localizedNameType::LOCAL_NAME[] = {chNull};
2388 const XMLCh localizedNameType::TYPE_NAME[] = UNICODE_LITERAL_17(l,o,c,a,l,i,z,e,d,N,a,m,e,T,y,p,e);
2389 const XMLCh localizedNameType::LANG_ATTRIB_NAME[] = UNICODE_LITERAL_4(l,a,n,g);
2390 const XMLCh localizedURIType::LOCAL_NAME[] = {chNull};
2391 const XMLCh localizedURIType::TYPE_NAME[] = UNICODE_LITERAL_16(l,o,c,a,l,i,z,e,d,U,R,I,T,y,p,e);
2392 const XMLCh localizedURIType::LANG_ATTRIB_NAME[] = UNICODE_LITERAL_4(l,a,n,g);
2393 const XMLCh ManageNameIDService::LOCAL_NAME[] = UNICODE_LITERAL_19(M,a,n,a,g,e,N,a,m,e,I,D,S,e,r,v,i,c,e);
2394 const XMLCh NameIDFormat::LOCAL_NAME[] = UNICODE_LITERAL_12(N,a,m,e,I,D,F,o,r,m,a,t);
2395 const XMLCh NameIDMappingService::LOCAL_NAME[] = UNICODE_LITERAL_20(N,a,m,e,I,D,M,a,p,p,i,n,g,S,e,r,v,i,c,e);
2396 const XMLCh Organization::LOCAL_NAME[] = UNICODE_LITERAL_12(O,r,g,a,n,i,z,a,t,i,o,n);
2397 const XMLCh Organization::TYPE_NAME[] = UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,T,y,p,e);
2398 const XMLCh OrganizationName::LOCAL_NAME[] = UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,N,a,m,e);
2399 const XMLCh OrganizationDisplayName::LOCAL_NAME[] = UNICODE_LITERAL_23(O,r,g,a,n,i,z,a,t,i,o,n,D,i,s,p,l,a,y,N,a,m,e);
2400 const XMLCh OrganizationURL::LOCAL_NAME[] = UNICODE_LITERAL_15(O,r,g,a,n,i,z,a,t,i,o,n,U,R,L);
2401 const XMLCh PDPDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_13(P,D,P,D,e,s,c,r,i,p,t,o,r);
2402 const XMLCh PDPDescriptor::TYPE_NAME[] = UNICODE_LITERAL_17(P,D,P,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2403 const XMLCh RequestedAttribute::LOCAL_NAME[] = UNICODE_LITERAL_18(R,e,q,u,e,s,t,e,d,A,t,t,r,i,b,u,t,e);
2404 const XMLCh RequestedAttribute::TYPE_NAME[] = UNICODE_LITERAL_22(R,e,q,u,e,s,t,e,d,A,t,t,r,i,b,u,t,e,T,y,p,e);
2405 const XMLCh RequestedAttribute::ISREQUIRED_ATTRIB_NAME[] = UNICODE_LITERAL_10(i,s,R,e,q,u,i,r,e,d);
2406 const XMLCh RoleDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2407 const XMLCh RoleDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2408 const XMLCh RoleDescriptor::PROTOCOLSUPPORTENUMERATION_ATTRIB_NAME[] = UNICODE_LITERAL_26(p,r,o,t,o,c,o,l,S,u,p,p,o,r,t,E,n,u,m,e,r,a,t,i,o,n);
2409 const XMLCh RoleDescriptor::ERRORURL_ATTRIB_NAME[] = UNICODE_LITERAL_8(e,r,r,o,r,U,R,L);
2410 const XMLCh ServiceDescription::LOCAL_NAME[] = UNICODE_LITERAL_18(S,e,r,v,i,c,e,D,e,s,c,r,i,p,t,i,o,n);
2411 const XMLCh ServiceName::LOCAL_NAME[] = UNICODE_LITERAL_11(S,e,r,v,i,c,e,N,a,m,e);
2412 const XMLCh SingleLogoutService::LOCAL_NAME[] = UNICODE_LITERAL_19(S,i,n,g,l,e,L,o,g,o,u,t,S,e,r,v,i,c,e);
2413 const XMLCh SingleSignOnService::LOCAL_NAME[] = UNICODE_LITERAL_19(S,i,n,g,l,e,S,i,g,n,O,n,S,e,r,v,i,c,e);
2414 const XMLCh SPSSODescriptor::LOCAL_NAME[] = UNICODE_LITERAL_15(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2415 const XMLCh SPSSODescriptor::TYPE_NAME[] = UNICODE_LITERAL_19(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2416 const XMLCh SPSSODescriptor::AUTHNREQUESTSSIGNED_ATTRIB_NAME[] = UNICODE_LITERAL_19(A,u,t,h,n,R,e,q,u,e,s,t,s,S,i,g,n,e,d);
2417 const XMLCh SPSSODescriptor::WANTASSERTIONSSIGNED_ATTRIB_NAME[] = UNICODE_LITERAL_20(W,a,n,t,A,s,s,e,r,t,i,o,n,s,S,i,g,n,e,d);
2418 const XMLCh SSODescriptorType::LOCAL_NAME[] = {chNull};
2419 const XMLCh SSODescriptorType::TYPE_NAME[] = UNICODE_LITERAL_17(S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2420 const XMLCh SurName::LOCAL_NAME[] = UNICODE_LITERAL_7(S,u,r,N,a,m,e);
2421 const XMLCh TelephoneNumber::LOCAL_NAME[] = UNICODE_LITERAL_15(T,e,l,e,p,h,o,n,e,N,u,m,b,e,r);
2422 const XMLCh TimeBoundSAMLObject::VALIDUNTIL_ATTRIB_NAME[] = UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);