Change license header.
[shibboleth/cpp-sp.git] / shibsp / metadata / MetadataProviderCriteria.h
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * @file shibsp/metadata/MetadataProviderCriteria.h
23  *
24  * Extended criteria for metadata lookup for Shibboleth-aware metadata providers.
25  */
26
27 #ifndef __shibsp_metaprovcrit_h__
28 #define __shibsp_metaprovcrit_h__
29
30 #include <shibsp/base.h>
31
32 #include <saml/saml2/metadata/MetadataProvider.h>
33
34 namespace shibsp {
35
36     class SHIBSP_API Application;
37
38     /**
39      * Extended criteria for metadata lookup for Shibboleth-aware metadata providers.
40      */
41     struct SHIBSP_API MetadataProviderCriteria : public opensaml::saml2md::MetadataProvider::Criteria
42     {
43         /**
44          * Constructor.
45          *
46          * @param app   application performing the lookup
47          */
48         MetadataProviderCriteria(const Application& app);
49
50         /**
51          * Constructor.
52          *
53          * @param app   application performing the lookup
54          * @param id    entityID to lookup
55          * @param q     element/type of role, if any
56          * @param prot  protocol support constant, if any
57          * @param valid true iff stale metadata should be ignored
58          */
59         MetadataProviderCriteria(
60             const Application& app, const XMLCh* id, const xmltooling::QName* q=nullptr, const XMLCh* prot=nullptr, bool valid=true
61             );
62
63         /**
64          * Constructor.
65          *
66          * @param app   application performing the lookup
67          * @param id    entityID to lookup
68          * @param q     element/type of role, if any
69          * @param prot  protocol support constant, if any
70          * @param valid true iff stale metadata should be ignored
71          */
72         MetadataProviderCriteria(
73             const Application& app, const char* id, const xmltooling::QName* q=nullptr, const XMLCh* prot=nullptr, bool valid=true
74             );
75
76         /**
77          * Constructor.
78          *
79          * @param app   application performing the lookup
80          * @param a     artifact to lookup
81          * @param q     element/type of role, if any
82          * @param prot  protocol support constant, if any
83          * @param valid true iff stale metadata should be ignored
84          */
85         MetadataProviderCriteria(
86             const Application& app, const opensaml::SAMLArtifact* a, const xmltooling::QName* q=nullptr, const XMLCh* prot=nullptr, bool valid=true
87             );
88
89         ~MetadataProviderCriteria();
90
91         /** The application performing the lookup. */
92         const Application& application;
93     };
94 };
95
96 #endif /* __shibsp_metaprovcrit_h__ */