Imported Upstream version 2.2.1+dfsg
[shibboleth/sp.git] / shibsp / metadata / MetadataProviderCriteria.h
1 /*
2  *  Copyright 2001-2008 Internet2
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /**
18  * @file shibsp/metadata/MetadataProviderCriteria.h
19  *
20  * Extended criteria for metadata lookup for Shibboleth-aware metadata providers.
21  */
22
23 #ifndef __shibsp_metaprovcrit_h__
24 #define __shibsp_metaprovcrit_h__
25
26 #include <shibsp/Application.h>
27 #include <saml/saml2/metadata/MetadataProvider.h>
28
29 namespace shibsp {
30
31     /**
32      * Extended criteria for metadata lookup for Shibboleth-aware metadata providers.
33      */
34     struct SHIBSP_API MetadataProviderCriteria : public opensaml::saml2md::MetadataProvider::Criteria
35     {
36         /**
37          * Constructor.
38          *
39          * @param app   application performing the lookup
40          */
41         MetadataProviderCriteria(const Application& app) : application(app) {
42         }
43
44         /**
45          * Constructor.
46          *
47          * @param app   application performing the lookup
48          * @param id    entityID to lookup
49          * @param q     element/type of role, if any
50          * @param prot  protocol support constant, if any
51          * @param valid true iff stale metadata should be ignored
52          */
53         MetadataProviderCriteria(const Application& app, const XMLCh* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
54             : opensaml::saml2md::MetadataProvider::Criteria(id, q, prot, valid), application(app) {
55         }
56
57         /**
58          * Constructor.
59          *
60          * @param app   application performing the lookup
61          * @param id    entityID to lookup
62          * @param q     element/type of role, if any
63          * @param prot  protocol support constant, if any
64          * @param valid true iff stale metadata should be ignored
65          */
66         MetadataProviderCriteria(const Application& app, const char* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
67             : opensaml::saml2md::MetadataProvider::Criteria(id, q, prot, valid), application(app) {
68         }
69
70         /**
71          * Constructor.
72          *
73          * @param app   application performing the lookup
74          * @param a     artifact to lookup
75          * @param q     element/type of role, if any
76          * @param prot  protocol support constant, if any
77          * @param valid true iff stale metadata should be ignored
78          */
79         MetadataProviderCriteria(const Application& app, const opensaml::SAMLArtifact* a, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
80             : opensaml::saml2md::MetadataProvider::Criteria(a, q, prot, valid), application(app) {
81         }
82
83         /** Controls whether stale metadata is ignored. */
84         const Application& application;
85     };
86 };
87
88 #endif /* __shibsp_metaprovcrit_h__ */