-/*
- * Copyright 2001-2007 Internet2
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
*
- * 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
+ * UCAID licenses this file to you 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
+ * 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.
+ * 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.
*/
/**
#define __saml2_metadataprov_h__
#include <saml/base.h>
+
+#include <vector>
#include <xmltooling/exceptions.h>
-#include <xmltooling/XMLObject.h>
#include <xmltooling/security/CredentialResolver.h>
+namespace xmltooling {
+ class XMLTOOL_API QName;
+ class XMLTOOL_API XMLObject;
+};
+
namespace opensaml {
class SAML_API SAMLArtifact;
*
* @param e DOM to supply configuration for provider
*/
- MetadataProvider(const xercesc::DOMElement* e=NULL);
+ MetadataProvider(const xercesc::DOMElement* e=nullptr);
public:
/**
*
* @param newFilter metadata filter to add
*/
- virtual void addMetadataFilter(MetadataFilter* newFilter) {
- m_filters.push_back(newFilter);
- }
+ virtual void addMetadataFilter(MetadataFilter* newFilter);
/**
* Removes a metadata filter. The caller must delete the filter if necessary.
* @param oldFilter metadata filter to remove
* @return the old filter
*/
- virtual MetadataFilter* removeMetadataFilter(MetadataFilter* oldFilter) {
- for (std::vector<MetadataFilter*>::iterator i=m_filters.begin(); i!=m_filters.end(); i++) {
- if (oldFilter==(*i)) {
- m_filters.erase(i);
- return oldFilter;
- }
- }
- return NULL;
- }
+ virtual MetadataFilter* removeMetadataFilter(MetadataFilter* oldFilter);
/**
* Should be called after instantiating provider and adding filters, but before
* @param name the name of the group
* @param requireValidMetadata indicates whether the metadata for the group must be valid/current
*
- * @return the group's metadata or NULL if there is no metadata or no valid metadata
+ * @return the group's metadata or nullptr if there is no metadata or no valid metadata
*/
virtual const EntitiesDescriptor* getEntitiesDescriptor(const XMLCh* name, bool requireValidMetadata=true) const;
* @param name the name of the group
* @param requireValidMetadata indicates whether the metadata for the group must be valid/current
*
- * @return the group's metadata or NULL if there is no metadata or no valid metadata
+ * @return the group's metadata or nullptr if there is no metadata or no valid metadata
*/
virtual const EntitiesDescriptor* getEntitiesDescriptor(const char* name, bool requireValidMetadata=true) const=0;
/**
* Default constructor.
*/
- Criteria() : entityID_unicode(NULL), entityID_ascii(NULL), artifact(NULL), role(NULL), protocol(NULL), protocol2(NULL), validOnly(true) {
- }
+ Criteria();
/**
* Constructor.
* @param prot protocol support constant, if any
* @param valid true iff stale metadata should be ignored
*/
- Criteria(const XMLCh* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
- : entityID_unicode(id), entityID_ascii(NULL), artifact(NULL), role(q), protocol(prot), protocol2(NULL), validOnly(valid) {
- }
+ Criteria(const XMLCh* id, const xmltooling::QName* q=nullptr, const XMLCh* prot=nullptr, bool valid=true);
/**
* Constructor.
* @param prot protocol support constant, if any
* @param valid true iff stale metadata should be ignored
*/
- Criteria(const char* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
- : entityID_unicode(NULL), entityID_ascii(id), artifact(NULL), role(q), protocol(prot), protocol2(NULL), validOnly(valid) {
- }
+ Criteria(const char* id, const xmltooling::QName* q=nullptr, const XMLCh* prot=nullptr, bool valid=true);
/**
* Constructor.
* @param prot protocol support constant, if any
* @param valid true iff stale metadata should be ignored
*/
- Criteria(const SAMLArtifact* a, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
- : entityID_unicode(NULL), entityID_ascii(NULL), artifact(a), role(q), protocol(prot), protocol2(NULL), validOnly(valid) {
- }
+ Criteria(const SAMLArtifact* a, const xmltooling::QName* q=nullptr, const XMLCh* prot=nullptr, bool valid=true);
- virtual ~Criteria() {}
+ virtual ~Criteria();
/**
* Restores the object to its default state.
*/
- virtual void reset() {
- entityID_unicode=NULL;
- entityID_ascii=NULL;
- artifact=NULL;
- role=NULL;
- protocol=NULL;
- protocol2=NULL;
- validOnly=true;
- }
+ virtual void reset();
/** Unique ID of entity. */
const XMLCh* entityID_unicode;
*
* @param criteria lookup criteria
*
- * @return the entity's metadata (and optionally a role) or NULL if there is no qualifying metadata
+ * @return the entity's metadata (and optionally a role) or nullptr if there is no qualifying metadata
*/
virtual std::pair<const EntityDescriptor*,const RoleDescriptor*> getEntityDescriptor(const Criteria& criteria) const=0;