2 * Copyright 2001-2006 Internet2
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file shibsp/ServiceProvider.h
20 * Interface to a Shibboleth ServiceProvider instance.
23 #ifndef __shibsp_sp_h__
24 #define __shibsp_sp_h__
26 #include <shibsp/PropertySet.h>
27 #include <xmltooling/signature/CredentialResolver.h>
31 class ListenerService;
34 * Interface to a Shibboleth ServiceProvider instance.
36 * <p>A ServiceProvider exposes configuration and infrastructure services required
37 * by the SP implementation, allowing a flexible configuration format.
39 class SHIBSP_API ServiceProvider : public virtual xmltooling::Lockable, public virtual PropertySet
41 MAKE_NONCOPYABLE(ServiceProvider);
45 virtual ~ServiceProvider() {}
48 * Loads a configuration and prepares the instance for use.
50 * <p>Implemented as a separate method so that services can rely on
51 * other services while they initialize by accessing the ServiceProvider
52 * from the SPConfig singleton.
54 virtual void init()=0;
57 * Returns a ListenerService instance.
59 * @param required true iff an exception should be thrown if no ListenerService is available
60 * @return a ListenerService if available, or NULL
62 virtual ListenerService* getListenerService(bool required=true) const=0;
65 * Returns a CredentialResolver instance mapped to a key.
67 * @param id a NULL-terminated key identifying the CredentialResolver to the configuration
68 * @return a CredentialResolver if available, or NULL
70 virtual xmlsignature::CredentialResolver* getCredentialResolver(const char* id) const=0;
72 //virtual ISessionCache* getSessionCache() const=0;
74 //virtual IRequestMapper* getRequestMapper() const=0;
76 //virtual const IApplication* getApplication(const char* applicationId) const=0;
80 * Registers ServiceProvider classes into the runtime.
82 void SHIBSP_API registerServiceProviders();
84 /** SP based on integrated XML and native server configuration. */
85 #define XML_SERVICE_PROVIDER "edu.internet2.middleware.shibboleth.sp.provider.XMLServiceProvider"
88 #endif /* __shibsp_sp_h__ */