Change license header.
[shibboleth/cpp-sp.git] / shibsp / binding / ProtocolProvider.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  */\r
20 \r
21 /**\r
22  * @file shibsp/binding/ProtocolProvider.h\r
23  * \r
24  * Interface to protocol, binding, and default endpoint information.\r
25  */\r
26 \r
27 #ifndef __shibsp_protprov_h__\r
28 #define __shibsp_protprov_h__\r
29 \r
30 #include <shibsp/base.h>\r
31 \r
32 #include <vector>\r
33 #include <xmltooling/Lockable.h>\r
34 \r
35 namespace shibsp {\r
36 \r
37     class SHIBSP_API PropertySet;\r
38 \r
39     /**\r
40      * Interface to protocol, binding, and default endpoint information.\r
41      */\r
42         class SHIBSP_API ProtocolProvider : public virtual xmltooling::Lockable\r
43     {\r
44         MAKE_NONCOPYABLE(ProtocolProvider);\r
45     protected:\r
46         ProtocolProvider();\r
47     public:\r
48         virtual ~ProtocolProvider();\r
49     \r
50         /**\r
51          * Returns configuration details for initiating a protocol service, as a PropertySet.\r
52          *\r
53          * @param protocol  the name of a protocol\r
54          * @param service   the name of a service\r
55          * @return  a PropertySet associated with initiation/request of a service\r
56          */\r
57         virtual const PropertySet* getInitiator(const char* protocol, const char* service) const=0;\r
58 \r
59         /**\r
60          * Returns an ordered array of protocol bindings available for a specified service.\r
61          *\r
62          * @param protocol  the name of a protocol\r
63          * @param service   name of the protocol service\r
64          * @return  the array of bindings, each represented as a PropertySet\r
65          */\r
66         virtual const std::vector<const PropertySet*>& getBindings(const char* protocol, const char* service) const=0;\r
67     };\r
68 \r
69     /**\r
70      * Registers ProtocolProvider classes into the runtime.\r
71      */\r
72     void SHIBSP_API registerProtocolProviders();\r
73 \r
74     /** ProtocolProvider based on an XML configuration format. */\r
75     #define XML_PROTOCOL_PROVIDER "XML"\r
76 };\r
77 \r
78 #endif /* __shibsp_protprov_h__ */\r