Working version of new handler configuration and supporting files.
[shibboleth/sp.git] / shibsp / binding / ProtocolProvider.h
1 /*\r
2  *  Copyright 2010 Internet2\r
3  * \r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 /**\r
18  * @file shibsp/binding/ProtocolProvider.h\r
19  * \r
20  * Interface to protocol, binding, and default endpoint information.\r
21  */\r
22 \r
23 #ifndef __shibsp_protprov_h__\r
24 #define __shibsp_protprov_h__\r
25 \r
26 #include <shibsp/base.h>\r
27 \r
28 #include <vector>\r
29 #include <xmltooling/Lockable.h>\r
30 \r
31 namespace shibsp {\r
32 \r
33     class SHIBSP_API PropertySet;\r
34 \r
35     /**\r
36      * Interface to protocol, binding, and default endpoint information.\r
37      */\r
38         class SHIBSP_API ProtocolProvider : public virtual xmltooling::Lockable\r
39     {\r
40         MAKE_NONCOPYABLE(ProtocolProvider);\r
41     protected:\r
42         ProtocolProvider();\r
43     public:\r
44         virtual ~ProtocolProvider();\r
45     \r
46         /**\r
47          * Returns configuration details for initiating a protocol service, as a PropertySet.\r
48          *\r
49          * @param protocol  the name of a protocol\r
50          * @param service   the name of a service\r
51          * @return  a PropertySet associated with initiation/request of a service\r
52          */\r
53         virtual const PropertySet* getInitiator(const char* protocol, const char* service) const=0;\r
54 \r
55         /**\r
56          * Returns an ordered array of protocol bindings available for a specified service.\r
57          *\r
58          * @param protocol  the name of a protocol\r
59          * @param service   name of the protocol service\r
60          * @return  the array of bindings, each represented as a PropertySet\r
61          */\r
62         virtual const std::vector<const PropertySet*>& getBindings(const char* protocol, const char* service) const=0;\r
63     };\r
64 \r
65     /**\r
66      * Registers ProtocolProvider classes into the runtime.\r
67      */\r
68     void SHIBSP_API registerProtocolProviders();\r
69 \r
70     /** ProtocolProvider based on an XML configuration format. */\r
71     #define XML_PROTOCOL_PROVIDER "XML"\r
72 };\r
73 \r
74 #endif /* __shibsp_protprov_h__ */\r