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>
35 #include <xmltooling/validation/AbstractValidatingXMLObject.h>
38 #include <xercesc/util/XMLUniDefs.hpp>
40 using namespace opensaml::saml2md;
41 using namespace opensaml::saml2;
42 using namespace opensaml;
43 using namespace xmlencryption;
44 using namespace xmlsignature;
45 using namespace xmltooling;
48 #if defined (_MSC_VER)
49 #pragma warning( push )
50 #pragma warning( disable : 4250 4251 )
56 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AffiliateMember);
57 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AttributeProfile);
58 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Company);
59 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,EmailAddress);
60 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,GivenName);
61 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,NameIDFormat);
62 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SurName);
63 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,TelephoneNumber);
65 class SAML_DLLLOCAL localizedNameTypeImpl : public virtual localizedNameType,
66 public AbstractSimpleElement,
67 public AbstractChildlessElement,
68 public AbstractDOMCachingXMLObject,
69 public AbstractValidatingXMLObject,
70 public AbstractXMLObjectMarshaller,
71 public AbstractXMLObjectUnmarshaller
78 localizedNameTypeImpl() {
83 virtual ~localizedNameTypeImpl() {
84 XMLString::release(&m_Lang);
87 localizedNameTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
88 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
92 localizedNameTypeImpl(const localizedNameTypeImpl& src)
93 : AbstractXMLObject(src), AbstractSimpleElement(src),
94 AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
96 setLang(src.getLang());
99 IMPL_XMLOBJECT_CLONE(localizedNameType);
100 IMPL_XMLOBJECT_CONTENT;
101 IMPL_STRING_ATTRIB(Lang);
104 void marshallAttributes(DOMElement* domElement) const {
105 MARSHALL_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
108 void processAttribute(const DOMAttr* attribute) {
109 PROC_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
110 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
114 class SAML_DLLLOCAL localizedURITypeImpl : public virtual localizedURIType,
115 public AbstractSimpleElement,
116 public AbstractChildlessElement,
117 public AbstractDOMCachingXMLObject,
118 public AbstractValidatingXMLObject,
119 public AbstractXMLObjectMarshaller,
120 public AbstractXMLObjectUnmarshaller
127 localizedURITypeImpl() {
132 virtual ~localizedURITypeImpl() {
133 XMLString::release(&m_Lang);
136 localizedURITypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
137 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
141 localizedURITypeImpl(const localizedURITypeImpl& src)
142 : AbstractXMLObject(src), AbstractSimpleElement(src),
143 AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
145 setLang(src.getLang());
148 IMPL_XMLOBJECT_CLONE(localizedURIType);
149 IMPL_XMLOBJECT_CONTENT;
150 IMPL_STRING_ATTRIB(Lang);
153 void marshallAttributes(DOMElement* domElement) const {
154 MARSHALL_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
157 void processAttribute(const DOMAttr* attribute) {
158 PROC_STRING_ATTRIB(Lang,LANG,XMLConstants::XML_NS);
159 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
163 class SAML_DLLLOCAL OrganizationNameImpl : public virtual OrganizationName, public localizedNameTypeImpl
166 virtual ~OrganizationNameImpl() {}
168 OrganizationNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
169 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
171 OrganizationNameImpl(const OrganizationNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
173 IMPL_XMLOBJECT_CLONE(OrganizationName);
174 localizedNameType* clonelocalizedNameType() const {
175 return new OrganizationNameImpl(*this);
179 class SAML_DLLLOCAL OrganizationDisplayNameImpl : public virtual OrganizationDisplayName, public localizedNameTypeImpl
182 virtual ~OrganizationDisplayNameImpl() {}
184 OrganizationDisplayNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
185 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
187 OrganizationDisplayNameImpl(const OrganizationDisplayNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
189 IMPL_XMLOBJECT_CLONE(OrganizationDisplayName);
190 localizedNameType* clonelocalizedNameType() const {
191 return new OrganizationDisplayNameImpl(*this);
195 class SAML_DLLLOCAL OrganizationURLImpl : public virtual OrganizationURL, public localizedURITypeImpl
198 virtual ~OrganizationURLImpl() {}
200 OrganizationURLImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
201 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
203 OrganizationURLImpl(const OrganizationURLImpl& src) : AbstractXMLObject(src), localizedURITypeImpl(src) {}
205 IMPL_XMLOBJECT_CLONE(OrganizationURL);
206 localizedURIType* clonelocalizedURIType() const {
207 return new OrganizationURLImpl(*this);
211 class SAML_DLLLOCAL ServiceNameImpl : public virtual ServiceName, public localizedNameTypeImpl
214 virtual ~ServiceNameImpl() {}
216 ServiceNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
217 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
219 ServiceNameImpl(const ServiceNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
221 IMPL_XMLOBJECT_CLONE(ServiceName);
222 localizedNameType* clonelocalizedNameType() const {
223 return new ServiceNameImpl(*this);
227 class SAML_DLLLOCAL ServiceDescriptionImpl : public virtual ServiceDescription, public localizedNameTypeImpl
230 virtual ~ServiceDescriptionImpl() {}
232 ServiceDescriptionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
233 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
235 ServiceDescriptionImpl(const ServiceDescriptionImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
237 IMPL_XMLOBJECT_CLONE(ServiceDescription);
238 localizedNameType* clonelocalizedNameType() const {
239 return new ServiceDescriptionImpl(*this);
243 class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
244 public AbstractDOMCachingXMLObject,
245 public AbstractElementProxy,
246 public AbstractValidatingXMLObject,
247 public AbstractXMLObjectMarshaller,
248 public AbstractXMLObjectUnmarshaller
251 virtual ~ExtensionsImpl() {}
253 ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
254 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
257 ExtensionsImpl(const ExtensionsImpl& src)
258 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src),
259 AbstractValidatingXMLObject(src) {
260 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
262 getXMLObjects().push_back((*i)->clone());
267 IMPL_XMLOBJECT_CLONE(Extensions);
270 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
272 const XMLCh* nsURI=root->getNamespaceURI();
273 if (!XMLString::equals(nsURI,SAMLConstants::SAML20MD_NS) && nsURI && *nsURI) {
274 getXMLObjects().push_back(childXMLObject);
278 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
282 class SAML_DLLLOCAL OrganizationImpl : public virtual Organization,
283 public AbstractComplexElement,
284 public AbstractAttributeExtensibleXMLObject,
285 public AbstractDOMCachingXMLObject,
286 public AbstractValidatingXMLObject,
287 public AbstractXMLObjectMarshaller,
288 public AbstractXMLObjectUnmarshaller
290 list<XMLObject*>::iterator m_pos_OrganizationDisplayName;
291 list<XMLObject*>::iterator m_pos_OrganizationURL;
294 m_children.push_back(NULL);
295 m_children.push_back(NULL);
296 m_children.push_back(NULL);
298 m_pos_Extensions=m_children.begin();
299 m_pos_OrganizationDisplayName=m_pos_Extensions;
300 ++m_pos_OrganizationDisplayName;
301 m_pos_OrganizationURL=m_pos_OrganizationDisplayName;
302 ++m_pos_OrganizationURL;
305 virtual ~OrganizationImpl() {}
307 OrganizationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
308 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
312 OrganizationImpl(const OrganizationImpl& src)
313 : AbstractXMLObject(src),
314 AbstractAttributeExtensibleXMLObject(src),
315 AbstractDOMCachingXMLObject(src),
316 AbstractValidatingXMLObject(src) {
318 if (src.getExtensions())
319 setExtensions(src.getExtensions()->cloneExtensions());
320 VectorOf(OrganizationName) v=getOrganizationNames();
321 for (vector<OrganizationName*>::const_iterator i=src.m_OrganizationNames.begin(); i!=src.m_OrganizationNames.end(); i++) {
323 v.push_back((*i)->cloneOrganizationName());
326 VectorOf(OrganizationDisplayName) w=getOrganizationDisplayNames();
327 for (vector<OrganizationDisplayName*>::const_iterator j=src.m_OrganizationDisplayNames.begin(); j!=src.m_OrganizationDisplayNames.end(); j++) {
329 w.push_back((*j)->cloneOrganizationDisplayName());
332 VectorOf(OrganizationURL) x=getOrganizationURLs();
333 for (vector<OrganizationURL*>::const_iterator k=src.m_OrganizationURLs.begin(); k!=src.m_OrganizationURLs.end(); k++) {
335 x.push_back((*k)->cloneOrganizationURL());
340 IMPL_XMLOBJECT_CLONE(Organization);
341 IMPL_TYPED_CHILD(Extensions);
342 IMPL_TYPED_CHILDREN(OrganizationName,m_pos_OrganizationDisplayName);
343 IMPL_TYPED_CHILDREN(OrganizationDisplayName,m_pos_OrganizationURL);
344 IMPL_TYPED_CHILDREN(OrganizationURL,m_children.end());
347 void marshallAttributes(DOMElement* domElement) const {
348 // Take care of wildcard.
349 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
350 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
351 if (i->first.hasPrefix())
352 attr->setPrefix(i->first.getPrefix());
353 attr->setNodeValue(i->second);
354 domElement->setAttributeNode(attr);
358 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
359 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
360 PROC_TYPED_CHILDREN(OrganizationName,SAMLConstants::SAML20MD_NS,false);
361 PROC_TYPED_CHILDREN(OrganizationDisplayName,SAMLConstants::SAML20MD_NS,false);
362 PROC_TYPED_CHILDREN(OrganizationURL,SAMLConstants::SAML20MD_NS,false);
363 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
366 void processAttribute(const DOMAttr* attribute) {
367 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
368 setAttribute(q,attribute->getNodeValue());
372 class SAML_DLLLOCAL ContactPersonImpl : public virtual ContactPerson,
373 public AbstractComplexElement,
374 public AbstractAttributeExtensibleXMLObject,
375 public AbstractDOMCachingXMLObject,
376 public AbstractValidatingXMLObject,
377 public AbstractXMLObjectMarshaller,
378 public AbstractXMLObjectUnmarshaller
380 list<XMLObject*>::iterator m_pos_TelephoneNumber;
384 m_children.push_back(NULL);
385 m_children.push_back(NULL);
386 m_children.push_back(NULL);
387 m_children.push_back(NULL);
388 m_children.push_back(NULL);
393 m_pos_Extensions=m_children.begin();
394 m_pos_Company=m_pos_Extensions;
396 m_pos_GivenName=m_pos_Company;
398 m_pos_SurName=m_pos_GivenName;
400 m_pos_TelephoneNumber=m_pos_SurName;
401 ++m_pos_TelephoneNumber;
404 virtual ~ContactPersonImpl() {}
406 ContactPersonImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
407 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
411 ContactPersonImpl(const ContactPersonImpl& src)
412 : AbstractXMLObject(src),
413 AbstractAttributeExtensibleXMLObject(src),
414 AbstractDOMCachingXMLObject(src),
415 AbstractValidatingXMLObject(src) {
417 if (src.getExtensions())
418 setExtensions(src.getExtensions()->cloneExtensions());
419 if (src.getCompany())
420 setCompany(src.getCompany()->cloneCompany());
421 if (src.getGivenName())
422 setGivenName(src.getGivenName()->cloneGivenName());
423 if (src.getSurName())
424 setSurName(src.getSurName()->cloneSurName());
426 VectorOf(EmailAddress) v=getEmailAddresss();
427 for (vector<EmailAddress*>::const_iterator i=src.m_EmailAddresss.begin(); i!=src.m_EmailAddresss.end(); i++) {
429 v.push_back((*i)->cloneEmailAddress());
432 VectorOf(TelephoneNumber) w=getTelephoneNumbers();
433 for (vector<TelephoneNumber*>::const_iterator j=src.m_TelephoneNumbers.begin(); j!=src.m_TelephoneNumbers.end(); j++) {
435 w.push_back((*j)->cloneTelephoneNumber());
440 IMPL_XMLOBJECT_CLONE(ContactPerson);
441 IMPL_STRING_ATTRIB(ContactType);
442 IMPL_TYPED_CHILD(Extensions);
443 IMPL_TYPED_CHILD(Company);
444 IMPL_TYPED_CHILD(GivenName);
445 IMPL_TYPED_CHILD(SurName);
446 IMPL_TYPED_CHILDREN(EmailAddress,m_pos_TelephoneNumber);
447 IMPL_TYPED_CHILDREN(TelephoneNumber,m_children.end());
449 void setAttribute(QName& qualifiedName, const XMLCh* value) {
450 if (!qualifiedName.hasNamespaceURI()) {
451 if (XMLString::equals(qualifiedName.getLocalPart(),CONTACTTYPE_ATTRIB_NAME)) {
452 setContactType(value);
456 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
460 void marshallAttributes(DOMElement* domElement) const {
461 MARSHALL_STRING_ATTRIB(ContactType,CONTACTTYPE,NULL);
463 // Take care of wildcard.
464 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
465 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
466 if (i->first.hasPrefix())
467 attr->setPrefix(i->first.getPrefix());
468 attr->setNodeValue(i->second);
469 domElement->setAttributeNode(attr);
473 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
474 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
475 PROC_TYPED_CHILD(Company,SAMLConstants::SAML20MD_NS,false);
476 PROC_TYPED_CHILD(GivenName,SAMLConstants::SAML20MD_NS,false);
477 PROC_TYPED_CHILD(SurName,SAMLConstants::SAML20MD_NS,false);
478 PROC_TYPED_CHILDREN(EmailAddress,SAMLConstants::SAML20MD_NS,false);
479 PROC_TYPED_CHILDREN(TelephoneNumber,SAMLConstants::SAML20MD_NS,false);
480 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
483 void processAttribute(const DOMAttr* attribute) {
484 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
485 setAttribute(q,attribute->getNodeValue());
489 class SAML_DLLLOCAL AdditionalMetadataLocationImpl : public virtual AdditionalMetadataLocation,
490 public AbstractSimpleElement,
491 public AbstractChildlessElement,
492 public AbstractDOMCachingXMLObject,
493 public AbstractValidatingXMLObject,
494 public AbstractXMLObjectMarshaller,
495 public AbstractXMLObjectUnmarshaller
502 virtual ~AdditionalMetadataLocationImpl() {
503 XMLString::release(&m_Namespace);
506 AdditionalMetadataLocationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
507 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
511 AdditionalMetadataLocationImpl(const AdditionalMetadataLocationImpl& src)
512 : AbstractXMLObject(src), AbstractSimpleElement(src),
513 AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
517 IMPL_XMLOBJECT_CLONE(AdditionalMetadataLocation);
518 IMPL_XMLOBJECT_CONTENT;
519 IMPL_STRING_ATTRIB(Namespace);
522 void marshallAttributes(DOMElement* domElement) const {
523 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
526 void processAttribute(const DOMAttr* attribute) {
527 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
528 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
532 class SAML_DLLLOCAL KeyDescriptorImpl : public virtual KeyDescriptor,
533 public AbstractComplexElement,
534 public AbstractDOMCachingXMLObject,
535 public AbstractValidatingXMLObject,
536 public AbstractXMLObjectMarshaller,
537 public AbstractXMLObjectUnmarshaller
542 m_children.push_back(NULL);
543 m_pos_KeyInfo=m_children.begin();
546 virtual ~KeyDescriptorImpl() {
547 XMLString::release(&m_Use);
550 KeyDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
551 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
555 KeyDescriptorImpl(const KeyDescriptorImpl& src)
556 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
558 setUse(src.getUse());
559 if (src.getKeyInfo())
560 setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
561 VectorOf(EncryptionMethod) v=getEncryptionMethods();
562 for (vector<EncryptionMethod*>::const_iterator i=src.m_EncryptionMethods.begin(); i!=src.m_EncryptionMethods.end(); i++) {
564 v.push_back((*i)->cloneEncryptionMethod());
569 IMPL_XMLOBJECT_CLONE(KeyDescriptor);
570 IMPL_STRING_ATTRIB(Use);
571 IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
572 IMPL_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption,m_children.end());
575 void marshallAttributes(DOMElement* domElement) const {
576 MARSHALL_STRING_ATTRIB(Use,USE,NULL);
579 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
580 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLConstants::XMLSIG_NS,false);
581 PROC_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption,XMLConstants::XMLENC_NS,false);
582 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
585 void processAttribute(const DOMAttr* attribute) {
586 PROC_STRING_ATTRIB(Use,USE,NULL);
587 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
591 class SAML_DLLLOCAL EndpointTypeImpl : public virtual EndpointType,
592 public AbstractDOMCachingXMLObject,
593 public AbstractElementProxy,
594 public AbstractAttributeExtensibleXMLObject,
595 public AbstractValidatingXMLObject,
596 public AbstractXMLObjectMarshaller,
597 public AbstractXMLObjectUnmarshaller
600 m_Binding=m_Location=m_ResponseLocation=NULL;
609 virtual ~EndpointTypeImpl() {
610 XMLString::release(&m_Binding);
611 XMLString::release(&m_Location);
612 XMLString::release(&m_ResponseLocation);
615 EndpointTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
616 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
619 EndpointTypeImpl(const EndpointTypeImpl& src)
620 : AbstractXMLObject(src),
621 AbstractDOMCachingXMLObject(src),
622 AbstractElementProxy(src),
623 AbstractAttributeExtensibleXMLObject(src),
624 AbstractValidatingXMLObject(src) {
625 setBinding(src.getBinding());
626 setLocation(src.getLocation());
627 setResponseLocation(src.getResponseLocation());
628 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
630 getXMLObjects().push_back((*i)->clone());
635 IMPL_XMLOBJECT_CLONE(EndpointType);
636 IMPL_STRING_ATTRIB(Binding);
637 IMPL_STRING_ATTRIB(Location);
638 IMPL_STRING_ATTRIB(ResponseLocation);
640 void setAttribute(QName& qualifiedName, const XMLCh* value) {
641 if (!qualifiedName.hasNamespaceURI()) {
642 if (XMLString::equals(qualifiedName.getLocalPart(),BINDING_ATTRIB_NAME)) {
646 else if (XMLString::equals(qualifiedName.getLocalPart(),LOCATION_ATTRIB_NAME)) {
650 else if (XMLString::equals(qualifiedName.getLocalPart(),RESPONSELOCATION_ATTRIB_NAME)) {
651 setResponseLocation(value);
655 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
658 void marshallAttributes(DOMElement* domElement) const {
659 MARSHALL_STRING_ATTRIB(Binding,BINDING,NULL);
660 MARSHALL_STRING_ATTRIB(Location,LOCATION,NULL);
661 MARSHALL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION,NULL);
663 // Take care of wildcard.
664 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
665 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
666 if (i->first.hasPrefix())
667 attr->setPrefix(i->first.getPrefix());
668 attr->setNodeValue(i->second);
669 domElement->setAttributeNode(attr);
673 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
675 const XMLCh* nsURI=root->getNamespaceURI();
676 if (!XMLString::equals(nsURI,SAMLConstants::SAML20MD_NS) && nsURI && *nsURI) {
677 getXMLObjects().push_back(childXMLObject);
681 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
684 void processAttribute(const DOMAttr* attribute) {
685 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
686 setAttribute(q,attribute->getNodeValue());
690 class SAML_DLLLOCAL IndexedEndpointTypeImpl : public virtual IndexedEndpointType, public EndpointTypeImpl
698 IndexedEndpointTypeImpl() {
702 virtual ~IndexedEndpointTypeImpl() {}
704 IndexedEndpointTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
705 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
707 IndexedEndpointTypeImpl(const IndexedEndpointTypeImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {
708 setIndex(src.getIndex());
709 isDefault(src.isDefault());
712 IMPL_XMLOBJECT_CLONE(IndexedEndpointType);
713 EndpointType* cloneEndpointType() const {
714 return new IndexedEndpointTypeImpl(*this);
717 IMPL_INTEGER_ATTRIB(Index);
718 IMPL_BOOLEAN_ATTRIB(isDefault);
720 void setAttribute(QName& qualifiedName, const XMLCh* value) {
721 if (!qualifiedName.hasNamespaceURI()) {
722 if (XMLString::equals(qualifiedName.getLocalPart(),INDEX_ATTRIB_NAME)) {
723 setIndex(XMLString::parseInt(value));
726 else if (XMLString::equals(qualifiedName.getLocalPart(),ISDEFAULT_ATTRIB_NAME)) {
728 if (*value==chLatin_t || *value==chDigit_1)
730 else if (*value==chLatin_f || *value==chDigit_0)
736 EndpointTypeImpl::setAttribute(qualifiedName, value);
740 void marshallAttributes(DOMElement* domElement) const {
741 MARSHALL_INTEGER_ATTRIB(Index,INDEX,NULL);
742 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
743 EndpointTypeImpl::marshallAttributes(domElement);
747 class SAML_DLLLOCAL ArtifactResolutionServiceImpl : public virtual ArtifactResolutionService, public IndexedEndpointTypeImpl
750 virtual ~ArtifactResolutionServiceImpl() {}
752 ArtifactResolutionServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
753 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
755 ArtifactResolutionServiceImpl(const ArtifactResolutionServiceImpl& src) : AbstractXMLObject(src), IndexedEndpointTypeImpl(src) {}
757 IMPL_XMLOBJECT_CLONE(ArtifactResolutionService);
758 IndexedEndpointType* cloneIndexedEndpointType() const {
759 return new ArtifactResolutionServiceImpl(*this);
761 EndpointType* cloneEndpointType() const {
762 return new ArtifactResolutionServiceImpl(*this);
766 class SAML_DLLLOCAL SingleLogoutServiceImpl : public virtual SingleLogoutService, public EndpointTypeImpl
769 virtual ~SingleLogoutServiceImpl() {}
771 SingleLogoutServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
772 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
774 SingleLogoutServiceImpl(const SingleLogoutServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
776 IMPL_XMLOBJECT_CLONE(SingleLogoutService);
777 EndpointType* cloneEndpointType() const {
778 return new SingleLogoutServiceImpl(*this);
782 class SAML_DLLLOCAL ManageNameIDServiceImpl : public virtual ManageNameIDService, public EndpointTypeImpl
785 virtual ~ManageNameIDServiceImpl() {}
787 ManageNameIDServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
788 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
790 ManageNameIDServiceImpl(const ManageNameIDServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
792 IMPL_XMLOBJECT_CLONE(ManageNameIDService);
793 EndpointType* cloneEndpointType() const {
794 return new ManageNameIDServiceImpl(*this);
798 class SAML_DLLLOCAL SingleSignOnServiceImpl : public virtual SingleSignOnService, public EndpointTypeImpl
801 virtual ~SingleSignOnServiceImpl() {}
803 SingleSignOnServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
804 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
806 SingleSignOnServiceImpl(const SingleSignOnServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
808 IMPL_XMLOBJECT_CLONE(SingleSignOnService);
809 EndpointType* cloneEndpointType() const {
810 return new SingleSignOnServiceImpl(*this);
814 class SAML_DLLLOCAL NameIDMappingServiceImpl : public virtual NameIDMappingService, public EndpointTypeImpl
817 virtual ~NameIDMappingServiceImpl() {}
819 NameIDMappingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
820 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
822 NameIDMappingServiceImpl(const NameIDMappingServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
824 IMPL_XMLOBJECT_CLONE(NameIDMappingService);
825 EndpointType* cloneEndpointType() const {
826 return new NameIDMappingServiceImpl(*this);
830 class SAML_DLLLOCAL AssertionIDRequestServiceImpl : public virtual AssertionIDRequestService, public EndpointTypeImpl
833 virtual ~AssertionIDRequestServiceImpl() {}
835 AssertionIDRequestServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
836 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
838 AssertionIDRequestServiceImpl(const AssertionIDRequestServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
840 IMPL_XMLOBJECT_CLONE(AssertionIDRequestService);
841 EndpointType* cloneEndpointType() const {
842 return new AssertionIDRequestServiceImpl(*this);
846 class SAML_DLLLOCAL AssertionConsumerServiceImpl : public virtual AssertionConsumerService, public IndexedEndpointTypeImpl
849 virtual ~AssertionConsumerServiceImpl() {}
851 AssertionConsumerServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
852 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
854 AssertionConsumerServiceImpl(const AssertionConsumerServiceImpl& src) : AbstractXMLObject(src), IndexedEndpointTypeImpl(src) {}
856 IMPL_XMLOBJECT_CLONE(AssertionConsumerService);
857 EndpointType* cloneEndpointType() const {
858 return new AssertionConsumerServiceImpl(*this);
860 IndexedEndpointType* cloneIndexedEndpointType() const {
861 return new AssertionConsumerServiceImpl(*this);
865 class SAML_DLLLOCAL AuthnQueryServiceImpl : public virtual AuthnQueryService, public EndpointTypeImpl
868 virtual ~AuthnQueryServiceImpl() {}
870 AuthnQueryServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
871 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
873 AuthnQueryServiceImpl(const AuthnQueryServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
875 IMPL_XMLOBJECT_CLONE(AuthnQueryService);
876 EndpointType* cloneEndpointType() const {
877 return new AuthnQueryServiceImpl(*this);
881 class SAML_DLLLOCAL AuthzServiceImpl : public virtual AuthzService, public EndpointTypeImpl
884 virtual ~AuthzServiceImpl() {}
886 AuthzServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
887 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
889 AuthzServiceImpl(const AuthzServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
891 IMPL_XMLOBJECT_CLONE(AuthzService);
892 EndpointType* cloneEndpointType() const {
893 return new AuthzServiceImpl(*this);
897 class SAML_DLLLOCAL AttributeServiceImpl : public virtual AttributeService, public EndpointTypeImpl
900 virtual ~AttributeServiceImpl() {}
902 AttributeServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
903 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
905 AttributeServiceImpl(const AttributeServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
907 IMPL_XMLOBJECT_CLONE(AttributeService);
908 EndpointType* cloneEndpointType() const {
909 return new AttributeServiceImpl(*this);
913 class SAML_DLLLOCAL RoleDescriptorImpl : public virtual RoleDescriptor,
914 public virtual SignableObject,
915 public AbstractComplexElement,
916 public AbstractAttributeExtensibleXMLObject,
917 public AbstractDOMCachingXMLObject,
918 public AbstractValidatingXMLObject,
919 public AbstractXMLObjectMarshaller,
920 public AbstractXMLObjectUnmarshaller
923 m_ID=m_ProtocolSupportEnumeration=m_ErrorURL=NULL;
924 m_ValidUntil=m_CacheDuration=NULL;
925 m_children.push_back(NULL);
926 m_children.push_back(NULL);
927 m_children.push_back(NULL);
928 m_children.push_back(NULL);
932 m_pos_Signature=m_children.begin();
933 m_pos_Extensions=m_pos_Signature;
935 m_pos_Organization=m_pos_Extensions;
936 ++m_pos_Organization;
937 m_pos_ContactPerson=m_pos_Organization;
938 ++m_pos_ContactPerson;
942 list<XMLObject*>::iterator m_pos_ContactPerson;
944 RoleDescriptorImpl() {
949 virtual ~RoleDescriptorImpl() {
950 XMLString::release(&m_ID);
951 XMLString::release(&m_ProtocolSupportEnumeration);
952 XMLString::release(&m_ErrorURL);
954 delete m_CacheDuration;
957 RoleDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
958 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
962 RoleDescriptorImpl(const RoleDescriptorImpl& src)
963 : AbstractXMLObject(src),
964 AbstractAttributeExtensibleXMLObject(src),
965 AbstractDOMCachingXMLObject(src),
966 AbstractValidatingXMLObject(src) {
969 setProtocolSupportEnumeration(src.getProtocolSupportEnumeration());
970 setErrorURL(src.getErrorURL());
971 setValidUntil(src.getValidUntil());
972 setCacheDuration(src.getCacheDuration());
973 if (src.getSignature())
974 setSignature(src.getSignature()->cloneSignature());
975 if (src.getExtensions())
976 setExtensions(src.getExtensions()->cloneExtensions());
977 if (src.getOrganization())
978 setOrganization(src.getOrganization()->cloneOrganization());
980 VectorOf(KeyDescriptor) v=getKeyDescriptors();
981 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
983 v.push_back((*i)->cloneKeyDescriptor());
986 VectorOf(ContactPerson) w=getContactPersons();
987 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
989 w.push_back((*j)->cloneContactPerson());
994 const XMLCh* getId() const {
998 //IMPL_TYPED_CHILD(Signature);
999 // Need customized setter.
1001 Signature* m_Signature;
1002 list<XMLObject*>::iterator m_pos_Signature;
1004 Signature* getSignature() const {
1008 void setSignature(Signature* sig) {
1009 prepareForAssignment(m_Signature,sig);
1010 *m_pos_Signature=m_Signature=sig;
1011 // Sync content reference back up.
1013 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1016 IMPL_STRING_ATTRIB(ID);
1017 IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
1018 IMPL_STRING_ATTRIB(ErrorURL);
1019 IMPL_DATETIME_ATTRIB(ValidUntil);
1020 IMPL_DATETIME_ATTRIB(CacheDuration);
1021 IMPL_TYPED_CHILD(Extensions);
1022 IMPL_TYPED_CHILDREN(KeyDescriptor,m_pos_Organization);
1023 IMPL_TYPED_CHILD(Organization);
1024 IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
1026 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1027 if (!qualifiedName.hasNamespaceURI()) {
1028 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
1032 else if (XMLString::equals(qualifiedName.getLocalPart(),PROTOCOLSUPPORTENUMERATION_ATTRIB_NAME)) {
1033 setProtocolSupportEnumeration(value);
1036 else if (XMLString::equals(qualifiedName.getLocalPart(),ERRORURL_ATTRIB_NAME)) {
1040 else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
1041 setValidUntil(value);
1044 else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
1045 setCacheDuration(value);
1049 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
1053 void marshallAttributes(DOMElement* domElement) const {
1054 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1055 MARSHALL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION,NULL);
1056 MARSHALL_STRING_ATTRIB(ErrorURL,ERRORURL,NULL);
1057 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
1058 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
1060 // Take care of wildcard.
1061 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
1062 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
1063 if (i->first.hasPrefix())
1064 attr->setPrefix(i->first.getPrefix());
1065 attr->setNodeValue(i->second);
1066 domElement->setAttributeNode(attr);
1070 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1071 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
1072 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
1073 PROC_TYPED_CHILDREN(KeyDescriptor,SAMLConstants::SAML20MD_NS,false);
1074 PROC_TYPED_CHILD(Organization,SAMLConstants::SAML20MD_NS,false);
1075 PROC_TYPED_CHILDREN(ContactPerson,SAMLConstants::SAML20MD_NS,false);
1076 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1079 void processAttribute(const DOMAttr* attribute) {
1080 PROC_ID_ATTRIB(ID,ID,NULL);
1081 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
1082 setAttribute(q,attribute->getNodeValue());
1086 class SAML_DLLLOCAL SSODescriptorTypeImpl : public virtual SSODescriptorType, public RoleDescriptorImpl
1089 m_children.push_back(NULL);
1090 m_children.push_back(NULL);
1091 m_children.push_back(NULL);
1092 m_children.push_back(NULL);
1093 m_pos_ArtifactResolutionService=m_pos_ContactPerson;
1094 ++m_pos_ArtifactResolutionService;
1095 m_pos_SingleLogoutService=m_pos_ArtifactResolutionService;
1096 ++m_pos_SingleLogoutService;
1097 m_pos_ManageNameIDService=m_pos_SingleLogoutService;
1098 ++m_pos_ManageNameIDService;
1099 m_pos_NameIDFormat=m_pos_ManageNameIDService;
1100 ++m_pos_NameIDFormat;
1104 list<XMLObject*>::iterator m_pos_ArtifactResolutionService;
1105 list<XMLObject*>::iterator m_pos_SingleLogoutService;
1106 list<XMLObject*>::iterator m_pos_ManageNameIDService;
1107 list<XMLObject*>::iterator m_pos_NameIDFormat;
1109 SSODescriptorTypeImpl() {
1114 virtual ~SSODescriptorTypeImpl() {}
1116 SSODescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1117 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1121 SSODescriptorTypeImpl(const SSODescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1123 VectorOf(ArtifactResolutionService) v=getArtifactResolutionServices();
1124 for (vector<ArtifactResolutionService*>::const_iterator i=src.m_ArtifactResolutionServices.begin(); i!=src.m_ArtifactResolutionServices.end(); i++) {
1126 v.push_back((*i)->cloneArtifactResolutionService());
1129 VectorOf(SingleLogoutService) w=getSingleLogoutServices();
1130 for (vector<SingleLogoutService*>::const_iterator j=src.m_SingleLogoutServices.begin(); j!=src.m_SingleLogoutServices.end(); j++) {
1132 w.push_back((*j)->cloneSingleLogoutService());
1135 VectorOf(ManageNameIDService) x=getManageNameIDServices();
1136 for (vector<ManageNameIDService*>::const_iterator k=src.m_ManageNameIDServices.begin(); k!=src.m_ManageNameIDServices.end(); k++) {
1138 x.push_back((*k)->cloneManageNameIDService());
1141 VectorOf(NameIDFormat) y=getNameIDFormats();
1142 for (vector<NameIDFormat*>::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) {
1144 y.push_back((*m)->cloneNameIDFormat());
1149 IMPL_TYPED_CHILDREN(ArtifactResolutionService,m_pos_ArtifactResolutionService);
1150 IMPL_TYPED_CHILDREN(SingleLogoutService,m_pos_SingleLogoutService);
1151 IMPL_TYPED_CHILDREN(ManageNameIDService,m_pos_ManageNameIDService);
1152 IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1155 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1156 PROC_TYPED_CHILDREN(ArtifactResolutionService,SAMLConstants::SAML20MD_NS,false);
1157 PROC_TYPED_CHILDREN(SingleLogoutService,SAMLConstants::SAML20MD_NS,false);
1158 PROC_TYPED_CHILDREN(ManageNameIDService,SAMLConstants::SAML20MD_NS,false);
1159 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1160 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1164 class SAML_DLLLOCAL IDPSSODescriptorImpl : public virtual IDPSSODescriptor, public SSODescriptorTypeImpl
1166 list<XMLObject*>::iterator m_pos_SingleSignOnService;
1167 list<XMLObject*>::iterator m_pos_NameIDMappingService;
1168 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1169 list<XMLObject*>::iterator m_pos_AttributeProfile;
1172 m_WantAuthnRequestsSigned=false;
1173 m_children.push_back(NULL);
1174 m_children.push_back(NULL);
1175 m_children.push_back(NULL);
1176 m_children.push_back(NULL);
1177 m_pos_SingleSignOnService=m_pos_NameIDFormat;
1178 ++m_pos_SingleSignOnService;
1179 m_pos_NameIDMappingService=m_pos_SingleSignOnService;
1180 ++m_pos_NameIDMappingService;
1181 m_pos_AssertionIDRequestService=m_pos_NameIDMappingService;
1182 ++m_pos_AssertionIDRequestService;
1183 m_pos_AttributeProfile=m_pos_AssertionIDRequestService;
1184 ++m_pos_AttributeProfile;
1188 virtual ~IDPSSODescriptorImpl() {}
1190 IDPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1191 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1195 IDPSSODescriptorImpl(const IDPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1197 WantAuthnRequestsSigned(src.WantAuthnRequestsSigned());
1198 VectorOf(SingleSignOnService) v=getSingleSignOnServices();
1199 for (vector<SingleSignOnService*>::const_iterator i=src.m_SingleSignOnServices.begin(); i!=src.m_SingleSignOnServices.end(); i++) {
1201 v.push_back((*i)->cloneSingleSignOnService());
1204 VectorOf(NameIDMappingService) w=getNameIDMappingServices();
1205 for (vector<NameIDMappingService*>::const_iterator j=src.m_NameIDMappingServices.begin(); j!=src.m_NameIDMappingServices.end(); j++) {
1207 w.push_back((*j)->cloneNameIDMappingService());
1210 VectorOf(AssertionIDRequestService) x=getAssertionIDRequestServices();
1211 for (vector<AssertionIDRequestService*>::const_iterator k=src.m_AssertionIDRequestServices.begin(); k!=src.m_AssertionIDRequestServices.end(); k++) {
1213 x.push_back((*k)->cloneAssertionIDRequestService());
1216 VectorOf(AttributeProfile) y=getAttributeProfiles();
1217 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1219 y.push_back((*m)->cloneAttributeProfile());
1222 VectorOf(Attribute) z=getAttributes();
1223 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1225 z.push_back((*n)->cloneAttribute());
1230 IMPL_XMLOBJECT_CLONE(IDPSSODescriptor);
1231 SSODescriptorType* cloneSSODescriptorType() const {
1232 return new IDPSSODescriptorImpl(*this);
1234 RoleDescriptor* cloneRoleDescriptor() const {
1235 return new IDPSSODescriptorImpl(*this);
1238 IMPL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned);
1239 IMPL_TYPED_CHILDREN(SingleSignOnService,m_pos_SingleSignOnService);
1240 IMPL_TYPED_CHILDREN(NameIDMappingService,m_pos_NameIDMappingService);
1241 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1242 IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1243 IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1245 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1246 if (!qualifiedName.hasNamespaceURI()) {
1247 if (XMLString::equals(qualifiedName.getLocalPart(),WANTAUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1249 if (*value==chLatin_t || *value==chDigit_1)
1250 WantAuthnRequestsSigned(true);
1251 else if (*value==chLatin_f || *value==chDigit_0)
1252 WantAuthnRequestsSigned(false);
1257 RoleDescriptorImpl::setAttribute(qualifiedName, value);
1261 void marshallAttributes(DOMElement* domElement) const {
1262 MARSHALL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned,WANTAUTHNREQUESTSSIGNED,NULL);
1263 RoleDescriptorImpl::marshallAttributes(domElement);
1266 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1267 PROC_TYPED_CHILDREN(SingleSignOnService,SAMLConstants::SAML20MD_NS,false);
1268 PROC_TYPED_CHILDREN(NameIDMappingService,SAMLConstants::SAML20MD_NS,false);
1269 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1270 PROC_TYPED_CHILDREN(AttributeProfile,SAMLConstants::SAML20MD_NS,false);
1271 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
1272 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1276 class SAML_DLLLOCAL RequestedAttributeImpl : public virtual RequestedAttribute,
1277 public AbstractComplexElement,
1278 public AbstractAttributeExtensibleXMLObject,
1279 public AbstractDOMCachingXMLObject,
1280 public AbstractValidatingXMLObject,
1281 public AbstractXMLObjectMarshaller,
1282 public AbstractXMLObjectUnmarshaller
1285 m_Name=m_NameFormat=m_FriendlyName=NULL;
1289 virtual ~RequestedAttributeImpl() {
1290 XMLString::release(&m_Name);
1291 XMLString::release(&m_NameFormat);
1292 XMLString::release(&m_FriendlyName);
1295 RequestedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1296 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1300 RequestedAttributeImpl(const RequestedAttributeImpl& src)
1301 : AbstractXMLObject(src),
1302 AbstractAttributeExtensibleXMLObject(src),
1303 AbstractDOMCachingXMLObject(src),
1304 AbstractValidatingXMLObject(src) {
1306 setName(src.getName());
1307 setNameFormat(src.getNameFormat());
1308 setFriendlyName(src.getFriendlyName());
1309 isRequired(src.isRequired());
1310 VectorOf(XMLObject) v=getAttributeValues();
1311 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1313 v.push_back((*i)->clone());
1318 IMPL_XMLOBJECT_CLONE(RequestedAttribute);
1319 Attribute* cloneAttribute() const {
1320 return new RequestedAttributeImpl(*this);
1323 IMPL_STRING_ATTRIB(Name);
1324 IMPL_STRING_ATTRIB(NameFormat);
1325 IMPL_STRING_ATTRIB(FriendlyName);
1326 IMPL_BOOLEAN_ATTRIB(isRequired);
1327 IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1329 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1330 if (!qualifiedName.hasNamespaceURI()) {
1331 if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1335 else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1336 setNameFormat(value);
1339 else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1340 setFriendlyName(value);
1343 else if (XMLString::equals(qualifiedName.getLocalPart(),ISREQUIRED_ATTRIB_NAME)) {
1345 if (*value==chLatin_t || *value==chDigit_1)
1347 else if (*value==chLatin_f || *value==chDigit_0)
1353 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
1357 void marshallAttributes(DOMElement* domElement) const {
1358 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1359 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1360 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1361 MARSHALL_BOOLEAN_ATTRIB(isRequired,ISREQUIRED,NULL);
1363 // Take care of wildcard.
1364 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
1365 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
1366 if (i->first.hasPrefix())
1367 attr->setPrefix(i->first.getPrefix());
1368 attr->setNodeValue(i->second);
1369 domElement->setAttributeNode(attr);
1373 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1374 getAttributeValues().push_back(childXMLObject);
1377 void processAttribute(const DOMAttr* attribute) {
1378 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
1379 setAttribute(q,attribute->getNodeValue());
1383 class SAML_DLLLOCAL AttributeConsumingServiceImpl : public virtual AttributeConsumingService,
1384 public AbstractComplexElement,
1385 public AbstractDOMCachingXMLObject,
1386 public AbstractValidatingXMLObject,
1387 public AbstractXMLObjectMarshaller,
1388 public AbstractXMLObjectUnmarshaller
1390 list<XMLObject*>::iterator m_pos_ServiceDescription;
1391 list<XMLObject*>::iterator m_pos_RequestedAttribute;
1396 m_children.push_back(NULL);
1397 m_children.push_back(NULL);
1398 m_pos_ServiceDescription=m_children.begin();
1399 m_pos_RequestedAttribute=m_pos_ServiceDescription;
1400 ++m_pos_RequestedAttribute;
1404 virtual ~AttributeConsumingServiceImpl() {}
1406 AttributeConsumingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1407 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1411 AttributeConsumingServiceImpl(const AttributeConsumingServiceImpl& src)
1412 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
1414 setIndex(src.getIndex());
1415 isDefault(src.isDefault());
1416 VectorOf(ServiceName) v=getServiceNames();
1417 for (vector<ServiceName*>::const_iterator i=src.m_ServiceNames.begin(); i!=src.m_ServiceNames.end(); i++) {
1419 v.push_back((*i)->cloneServiceName());
1422 VectorOf(ServiceDescription) w=getServiceDescriptions();
1423 for (vector<ServiceDescription*>::const_iterator j=src.m_ServiceDescriptions.begin(); j!=src.m_ServiceDescriptions.end(); j++) {
1425 w.push_back((*j)->cloneServiceDescription());
1428 VectorOf(RequestedAttribute) x=getRequestedAttributes();
1429 for (vector<RequestedAttribute*>::const_iterator k=src.m_RequestedAttributes.begin(); k!=src.m_RequestedAttributes.end(); k++) {
1431 x.push_back((*k)->cloneRequestedAttribute());
1436 IMPL_XMLOBJECT_CLONE(AttributeConsumingService);
1437 IMPL_INTEGER_ATTRIB(Index);
1438 IMPL_BOOLEAN_ATTRIB(isDefault);
1439 IMPL_TYPED_CHILDREN(ServiceName,m_pos_ServiceDescription);
1440 IMPL_TYPED_CHILDREN(ServiceDescription,m_pos_RequestedAttribute);
1441 IMPL_TYPED_CHILDREN(RequestedAttribute,m_children.end());
1444 void marshallAttributes(DOMElement* domElement) const {
1445 MARSHALL_INTEGER_ATTRIB(Index,INDEX,NULL);
1446 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
1449 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1450 PROC_TYPED_CHILDREN(ServiceName,SAMLConstants::SAML20MD_NS,false);
1451 PROC_TYPED_CHILDREN(ServiceDescription,SAMLConstants::SAML20MD_NS,false);
1452 PROC_TYPED_CHILDREN(RequestedAttribute,SAMLConstants::SAML20MD_NS,false);
1453 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1456 void processAttribute(const DOMAttr* attribute) {
1457 PROC_INTEGER_ATTRIB(Index,INDEX,NULL);
1458 PROC_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
1459 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1463 class SAML_DLLLOCAL SPSSODescriptorImpl : public virtual SPSSODescriptor, public SSODescriptorTypeImpl
1465 list<XMLObject*>::iterator m_pos_AssertionConsumerService;
1468 m_AuthnRequestsSigned=false;
1469 m_WantAssertionsSigned=false;
1470 m_children.push_back(NULL);
1471 m_pos_AssertionConsumerService=m_pos_NameIDFormat;
1472 ++m_pos_AssertionConsumerService;
1476 virtual ~SPSSODescriptorImpl() {}
1478 SPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1479 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1483 SPSSODescriptorImpl(const SPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1485 AuthnRequestsSigned(src.AuthnRequestsSigned());
1486 WantAssertionsSigned(src.WantAssertionsSigned());
1487 VectorOf(AssertionConsumerService) v=getAssertionConsumerServices();
1488 for (vector<AssertionConsumerService*>::const_iterator i=src.m_AssertionConsumerServices.begin(); i!=src.m_AssertionConsumerServices.end(); i++) {
1490 v.push_back((*i)->cloneAssertionConsumerService());
1493 VectorOf(AttributeConsumingService) w=getAttributeConsumingServices();
1494 for (vector<AttributeConsumingService*>::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) {
1496 w.push_back((*j)->cloneAttributeConsumingService());
1501 IMPL_XMLOBJECT_CLONE(SPSSODescriptor);
1502 SSODescriptorType* cloneSSODescriptorType() const {
1503 return cloneSPSSODescriptor();
1505 RoleDescriptor* cloneRoleDescriptor() const {
1506 return cloneSPSSODescriptor();
1509 IMPL_BOOLEAN_ATTRIB(AuthnRequestsSigned);
1510 IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned);
1511 IMPL_TYPED_CHILDREN(AssertionConsumerService,m_pos_AssertionConsumerService);
1512 IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end());
1514 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1515 if (!qualifiedName.hasNamespaceURI()) {
1516 if (XMLString::equals(qualifiedName.getLocalPart(),AUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1518 if (*value==chLatin_t || *value==chDigit_1)
1519 AuthnRequestsSigned(true);
1520 else if (*value==chLatin_f || *value==chDigit_0)
1521 AuthnRequestsSigned(false);
1525 else if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) {
1527 if (*value==chLatin_t || *value==chDigit_1)
1528 WantAssertionsSigned(true);
1529 else if (*value==chLatin_f || *value==chDigit_0)
1530 WantAssertionsSigned(false);
1535 RoleDescriptorImpl::setAttribute(qualifiedName, value);
1539 void marshallAttributes(DOMElement* domElement) const {
1540 MARSHALL_BOOLEAN_ATTRIB(AuthnRequestsSigned,AUTHNREQUESTSSIGNED,NULL);
1541 MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,NULL);
1542 RoleDescriptorImpl::marshallAttributes(domElement);
1545 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1546 PROC_TYPED_CHILDREN(AssertionConsumerService,SAMLConstants::SAML20MD_NS,false);
1547 PROC_TYPED_CHILDREN(AttributeConsumingService,SAMLConstants::SAML20MD_NS,false);
1548 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1552 class SAML_DLLLOCAL AuthnAuthorityDescriptorImpl : public virtual AuthnAuthorityDescriptor, public RoleDescriptorImpl
1554 list<XMLObject*>::iterator m_pos_AuthnQueryService;
1555 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1558 m_children.push_back(NULL);
1559 m_children.push_back(NULL);
1560 m_pos_AuthnQueryService=m_pos_ContactPerson;
1561 ++m_pos_AuthnQueryService;
1562 m_pos_AssertionIDRequestService=m_pos_AuthnQueryService;
1563 ++m_pos_AssertionIDRequestService;
1567 virtual ~AuthnAuthorityDescriptorImpl() {}
1569 AuthnAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1570 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1574 AuthnAuthorityDescriptorImpl(const AuthnAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1576 VectorOf(AuthnQueryService) v=getAuthnQueryServices();
1577 for (vector<AuthnQueryService*>::const_iterator i=src.m_AuthnQueryServices.begin(); i!=src.m_AuthnQueryServices.end(); i++) {
1579 v.push_back((*i)->cloneAuthnQueryService());
1582 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1583 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1585 w.push_back((*j)->cloneAssertionIDRequestService());
1588 VectorOf(NameIDFormat) x=getNameIDFormats();
1589 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1591 x.push_back((*k)->cloneNameIDFormat());
1596 IMPL_XMLOBJECT_CLONE(AuthnAuthorityDescriptor);
1597 RoleDescriptor* cloneRoleDescriptor() const {
1598 return cloneAuthnAuthorityDescriptor();
1601 IMPL_TYPED_CHILDREN(AuthnQueryService,m_pos_AuthnQueryService);
1602 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1603 IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1606 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1607 PROC_TYPED_CHILDREN(AuthnQueryService,SAMLConstants::SAML20MD_NS,false);
1608 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1609 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1610 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1614 class SAML_DLLLOCAL PDPDescriptorImpl : public virtual PDPDescriptor, public RoleDescriptorImpl
1616 list<XMLObject*>::iterator m_pos_AuthzService;
1617 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1620 m_children.push_back(NULL);
1621 m_children.push_back(NULL);
1622 m_pos_AuthzService=m_pos_ContactPerson;
1623 ++m_pos_AuthzService;
1624 m_pos_AssertionIDRequestService=m_pos_AuthzService;
1625 ++m_pos_AssertionIDRequestService;
1629 virtual ~PDPDescriptorImpl() {}
1631 PDPDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1632 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1636 PDPDescriptorImpl(const PDPDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1638 VectorOf(AuthzService) v=getAuthzServices();
1639 for (vector<AuthzService*>::const_iterator i=src.m_AuthzServices.begin(); i!=src.m_AuthzServices.end(); i++) {
1641 v.push_back((*i)->cloneAuthzService());
1644 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1645 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1647 w.push_back((*j)->cloneAssertionIDRequestService());
1650 VectorOf(NameIDFormat) x=getNameIDFormats();
1651 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1653 x.push_back((*k)->cloneNameIDFormat());
1658 IMPL_XMLOBJECT_CLONE(PDPDescriptor);
1659 RoleDescriptor* cloneRoleDescriptor() const {
1660 return clonePDPDescriptor();
1663 IMPL_TYPED_CHILDREN(AuthzService,m_pos_AuthzService);
1664 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1665 IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1668 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1669 PROC_TYPED_CHILDREN(AuthzService,SAMLConstants::SAML20MD_NS,false);
1670 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1671 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1672 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1676 class SAML_DLLLOCAL AttributeAuthorityDescriptorImpl : public virtual AttributeAuthorityDescriptor, public RoleDescriptorImpl
1678 list<XMLObject*>::iterator m_pos_AttributeService;
1679 list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1680 list<XMLObject*>::iterator m_pos_NameIDFormat;
1681 list<XMLObject*>::iterator m_pos_AttributeProfile;
1684 m_children.push_back(NULL);
1685 m_children.push_back(NULL);
1686 m_children.push_back(NULL);
1687 m_children.push_back(NULL);
1688 m_pos_AttributeService=m_pos_ContactPerson;
1689 ++m_pos_AttributeService;
1690 m_pos_AssertionIDRequestService=m_pos_AttributeService;
1691 ++m_pos_AssertionIDRequestService;
1692 m_pos_NameIDFormat=m_pos_AssertionIDRequestService;
1693 ++m_pos_NameIDFormat;
1694 m_pos_AttributeProfile=m_pos_NameIDFormat;
1695 ++m_pos_AttributeProfile;
1699 virtual ~AttributeAuthorityDescriptorImpl() {}
1701 AttributeAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1702 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1706 AttributeAuthorityDescriptorImpl(const AttributeAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1708 VectorOf(AttributeService) v=getAttributeServices();
1709 for (vector<AttributeService*>::const_iterator i=src.m_AttributeServices.begin(); i!=src.m_AttributeServices.end(); i++) {
1711 v.push_back((*i)->cloneAttributeService());
1714 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1715 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1717 w.push_back((*j)->cloneAssertionIDRequestService());
1720 VectorOf(NameIDFormat) x=getNameIDFormats();
1721 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1723 x.push_back((*k)->cloneNameIDFormat());
1726 VectorOf(AttributeProfile) y=getAttributeProfiles();
1727 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1729 y.push_back((*m)->cloneAttributeProfile());
1732 VectorOf(Attribute) z=getAttributes();
1733 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1735 z.push_back((*n)->cloneAttribute());
1740 IMPL_XMLOBJECT_CLONE(AttributeAuthorityDescriptor);
1741 RoleDescriptor* cloneRoleDescriptor() const {
1742 return cloneAttributeAuthorityDescriptor();
1745 IMPL_TYPED_CHILDREN(AttributeService,m_pos_AttributeService);
1746 IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1747 IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1748 IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1749 IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1752 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1753 PROC_TYPED_CHILDREN(AttributeService,SAMLConstants::SAML20MD_NS,false);
1754 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAMLConstants::SAML20MD_NS,false);
1755 PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false);
1756 PROC_TYPED_CHILDREN(AttributeProfile,SAMLConstants::SAML20MD_NS,false);
1757 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
1758 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1762 class SAML_DLLLOCAL AffiliationDescriptorImpl : public virtual AffiliationDescriptor,
1763 public virtual SignableObject,
1764 public AbstractComplexElement,
1765 public AbstractAttributeExtensibleXMLObject,
1766 public AbstractDOMCachingXMLObject,
1767 public AbstractValidatingXMLObject,
1768 public AbstractXMLObjectMarshaller,
1769 public AbstractXMLObjectUnmarshaller
1771 list<XMLObject*>::iterator m_pos_AffiliateMember;
1774 m_ID=m_AffiliationOwnerID=NULL;
1775 m_ValidUntil=m_CacheDuration=NULL;
1776 m_children.push_back(NULL);
1777 m_children.push_back(NULL);
1778 m_children.push_back(NULL);
1781 m_pos_Signature=m_children.begin();
1782 m_pos_Extensions=m_pos_Signature;
1784 m_pos_AffiliateMember=m_pos_Extensions;
1785 ++m_pos_AffiliateMember;
1789 virtual ~AffiliationDescriptorImpl() {
1790 XMLString::release(&m_ID);
1791 XMLString::release(&m_AffiliationOwnerID);
1792 delete m_ValidUntil;
1793 delete m_CacheDuration;
1796 AffiliationDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1797 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1801 AffiliationDescriptorImpl(const AffiliationDescriptorImpl& src)
1802 : AbstractXMLObject(src),
1803 AbstractAttributeExtensibleXMLObject(src),
1804 AbstractDOMCachingXMLObject(src),
1805 AbstractValidatingXMLObject(src) {
1808 setAffiliationOwnerID(src.getAffiliationOwnerID());
1809 setValidUntil(src.getValidUntil());
1810 setCacheDuration(src.getCacheDuration());
1811 if (src.getSignature())
1812 setSignature(src.getSignature()->cloneSignature());
1813 if (src.getExtensions())
1814 setExtensions(src.getExtensions()->cloneExtensions());
1816 VectorOf(KeyDescriptor) v=getKeyDescriptors();
1817 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
1819 v.push_back((*i)->cloneKeyDescriptor());
1822 VectorOf(AffiliateMember) w=getAffiliateMembers();
1823 for (vector<AffiliateMember*>::const_iterator j=src.m_AffiliateMembers.begin(); j!=src.m_AffiliateMembers.end(); j++) {
1825 w.push_back((*j)->cloneAffiliateMember());
1830 IMPL_XMLOBJECT_CLONE(AffiliationDescriptor);
1832 const XMLCh* getId() const {
1836 //IMPL_TYPED_CHILD(Signature);
1837 // Need customized setter.
1839 Signature* m_Signature;
1840 list<XMLObject*>::iterator m_pos_Signature;
1842 Signature* getSignature() const {
1846 void setSignature(Signature* sig) {
1847 prepareForAssignment(m_Signature,sig);
1848 *m_pos_Signature=m_Signature=sig;
1849 // Sync content reference back up.
1851 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1854 IMPL_STRING_ATTRIB(ID);
1855 IMPL_STRING_ATTRIB(AffiliationOwnerID);
1856 IMPL_DATETIME_ATTRIB(ValidUntil);
1857 IMPL_DATETIME_ATTRIB(CacheDuration);
1858 IMPL_TYPED_CHILD(Extensions);
1859 IMPL_TYPED_CHILDREN(AffiliateMember,m_pos_AffiliateMember);
1860 IMPL_TYPED_CHILDREN(KeyDescriptor,m_children.end());
1862 void setAttribute(QName& qualifiedName, const XMLCh* value) {
1863 if (!qualifiedName.hasNamespaceURI()) {
1864 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
1868 else if (XMLString::equals(qualifiedName.getLocalPart(),AFFILIATIONOWNERID_ATTRIB_NAME)) {
1869 setAffiliationOwnerID(value);
1872 else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
1873 setValidUntil(value);
1876 else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
1877 setCacheDuration(value);
1881 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
1885 void marshallAttributes(DOMElement* domElement) const {
1886 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1887 MARSHALL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID,NULL);
1888 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
1889 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
1891 // Take care of wildcard.
1892 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
1893 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
1894 if (i->first.hasPrefix())
1895 attr->setPrefix(i->first.getPrefix());
1896 attr->setNodeValue(i->second);
1897 domElement->setAttributeNode(attr);
1901 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1902 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
1903 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
1904 PROC_TYPED_CHILDREN(AffiliateMember,SAMLConstants::SAML20MD_NS,false);
1905 PROC_TYPED_CHILDREN(KeyDescriptor,SAMLConstants::SAML20MD_NS,false);
1906 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1909 void processAttribute(const DOMAttr* attribute) {
1910 PROC_ID_ATTRIB(ID,ID,NULL);
1911 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
1912 setAttribute(q,attribute->getNodeValue());
1916 class SAML_DLLLOCAL EntityDescriptorImpl : public virtual EntityDescriptor,
1917 public virtual SignableObject,
1918 public AbstractComplexElement,
1919 public AbstractAttributeExtensibleXMLObject,
1920 public AbstractDOMCachingXMLObject,
1921 public AbstractValidatingXMLObject,
1922 public AbstractXMLObjectMarshaller,
1923 public AbstractXMLObjectUnmarshaller
1925 list<XMLObject*>::iterator m_pos_ContactPerson;
1928 m_ID=m_EntityID=NULL;
1929 m_ValidUntil=m_CacheDuration=NULL;
1930 m_children.push_back(NULL);
1931 m_children.push_back(NULL);
1932 m_children.push_back(NULL);
1933 m_children.push_back(NULL);
1934 m_children.push_back(NULL);
1937 m_AffiliationDescriptor=NULL;
1938 m_Organization=NULL;
1939 m_pos_Signature=m_children.begin();
1940 m_pos_Extensions=m_pos_Signature;
1942 m_pos_AffiliationDescriptor=m_pos_Extensions;
1943 ++m_pos_AffiliationDescriptor;
1944 m_pos_Organization=m_pos_AffiliationDescriptor;
1945 ++m_pos_Organization;
1946 m_pos_ContactPerson=m_pos_Organization;
1947 ++m_pos_ContactPerson;
1951 virtual ~EntityDescriptorImpl() {
1952 XMLString::release(&m_ID);
1953 XMLString::release(&m_EntityID);
1954 delete m_ValidUntil;
1955 delete m_CacheDuration;
1958 EntityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1959 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1963 EntityDescriptorImpl(const EntityDescriptorImpl& src)
1964 : AbstractXMLObject(src),
1965 AbstractAttributeExtensibleXMLObject(src),
1966 AbstractDOMCachingXMLObject(src),
1967 AbstractValidatingXMLObject(src) {
1970 setEntityID(src.getEntityID());
1971 setValidUntil(src.getValidUntil());
1972 setCacheDuration(src.getCacheDuration());
1973 if (src.getSignature())
1974 setSignature(src.getSignature()->cloneSignature());
1975 if (src.getExtensions())
1976 setExtensions(src.getExtensions()->cloneExtensions());
1977 if (src.getAffiliationDescriptor())
1978 setAffiliationDescriptor(src.getAffiliationDescriptor()->cloneAffiliationDescriptor());
1979 if (src.getOrganization())
1980 setOrganization(src.getOrganization()->cloneOrganization());
1982 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1984 IDPSSODescriptor* idp=dynamic_cast<IDPSSODescriptor*>(*i);
1986 getIDPSSODescriptors().push_back(idp->cloneIDPSSODescriptor());
1990 SPSSODescriptor* sp=dynamic_cast<SPSSODescriptor*>(*i);
1992 getSPSSODescriptors().push_back(sp->cloneSPSSODescriptor());
1996 AuthnAuthorityDescriptor* authn=dynamic_cast<AuthnAuthorityDescriptor*>(*i);
1998 getAuthnAuthorityDescriptors().push_back(authn->cloneAuthnAuthorityDescriptor());
2002 AttributeAuthorityDescriptor* attr=dynamic_cast<AttributeAuthorityDescriptor*>(*i);
2004 getAttributeAuthorityDescriptors().push_back(attr->cloneAttributeAuthorityDescriptor());
2008 PDPDescriptor* pdp=dynamic_cast<PDPDescriptor*>(*i);
2010 getPDPDescriptors().push_back(pdp->clonePDPDescriptor());
2014 RoleDescriptor* role=dynamic_cast<RoleDescriptor*>(*i);
2016 getRoleDescriptors().push_back(role->cloneRoleDescriptor());
2022 VectorOf(ContactPerson) v=getContactPersons();
2023 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
2025 v.push_back((*j)->cloneContactPerson());
2028 VectorOf(AdditionalMetadataLocation) w=getAdditionalMetadataLocations();
2029 for (vector<AdditionalMetadataLocation*>::const_iterator k=src.m_AdditionalMetadataLocations.begin(); k!=src.m_AdditionalMetadataLocations.end(); k++) {
2031 w.push_back((*k)->cloneAdditionalMetadataLocation());
2036 IMPL_XMLOBJECT_CLONE(EntityDescriptor);
2038 const XMLCh* getId() const {
2042 //IMPL_TYPED_CHILD(Signature);
2043 // Need customized setter.
2045 Signature* m_Signature;
2046 list<XMLObject*>::iterator m_pos_Signature;
2048 Signature* getSignature() const {
2052 void setSignature(Signature* sig) {
2053 prepareForAssignment(m_Signature,sig);
2054 *m_pos_Signature=m_Signature=sig;
2055 // Sync content reference back up.
2057 m_Signature->setContentReference(new opensaml::ContentReference(*this));
2060 IMPL_STRING_ATTRIB(ID);
2061 IMPL_STRING_ATTRIB(EntityID);
2062 IMPL_DATETIME_ATTRIB(ValidUntil);
2063 IMPL_DATETIME_ATTRIB(CacheDuration);
2064 IMPL_TYPED_CHILD(Extensions);
2065 IMPL_TYPED_CHILDREN(RoleDescriptor,m_pos_AffiliationDescriptor);
2066 IMPL_TYPED_CHILDREN(IDPSSODescriptor,m_pos_AffiliationDescriptor);
2067 IMPL_TYPED_CHILDREN(SPSSODescriptor,m_pos_AffiliationDescriptor);
2068 IMPL_TYPED_CHILDREN(AuthnAuthorityDescriptor,m_pos_AffiliationDescriptor);
2069 IMPL_TYPED_CHILDREN(AttributeAuthorityDescriptor,m_pos_AffiliationDescriptor);
2070 IMPL_TYPED_CHILDREN(PDPDescriptor,m_pos_AffiliationDescriptor);
2071 IMPL_TYPED_CHILD(AffiliationDescriptor);
2072 IMPL_TYPED_CHILD(Organization);
2073 IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
2074 IMPL_TYPED_CHILDREN(AdditionalMetadataLocation,m_children.end());
2076 void setAttribute(QName& qualifiedName, const XMLCh* value) {
2077 if (!qualifiedName.hasNamespaceURI()) {
2078 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
2082 else if (XMLString::equals(qualifiedName.getLocalPart(),ENTITYID_ATTRIB_NAME)) {
2086 else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
2087 setValidUntil(value);
2090 else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
2091 setCacheDuration(value);
2095 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
2099 void marshallAttributes(DOMElement* domElement) const {
2100 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2101 MARSHALL_STRING_ATTRIB(EntityID,ENTITYID,NULL);
2102 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2103 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2105 // Take care of wildcard.
2106 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
2107 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
2108 if (i->first.hasPrefix())
2109 attr->setPrefix(i->first.getPrefix());
2110 attr->setNodeValue(i->second);
2111 domElement->setAttributeNode(attr);
2115 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2116 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
2117 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
2118 PROC_TYPED_CHILDREN(RoleDescriptor,SAMLConstants::SAML20MD_NS,false);
2119 PROC_TYPED_CHILDREN(IDPSSODescriptor,SAMLConstants::SAML20MD_NS,false);
2120 PROC_TYPED_CHILDREN(SPSSODescriptor,SAMLConstants::SAML20MD_NS,false);
2121 PROC_TYPED_CHILDREN(AuthnAuthorityDescriptor,SAMLConstants::SAML20MD_NS,false);
2122 PROC_TYPED_CHILDREN(AttributeAuthorityDescriptor,SAMLConstants::SAML20MD_NS,false);
2123 PROC_TYPED_CHILDREN(PDPDescriptor,SAMLConstants::SAML20MD_NS,false);
2124 PROC_TYPED_CHILD(AffiliationDescriptor,SAMLConstants::SAML20MD_NS,false);
2125 PROC_TYPED_CHILD(Organization,SAMLConstants::SAML20MD_NS,false);
2126 PROC_TYPED_CHILDREN(ContactPerson,SAMLConstants::SAML20MD_NS,false);
2127 PROC_TYPED_CHILDREN(AdditionalMetadataLocation,SAMLConstants::SAML20MD_NS,false);
2128 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2131 void processAttribute(const DOMAttr* attribute) {
2132 PROC_ID_ATTRIB(ID,ID,NULL);
2133 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
2134 setAttribute(q,attribute->getNodeValue());
2138 class SAML_DLLLOCAL EntitiesDescriptorImpl : public virtual EntitiesDescriptor,
2139 public virtual SignableObject,
2140 public AbstractComplexElement,
2141 public AbstractDOMCachingXMLObject,
2142 public AbstractValidatingXMLObject,
2143 public AbstractXMLObjectMarshaller,
2144 public AbstractXMLObjectUnmarshaller
2148 m_ValidUntil=m_CacheDuration=NULL;
2149 m_children.push_back(NULL);
2150 m_children.push_back(NULL);
2153 m_pos_Signature=m_children.begin();
2154 m_pos_Extensions=m_pos_Signature;
2159 virtual ~EntitiesDescriptorImpl() {
2160 XMLString::release(&m_ID);
2161 XMLString::release(&m_Name);
2162 delete m_ValidUntil;
2163 delete m_CacheDuration;
2166 EntitiesDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
2167 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2171 EntitiesDescriptorImpl(const EntitiesDescriptorImpl& src)
2172 : AbstractXMLObject(src),
2173 AbstractDOMCachingXMLObject(src),
2174 AbstractValidatingXMLObject(src) {
2177 setName(src.getName());
2178 setValidUntil(src.getValidUntil());
2179 setCacheDuration(src.getCacheDuration());
2180 if (src.getSignature())
2181 setSignature(src.getSignature()->cloneSignature());
2182 if (src.getExtensions())
2183 setExtensions(src.getExtensions()->cloneExtensions());
2185 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2187 EntityDescriptor* e=dynamic_cast<EntityDescriptor*>(*i);
2189 getEntityDescriptors().push_back(e->cloneEntityDescriptor());
2193 EntitiesDescriptor* es=dynamic_cast<EntitiesDescriptor*>(*i);
2195 getEntitiesDescriptors().push_back(es->cloneEntitiesDescriptor());
2202 IMPL_XMLOBJECT_CLONE(EntitiesDescriptor);
2204 const XMLCh* getId() const {
2208 //IMPL_TYPED_CHILD(Signature);
2209 // Need customized setter.
2211 Signature* m_Signature;
2212 list<XMLObject*>::iterator m_pos_Signature;
2214 Signature* getSignature() const {
2218 void setSignature(Signature* sig) {
2219 prepareForAssignment(m_Signature,sig);
2220 *m_pos_Signature=m_Signature=sig;
2221 // Sync content reference back up.
2223 m_Signature->setContentReference(new opensaml::ContentReference(*this));
2226 IMPL_STRING_ATTRIB(ID);
2227 IMPL_STRING_ATTRIB(Name);
2228 IMPL_DATETIME_ATTRIB(ValidUntil);
2229 IMPL_DATETIME_ATTRIB(CacheDuration);
2230 IMPL_TYPED_CHILD(Extensions);
2231 IMPL_TYPED_CHILDREN(EntityDescriptor,m_children.end());
2232 IMPL_TYPED_CHILDREN(EntitiesDescriptor,m_children.end());
2235 void marshallAttributes(DOMElement* domElement) const {
2236 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2237 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
2238 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2239 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2242 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2243 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
2244 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false);
2245 PROC_TYPED_CHILDREN(EntityDescriptor,SAMLConstants::SAML20MD_NS,false);
2246 PROC_TYPED_CHILDREN(EntitiesDescriptor,SAMLConstants::SAML20MD_NS,false);
2247 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2250 void processAttribute(const DOMAttr* attribute) {
2251 PROC_ID_ATTRIB(ID,ID,NULL);
2252 PROC_STRING_ATTRIB(Name,NAME,NULL);
2253 PROC_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2254 PROC_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2261 #if defined (_MSC_VER)
2262 #pragma warning( pop )
2265 // Builder Implementations
2267 IMPL_XMLOBJECTBUILDER(AdditionalMetadataLocation);
2268 IMPL_XMLOBJECTBUILDER(AffiliateMember);
2269 IMPL_XMLOBJECTBUILDER(AffiliationDescriptor);
2270 IMPL_XMLOBJECTBUILDER(ArtifactResolutionService);
2271 IMPL_XMLOBJECTBUILDER(AssertionConsumerService);
2272 IMPL_XMLOBJECTBUILDER(AssertionIDRequestService);
2273 IMPL_XMLOBJECTBUILDER(AttributeAuthorityDescriptor);
2274 IMPL_XMLOBJECTBUILDER(AttributeConsumingService);
2275 IMPL_XMLOBJECTBUILDER(AttributeProfile);
2276 IMPL_XMLOBJECTBUILDER(AttributeService);
2277 IMPL_XMLOBJECTBUILDER(AuthnAuthorityDescriptor);
2278 IMPL_XMLOBJECTBUILDER(AuthnQueryService);
2279 IMPL_XMLOBJECTBUILDER(AuthzService);
2280 IMPL_XMLOBJECTBUILDER(Company);
2281 IMPL_XMLOBJECTBUILDER(ContactPerson);
2282 IMPL_XMLOBJECTBUILDER(EmailAddress);
2283 IMPL_XMLOBJECTBUILDER(EndpointType);
2284 IMPL_XMLOBJECTBUILDER(EntitiesDescriptor);
2285 IMPL_XMLOBJECTBUILDER(EntityDescriptor);
2286 IMPL_XMLOBJECTBUILDER(Extensions);
2287 IMPL_XMLOBJECTBUILDER(GivenName);
2288 IMPL_XMLOBJECTBUILDER(IDPSSODescriptor);
2289 IMPL_XMLOBJECTBUILDER(IndexedEndpointType);
2290 IMPL_XMLOBJECTBUILDER(KeyDescriptor);
2291 IMPL_XMLOBJECTBUILDER(localizedNameType);
2292 IMPL_XMLOBJECTBUILDER(localizedURIType);
2293 IMPL_XMLOBJECTBUILDER(ManageNameIDService);
2294 IMPL_XMLOBJECTBUILDER(NameIDFormat);
2295 IMPL_XMLOBJECTBUILDER(NameIDMappingService);
2296 IMPL_XMLOBJECTBUILDER(Organization);
2297 IMPL_XMLOBJECTBUILDER(OrganizationName);
2298 IMPL_XMLOBJECTBUILDER(OrganizationDisplayName);
2299 IMPL_XMLOBJECTBUILDER(OrganizationURL);
2300 IMPL_XMLOBJECTBUILDER(PDPDescriptor);
2301 IMPL_XMLOBJECTBUILDER(RequestedAttribute);
2302 IMPL_XMLOBJECTBUILDER(ServiceDescription);
2303 IMPL_XMLOBJECTBUILDER(ServiceName);
2304 IMPL_XMLOBJECTBUILDER(SingleLogoutService);
2305 IMPL_XMLOBJECTBUILDER(SingleSignOnService);
2306 IMPL_XMLOBJECTBUILDER(SPSSODescriptor);
2307 IMPL_XMLOBJECTBUILDER(SurName);
2308 IMPL_XMLOBJECTBUILDER(TelephoneNumber);
2310 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);
2311 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);
2312 const XMLCh AdditionalMetadataLocation::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(n,a,m,e,s,p,a,c,e);
2313 const XMLCh AffiliateMember::LOCAL_NAME[] = UNICODE_LITERAL_15(A,f,f,i,l,i,a,t,e,M,e,m,b,e,r);
2314 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);
2315 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);
2316 const XMLCh AffiliationDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2317 const XMLCh AffiliationDescriptor::VALIDUNTIL_ATTRIB_NAME[] = UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);
2318 const XMLCh AffiliationDescriptor::CACHEDURATION_ATTRIB_NAME[] = UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2319 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);
2320 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);
2321 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);
2322 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);
2323 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);
2324 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);
2325 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);
2326 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);
2327 const XMLCh AttributeConsumingService::INDEX_ATTRIB_NAME[] = UNICODE_LITERAL_5(i,n,d,e,x);
2328 const XMLCh AttributeConsumingService::ISDEFAULT_ATTRIB_NAME[] = UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2329 const XMLCh AttributeProfile::LOCAL_NAME[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,P,r,o,f,i,l,e);
2330 const XMLCh AttributeService::LOCAL_NAME[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,S,e,r,v,i,c,e);
2331 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);
2332 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);
2333 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);
2334 const XMLCh AuthzService::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,z,S,e,r,v,i,c,e);
2335 const XMLCh Company::LOCAL_NAME[] = UNICODE_LITERAL_7(C,o,m,p,a,n,y);
2336 const XMLCh ContactPerson::LOCAL_NAME[] = UNICODE_LITERAL_13(C,o,n,t,a,c,t,P,e,r,s,o,n);
2337 const XMLCh ContactPerson::TYPE_NAME[] = UNICODE_LITERAL_11(C,o,n,t,a,c,t,T,y,p,e);
2338 const XMLCh ContactPerson::CONTACTTYPE_ATTRIB_NAME[] = UNICODE_LITERAL_11(c,o,n,t,a,c,t,T,y,p,e);
2339 const XMLCh ContactPerson::CONTACT_TECHNICAL[] = UNICODE_LITERAL_9(t,e,c,h,n,i,c,a,l);
2340 const XMLCh ContactPerson::CONTACT_SUPPORT[] = UNICODE_LITERAL_7(s,u,p,p,o,r,t);
2341 const XMLCh ContactPerson::CONTACT_ADMINISTRATIVE[] = UNICODE_LITERAL_14(a,d,m,i,n,i,s,t,r,a,t,i,v,e);
2342 const XMLCh ContactPerson::CONTACT_BILLING[] = UNICODE_LITERAL_7(b,i,l,l,i,n,g);
2343 const XMLCh ContactPerson::CONTACT_OTHER[] = UNICODE_LITERAL_5(o,t,h,e,r);
2344 const XMLCh EmailAddress::LOCAL_NAME[] = UNICODE_LITERAL_12(E,m,a,i,l,A,d,d,r,e,s,s);
2345 const XMLCh EndpointType::LOCAL_NAME[] = {chNull};
2346 const XMLCh EndpointType::TYPE_NAME[] = UNICODE_LITERAL_12(E,n,d,p,o,i,n,t,T,y,p,e);
2347 const XMLCh EndpointType::BINDING_ATTRIB_NAME[] = UNICODE_LITERAL_7(B,i,n,d,i,n,g);
2348 const XMLCh EndpointType::LOCATION_ATTRIB_NAME[] = UNICODE_LITERAL_8(L,o,c,a,t,i,o,n);
2349 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);
2350 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);
2351 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);
2352 const XMLCh EntitiesDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2353 const XMLCh EntitiesDescriptor::VALIDUNTIL_ATTRIB_NAME[] = UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);
2354 const XMLCh EntitiesDescriptor::CACHEDURATION_ATTRIB_NAME[] = UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2355 const XMLCh EntitiesDescriptor::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
2356 const XMLCh EntityDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_16(E,n,t,i,t,y,D,e,s,c,r,i,p,t,o,r);
2357 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);
2358 const XMLCh EntityDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2359 const XMLCh EntityDescriptor::VALIDUNTIL_ATTRIB_NAME[] = UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);
2360 const XMLCh EntityDescriptor::CACHEDURATION_ATTRIB_NAME[] = UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2361 const XMLCh EntityDescriptor::ENTITYID_ATTRIB_NAME[] = UNICODE_LITERAL_8(e,n,t,i,t,y,I,D);
2362 const XMLCh Extensions::LOCAL_NAME[] = UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
2363 const XMLCh Extensions::TYPE_NAME[] = UNICODE_LITERAL_14(E,x,t,e,n,s,i,o,n,s,T,y,p,e);
2364 const XMLCh GivenName::LOCAL_NAME[] = UNICODE_LITERAL_9(G,i,v,e,n,N,a,m,e);
2365 const XMLCh IDPSSODescriptor::LOCAL_NAME[] = UNICODE_LITERAL_16(I,D,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2366 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);
2367 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);
2368 const XMLCh IndexedEndpointType::LOCAL_NAME[] = {chNull};
2369 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);
2370 const XMLCh IndexedEndpointType::INDEX_ATTRIB_NAME[] = UNICODE_LITERAL_5(i,n,d,e,x);
2371 const XMLCh IndexedEndpointType::ISDEFAULT_ATTRIB_NAME[] = UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2372 const XMLCh KeyDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_13(K,e,y,D,e,s,c,r,i,p,t,o,r);
2373 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);
2374 const XMLCh KeyDescriptor::USE_ATTRIB_NAME[] = UNICODE_LITERAL_3(u,s,e);
2375 const XMLCh KeyDescriptor::KEYTYPE_ENCRYPTION[] = UNICODE_LITERAL_10(e,n,c,r,y,p,t,i,o,n);
2376 const XMLCh KeyDescriptor::KEYTYPE_SIGNING[] = UNICODE_LITERAL_7(s,i,g,n,i,n,g);
2377 const XMLCh localizedNameType::LOCAL_NAME[] = {chNull};
2378 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);
2379 const XMLCh localizedNameType::LANG_ATTRIB_NAME[] = UNICODE_LITERAL_4(l,a,n,g);
2380 const XMLCh localizedURIType::LOCAL_NAME[] = {chNull};
2381 const XMLCh localizedURIType::TYPE_NAME[] = UNICODE_LITERAL_16(l,o,c,a,l,i,z,e,d,U,R,I,T,y,p,e);
2382 const XMLCh localizedURIType::LANG_ATTRIB_NAME[] = UNICODE_LITERAL_4(l,a,n,g);
2383 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);
2384 const XMLCh NameIDFormat::LOCAL_NAME[] = UNICODE_LITERAL_12(N,a,m,e,I,D,F,o,r,m,a,t);
2385 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);
2386 const XMLCh Organization::LOCAL_NAME[] = UNICODE_LITERAL_12(O,r,g,a,n,i,z,a,t,i,o,n);
2387 const XMLCh Organization::TYPE_NAME[] = UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,T,y,p,e);
2388 const XMLCh OrganizationName::LOCAL_NAME[] = UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,N,a,m,e);
2389 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);
2390 const XMLCh OrganizationURL::LOCAL_NAME[] = UNICODE_LITERAL_15(O,r,g,a,n,i,z,a,t,i,o,n,U,R,L);
2391 const XMLCh PDPDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_13(P,D,P,D,e,s,c,r,i,p,t,o,r);
2392 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);
2393 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);
2394 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);
2395 const XMLCh RequestedAttribute::ISREQUIRED_ATTRIB_NAME[] = UNICODE_LITERAL_10(i,s,R,e,q,u,i,r,e,d);
2396 const XMLCh RoleDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2397 const XMLCh RoleDescriptor::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
2398 const XMLCh RoleDescriptor::VALIDUNTIL_ATTRIB_NAME[] = UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);
2399 const XMLCh RoleDescriptor::CACHEDURATION_ATTRIB_NAME[] = UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2400 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);
2401 const XMLCh RoleDescriptor::ERRORURL_ATTRIB_NAME[] = UNICODE_LITERAL_8(e,r,r,o,r,U,R,L);
2402 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);
2403 const XMLCh ServiceName::LOCAL_NAME[] = UNICODE_LITERAL_11(S,e,r,v,i,c,e,N,a,m,e);
2404 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);
2405 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);
2406 const XMLCh SPSSODescriptor::LOCAL_NAME[] = UNICODE_LITERAL_15(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2407 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);
2408 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);
2409 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);
2410 const XMLCh SSODescriptorType::LOCAL_NAME[] = {chNull};
2411 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);
2412 const XMLCh SurName::LOCAL_NAME[] = UNICODE_LITERAL_7(S,u,r,N,a,m,e);
2413 const XMLCh TelephoneNumber::LOCAL_NAME[] = UNICODE_LITERAL_15(T,e,l,e,p,h,o,n,e,N,u,m,b,e,r);