saml2mdinclude_HEADERS = \
saml2/metadata/AbstractMetadataProvider.h \
saml2/metadata/ChainingMetadataProvider.h \
+ saml2/metadata/EndpointManager.h \
saml2/metadata/Metadata.h \
saml2/metadata/MetadataFilter.h \
saml2/metadata/MetadataKeyInfoIterator.h \
>\r
</File>\r
<File\r
+ RelativePath=".\saml2\metadata\EndpointManager.h"\r
+ >\r
+ </File>\r
+ <File\r
RelativePath=".\saml2\metadata\Metadata.h"\r
>\r
</File>\r
--- /dev/null
+/*
+ * Copyright 2001-2006 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file saml/saml2/metadata/EndpointManager.h
+ *
+ * Templates for processing endpoint information.
+ */
+
+#ifndef __saml_epmgr_h__
+#define __saml_epmgr_h__
+
+#include <saml/base.h>
+
+namespace opensaml {
+ namespace saml2md {
+
+ /**
+ * Template for processing unindexed endpoint information.
+ *
+ * @param _Tx the endpoint type being managed
+ */
+ template <class _Tx>
+ class EndpointManager
+ {
+ protected:
+ typename const std::vector<_Tx*>& m_endpoints;
+
+ public:
+ /**
+ * Constructor.
+ *
+ * @param endpoints array of endpoints to manage
+ */
+ EndpointManager(typename const std::vector<_Tx*>& endpoints) : m_endpoints(endpoints) {
+ }
+
+ /**
+ * Returns endpoint that supports a particular binding.
+ *
+ * @param binding binding to locate
+ * @return a supporting endpoint, favoring the default, or NULL
+ */
+ const _Tx* getByBinding(const XMLCh* binding) const {
+ for (std::vector<_Tx*>::const_iterator i = m_endpoints.begin(); i!=m_endpoints.end(); ++i) {
+ if (xercesc::XMLString::equals(binding,(*i)->getBinding()))
+ return *i;
+ }
+ return NULL;
+ }
+ };
+
+ /**
+ * Template for processing indexed endpoint information.
+ *
+ * @param _Tx the endpoint type being managed
+ */
+ template <class _Tx>
+ class IndexedEndpointManager : public EndpointManager<_Tx>
+ {
+ typename const _Tx* m_default;
+
+ public:
+ /**
+ * Constructor.
+ *
+ * @param endpoints array of endpoints to manage
+ */
+ IndexedEndpointManager(typename const std::vector<_Tx*>& endpoints) : EndpointManager(endpoints), m_default(NULL) {
+ }
+
+ /**
+ * Returns the default endpoint in the set.
+ *
+ * @return the default endpoint
+ */
+ const _Tx* getDefault() const {
+ if (m_default)
+ return m_default;
+ for (std::vector<_Tx*>::const_iterator i = m_endpoints.begin(); i!=m_endpoints.end(); ++i) {
+ if ((*i)->isDefault())
+ return m_default=*i;
+ }
+ return (m_endpoints.empty()) ? m_default=NULL : m_default=m_endpoints.front();
+ }
+
+ /**
+ * Returns indexed endpoint.
+ *
+ * @param index index to locate
+ * @return matching endpoint, or NULL
+ */
+ const _Tx* getByIndex(unsigned short index) const {
+ for (std::vector<_Tx*>::const_iterator i = m_endpoints.begin(); i!=m_endpoints.end(); ++i) {
+ std::pair<bool,int> comp = (*i)->getIndex();
+ if (comp.first && index == comp.second)
+ return *i;
+ }
+ return NULL;
+ }
+
+ /**
+ * Returns endpoint that supports a particular binding.
+ *
+ * @param binding binding to locate
+ * @return a supporting endpoint, favoring the default, or NULL
+ */
+ const _Tx* getByBinding(const XMLCh* binding) const {
+ if (getDefault() && xercesc::XMLString::equals(binding,m_default->getBinding()))
+ return m_default;
+ return EndpointManager::getByBinding(binding);
+ }
+ };
+ };
+};
+
+#endif /* __saml_epmgr_h__ */
const XMLCh samlconstants::SAML1MD_PREFIX[] =
{ chLatin_s, chLatin_a, chLatin_m, chLatin_l, chDigit_1, chLatin_m, chLatin_d, chNull };
+const XMLCh samlconstants::SAML10_PROTOCOL_ENUM[] = // urn:oasis:names:tc:SAML:1.0:protocol
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+ chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+ chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
+ chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull
+};
+
const XMLCh samlconstants::SAML11_PROTOCOL_ENUM[] = // urn:oasis:names:tc:SAML:1.1:protocol
{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
/** SAML 1.x Metadata Profile QName prefix ("saml1md") */
extern SAML_API const XMLCh SAML1MD_PREFIX[];
-#ifndef SAML10_PROTOCOL_ENUM
/** SAML 1.0 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.0:protocol") */
- #define SAML10_PROTOCOL_ENUM samlconstants::SAML1P_NS
-#endif
+ extern SAML_API const XMLCh SAML10_PROTOCOL_ENUM[];
/** SAML 1.1 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.1:protocol") */
extern SAML_API const XMLCh SAML11_PROTOCOL_ENUM[];
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
- <uri name="http://schemas.xmlsoap.org/soap/envelope/" uri="@-PKGXMLDIR-@/soap-envelope.xsd"/>
<uri name="urn:oasis:names:tc:SAML:1.0:assertion" uri="@-PKGXMLDIR-@/cs-sstc-schema-assertion-01.xsd"/>
<uri name="urn:oasis:names:tc:SAML:1.0:protocol" uri="@-PKGXMLDIR-@/cs-sstc-schema-protocol-01.xsd"/>
</catalog>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
- <uri name="http://schemas.xmlsoap.org/soap/envelope/" uri="@-PKGXMLDIR-@/soap-envelope.xsd"/>
<uri name="urn:oasis:names:tc:SAML:1.0:assertion" uri="@-PKGXMLDIR-@/cs-sstc-schema-assertion-1.1.xsd"/>
<uri name="urn:oasis:names:tc:SAML:1.0:protocol" uri="@-PKGXMLDIR-@/cs-sstc-schema-protocol-1.1.xsd"/>
</catalog>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
- <uri name="http://schemas.xmlsoap.org/soap/envelope/" uri="@-PKGXMLDIR-@/soap-envelope.xsd"/>
<uri name="urn:oasis:names:tc:SAML:2.0:assertion" uri="@-PKGXMLDIR-@/saml-schema-assertion-2.0.xsd"/>
<uri name="urn:oasis:names:tc:SAML:2.0:protocol" uri="@-PKGXMLDIR-@/saml-schema-protocol-2.0.xsd"/>
<uri name="urn:oasis:names:tc:SAML:2.0:metadata" uri="@-PKGXMLDIR-@/saml-schema-metadata-2.0.xsd"/>