X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml2%2Fmetadata%2FMetadata.h;h=ae28ce6dff72544d34fda328520c2b0f3ed4427c;hb=93b06f8b77047b399dc173d810d200864abdc4fc;hp=c8167a272d2a8c772f2472647d4a88fd03740fd2;hpb=5263186a620ca02913980ad2d35d4045844e7a05;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml2/metadata/Metadata.h b/saml/saml2/metadata/Metadata.h index c8167a2..ae28ce6 100644 --- a/saml/saml2/metadata/Metadata.h +++ b/saml/saml2/metadata/Metadata.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Internet2 + * Copyright 2001-2007 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,20 +24,11 @@ #define __saml2_metadata_h__ #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #define DECL_SAML2MDOBJECTBUILDER(cname) \ - DECL_XMLOBJECTBUILDER(SAML_API,cname,opensaml::SAMLConstants::SAML20MD_NS,opensaml::SAMLConstants::SAML20MD_PREFIX) + DECL_XMLOBJECTBUILDER(SAML_API,cname,samlconstants::SAML20MD_NS,samlconstants::SAML20MD_PREFIX) namespace opensaml { @@ -87,31 +78,31 @@ namespace opensaml { DECL_XMLOBJECT_SIMPLE(SAML_API,ActionNamespace,Namespace,SAML 2.0 Metadata Extension ActionNamespace element); DECL_XMLOBJECT_SIMPLE(SAML_API,SourceID,ID,SAML 1.x Metadata Profile SourceID element); - BEGIN_XMLOBJECT(SAML_API,localizedNameType,xmltooling::SimpleElement,SAML 2.0 localizedNameType type); + BEGIN_XMLOBJECT(SAML_API,localizedNameType,xmltooling::XMLObject,SAML 2.0 localizedNameType type); DECL_STRING_ATTRIB(Lang,LANG); /** localizedNameType local name */ static const XMLCh TYPE_NAME[]; END_XMLOBJECT; - BEGIN_XMLOBJECT(SAML_API,localizedURIType,xmltooling::SimpleElement,SAML 2.0 localizedURIType type); + BEGIN_XMLOBJECT(SAML_API,localizedURIType,xmltooling::XMLObject,SAML 2.0 localizedURIType type); DECL_STRING_ATTRIB(Lang,LANG); /** localizedURIType local name */ static const XMLCh TYPE_NAME[]; END_XMLOBJECT; BEGIN_XMLOBJECT(SAML_API,OrganizationName,localizedNameType,SAML 2.0 OrganizationName element); - DECL_XMLOBJECT_CONTENT(Name); + DECL_SIMPLE_CONTENT(Name); END_XMLOBJECT; BEGIN_XMLOBJECT(SAML_API,OrganizationDisplayName,localizedNameType,SAML 2.0 OrganizationDisplayName element); - DECL_XMLOBJECT_CONTENT(Name); + DECL_SIMPLE_CONTENT(Name); END_XMLOBJECT; BEGIN_XMLOBJECT(SAML_API,OrganizationURL,localizedURIType,SAML 2.0 OrganizationURL element); - DECL_XMLOBJECT_CONTENT(URL); + DECL_SIMPLE_CONTENT(URL); END_XMLOBJECT; - BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementProxy,SAML 2.0 Extensions element); + BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementExtensibleXMLObject,SAML 2.0 Extensions element); /** ExtensionsType local name */ static const XMLCh TYPE_NAME[]; END_XMLOBJECT; @@ -147,9 +138,9 @@ namespace opensaml { static const XMLCh CONTACT_OTHER[]; END_XMLOBJECT; - BEGIN_XMLOBJECT(SAML_API,AdditionalMetadataLocation,xmltooling::SimpleElement,SAML 2.0 AdditionalMetadataLocation element); + BEGIN_XMLOBJECT(SAML_API,AdditionalMetadataLocation,xmltooling::XMLObject,SAML 2.0 AdditionalMetadataLocation element); DECL_STRING_ATTRIB(Namespace,NAMESPACE); - DECL_XMLOBJECT_CONTENT(Location); + DECL_SIMPLE_CONTENT(Location); /** AdditionalMetadataLocationType local name */ static const XMLCh TYPE_NAME[]; END_XMLOBJECT; @@ -172,15 +163,16 @@ namespace opensaml { DECL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION); /** Searches the ProtocolSupportEnumeration attribute for the indicated protocol. */ virtual bool hasSupport(const XMLCh* protocol) const=0; + /** Adds the indicated protocol to the ProtocolSupportEnumeration attribute. */ + virtual void addSupport(const XMLCh* protocol)=0; DECL_STRING_ATTRIB(ErrorURL,ERRORURL); - DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature); DECL_TYPED_CHILD(Extensions); DECL_TYPED_CHILDREN(KeyDescriptor); DECL_TYPED_CHILD(Organization); DECL_TYPED_CHILDREN(ContactPerson); END_XMLOBJECT; - BEGIN_XMLOBJECT2(SAML_API,EndpointType,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 EndpointType type); + BEGIN_XMLOBJECT(SAML_API,EndpointType,xmltooling::ElementProxy,SAML 2.0 EndpointType type); DECL_STRING_ATTRIB(Binding,BINDING); DECL_STRING_ATTRIB(Location,LOCATION); DECL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION); @@ -234,11 +226,11 @@ namespace opensaml { END_XMLOBJECT; BEGIN_XMLOBJECT(SAML_API,ServiceName,localizedNameType,SAML 2.0 ServiceName element); - DECL_XMLOBJECT_CONTENT(Name); + DECL_SIMPLE_CONTENT(Name); END_XMLOBJECT; BEGIN_XMLOBJECT(SAML_API,ServiceDescription,localizedNameType,SAML 2.0 ServiceDescription element); - DECL_XMLOBJECT_CONTENT(Description); + DECL_SIMPLE_CONTENT(Description); END_XMLOBJECT; BEGIN_XMLOBJECT(SAML_API,RequestedAttribute,saml2::Attribute,SAML 2.0 RequestedAttribute element); @@ -332,7 +324,6 @@ namespace opensaml { CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 AffiliationDescriptor element); DECL_STRING_ATTRIB(ID,ID); DECL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID); - DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature); DECL_TYPED_CHILD(Extensions); DECL_TYPED_CHILDREN(AffiliateMember); DECL_TYPED_CHILDREN(KeyDescriptor); @@ -344,7 +335,6 @@ namespace opensaml { CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 EntityDescriptor element); DECL_STRING_ATTRIB(ID,ID); DECL_STRING_ATTRIB(EntityID,ENTITYID); - DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature); DECL_TYPED_CHILD(Extensions); DECL_TYPED_CHILD(AffiliationDescriptor); DECL_TYPED_CHILDREN(RoleDescriptor); @@ -356,6 +346,9 @@ namespace opensaml { DECL_TYPED_CHILDREN(AuthnQueryDescriptorType); DECL_TYPED_CHILDREN(AttributeQueryDescriptorType); DECL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType); + DECL_TYPED_CHILD(Organization); + DECL_TYPED_CHILDREN(ContactPerson); + DECL_TYPED_CHILDREN(AdditionalMetadataLocation); /** Finds an IDP role supporting a given protocol. */ virtual const IDPSSODescriptor* getIDPSSODescriptor(const XMLCh* protocol) const=0; /** Finds an SP role supporting a given protocol. */ @@ -382,7 +375,6 @@ namespace opensaml { TimeBoundSAMLObject,SAML 2.0 EntitiesDescriptor element); DECL_STRING_ATTRIB(ID,ID); DECL_STRING_ATTRIB(Name,NAME); - DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature); DECL_TYPED_CHILD(Extensions); DECL_TYPED_CHILDREN(EntityDescriptor); DECL_TYPED_CHILDREN(EntitiesDescriptor); @@ -429,8 +421,8 @@ namespace opensaml { DECL_SAML2MDOBJECTBUILDER(SurName); DECL_SAML2MDOBJECTBUILDER(TelephoneNumber); - DECL_XMLOBJECTBUILDER(SAML_API,ActionNamespace,opensaml::SAMLConstants::SAML20MD_QUERY_EXT_NS,opensaml::SAMLConstants::SAML20MD_QUERY_EXT_PREFIX); - DECL_XMLOBJECTBUILDER(SAML_API,SourceID,opensaml::SAMLConstants::SAML1MD_NS,opensaml::SAMLConstants::SAML1MD_PREFIX); + DECL_XMLOBJECTBUILDER(SAML_API,ActionNamespace,samlconstants::SAML20MD_QUERY_EXT_NS,samlconstants::SAML20MD_QUERY_EXT_PREFIX); + DECL_XMLOBJECTBUILDER(SAML_API,SourceID,samlconstants::SAML1MD_NS,samlconstants::SAML1MD_PREFIX); /** * Builder for localizedNameType objects. @@ -441,18 +433,26 @@ namespace opensaml { public: virtual ~localizedNameTypeBuilder() {} /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual localizedNameType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static localizedNameType* buildlocalizedNameType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) { const localizedNameTypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,localizedNameType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,localizedNameType::TYPE_NAME)) ); if (b) { - xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,localizedNameType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX); + xmltooling::QName schemaType(samlconstants::SAML20MD_NS,localizedNameType::TYPE_NAME,samlconstants::SAML20MD_PREFIX); +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(nsURI, localName, prefix, &schemaType); +#else + return dynamic_cast(b->buildObject(nsURI, localName, prefix, &schemaType)); +#endif } throw xmltooling::XMLObjectException("Unable to obtain typed builder for localizedNameType."); } @@ -467,18 +467,26 @@ namespace opensaml { public: virtual ~localizedURITypeBuilder() {} /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual localizedURIType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static localizedURIType* buildlocalizedURIType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) { const localizedURITypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,localizedURIType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,localizedURIType::TYPE_NAME)) ); if (b) { - xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,localizedURIType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX); + xmltooling::QName schemaType(samlconstants::SAML20MD_NS,localizedURIType::TYPE_NAME,samlconstants::SAML20MD_PREFIX); +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(nsURI, localName, prefix, &schemaType); +#else + return dynamic_cast(b->buildObject(nsURI, localName, prefix, &schemaType)); +#endif } throw xmltooling::XMLObjectException("Unable to obtain typed builder for localizedURIType."); } @@ -493,18 +501,26 @@ namespace opensaml { public: virtual ~EndpointTypeBuilder() {} /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual EndpointType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static EndpointType* buildEndpointType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) { const EndpointTypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,EndpointType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,EndpointType::TYPE_NAME)) ); if (b) { - xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,EndpointType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX); + xmltooling::QName schemaType(samlconstants::SAML20MD_NS,EndpointType::TYPE_NAME,samlconstants::SAML20MD_PREFIX); +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(nsURI, localName, prefix, &schemaType); +#else + return dynamic_cast(b->buildObject(nsURI, localName, prefix, &schemaType)); +#endif } throw xmltooling::XMLObjectException("Unable to obtain typed builder for EndpointType."); } @@ -519,18 +535,26 @@ namespace opensaml { public: virtual ~IndexedEndpointTypeBuilder() {} /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual IndexedEndpointType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static IndexedEndpointType* buildIndexedEndpointType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) { const IndexedEndpointTypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME)) ); if (b) { - xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX); + xmltooling::QName schemaType(samlconstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME,samlconstants::SAML20MD_PREFIX); +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(nsURI, localName, prefix, &schemaType); +#else + return dynamic_cast(b->buildObject(nsURI, localName, prefix, &schemaType)); +#endif } throw xmltooling::XMLObjectException("Unable to obtain typed builder for IndexedEndpointType."); } @@ -546,26 +570,39 @@ namespace opensaml { public: virtual ~AuthnQueryDescriptorTypeBuilder() {} /** Default builder. */ +#ifdef HAVE_COVARIANT_RETURNS virtual AuthnQueryDescriptorType* buildObject() const { +#else + virtual xmltooling::XMLObject* buildObject() const { +#endif xmltooling::QName schemaType( - SAMLConstants::SAML20_NS,AuthnQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX + samlconstants::SAML20_NS,AuthnQueryDescriptorType::TYPE_NAME,samlconstants::SAML20MD_QUERY_EXT_PREFIX ); return buildObject( - SAMLConstants::SAML20_NS,AuthnQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType + samlconstants::SAML20_NS,AuthnQueryDescriptorType::LOCAL_NAME,samlconstants::SAML20_PREFIX,&schemaType ); } /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual AuthnQueryDescriptorType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static AuthnQueryDescriptorType* buildAuthnQueryDescriptorType() { const AuthnQueryDescriptorTypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthnQueryDescriptorType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_QUERY_EXT_NS,AuthnQueryDescriptorType::TYPE_NAME)) ); - if (b) + if (b) { +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(); +#else + return dynamic_cast(b->buildObject()); +#endif + } throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthnQueryDescriptorType."); } }; @@ -580,26 +617,39 @@ namespace opensaml { public: virtual ~AttributeQueryDescriptorTypeBuilder() {} /** Default builder. */ +#ifdef HAVE_COVARIANT_RETURNS virtual AttributeQueryDescriptorType* buildObject() const { +#else + virtual xmltooling::XMLObject* buildObject() const { +#endif xmltooling::QName schemaType( - SAMLConstants::SAML20_NS,AttributeQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX + samlconstants::SAML20_NS,AttributeQueryDescriptorType::TYPE_NAME,samlconstants::SAML20MD_QUERY_EXT_PREFIX ); return buildObject( - SAMLConstants::SAML20_NS,AttributeQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType + samlconstants::SAML20_NS,AttributeQueryDescriptorType::LOCAL_NAME,samlconstants::SAML20_PREFIX,&schemaType ); } /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual AttributeQueryDescriptorType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static AttributeQueryDescriptorType* buildAttributeQueryDescriptorType() { const AttributeQueryDescriptorTypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AttributeQueryDescriptorType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_QUERY_EXT_NS,AttributeQueryDescriptorType::TYPE_NAME)) ); - if (b) + if (b) { +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(); +#else + return dynamic_cast(b->buildObject()); +#endif + } throw xmltooling::XMLObjectException("Unable to obtain typed builder for AttributeQueryDescriptorType."); } }; @@ -614,26 +664,39 @@ namespace opensaml { public: virtual ~AuthzDecisionQueryDescriptorTypeBuilder() {} /** Default builder. */ +#ifdef HAVE_COVARIANT_RETURNS virtual AuthzDecisionQueryDescriptorType* buildObject() const { +#else + virtual xmltooling::XMLObject* buildObject() const { +#endif xmltooling::QName schemaType( - SAMLConstants::SAML20_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX + samlconstants::SAML20_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME,samlconstants::SAML20MD_QUERY_EXT_PREFIX ); return buildObject( - SAMLConstants::SAML20_NS,AuthzDecisionQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType + samlconstants::SAML20_NS,AuthzDecisionQueryDescriptorType::LOCAL_NAME,samlconstants::SAML20_PREFIX,&schemaType ); } /** Builder that allows element/type override. */ +#ifdef HAVE_COVARIANT_RETURNS virtual AuthzDecisionQueryDescriptorType* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const; /** Singleton builder. */ static AuthzDecisionQueryDescriptorType* buildAuthzDecisionQueryDescriptorType() { const AuthzDecisionQueryDescriptorTypeBuilder* b = dynamic_cast( - XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME)) + XMLObjectBuilder::getBuilder(xmltooling::QName(samlconstants::SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME)) ); - if (b) + if (b) { +#ifdef HAVE_COVARIANT_RETURNS return b->buildObject(); +#else + return dynamic_cast(b->buildObject()); +#endif + } throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthzDecisionQueryDescriptorType."); } };