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