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/SessionCache.h
20 * Caches and manages user sessions
23 #ifndef __shibsp_sessioncache_h__
24 #define __shibsp_sessioncache_h__
26 #include <xmltooling/Lockable.h>
27 #include <xercesc/dom/DOM.hpp>
31 class SHIBSP_API Application;
33 class SHIBSP_API Session : public virtual xmltooling::Lockable
35 MAKE_NONCOPYABLE(Session);
40 /* TODO: design new interface, probably with version-specific subinterfaces
41 virtual const char* getClientAddress() const=0;
42 virtual const char* getProviderId() const=0;
43 virtual std::pair<const char*,const saml::SAMLSubject*> getSubject(bool xml=true, bool obj=false) const=0;
44 virtual const char* getAuthnContext() const=0;
45 virtual std::pair<const char*,const saml::SAMLResponse*> getTokens(bool xml=true, bool obj=false) const=0;
46 virtual std::pair<const char*,const saml::SAMLResponse*> getFilteredTokens(bool xml=true, bool obj=false) const=0;
51 * Creates and manages user sessions
53 * The cache abstracts a persistent (meaning across requests) cache of
54 * instances of the Session interface. Creation of new entries and entry
55 * lookup are confined to this interface to enable the implementation to
56 * remote and/or optimize calls by implementing custom versions of the
57 * Session interface as required.
59 class SHIBSP_API SessionCache
61 MAKE_NONCOPYABLE(SessionCache);
65 virtual ~SessionCache() {}
69 * Registers SessionCache classes into the runtime.
71 void SHIBSP_API registerSessionCaches();
74 #endif /* __shibsp_sessioncache_h__ */