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 Session : public virtual xmltooling::Lockable
33 MAKE_NONCOPYABLE(Session);
38 /* TODO: design new interface, probably with version-specific subinterfaces
39 virtual const char* getClientAddress() const=0;
40 virtual const char* getProviderId() const=0;
41 virtual std::pair<const char*,const saml::SAMLSubject*> getSubject(bool xml=true, bool obj=false) const=0;
42 virtual const char* getAuthnContext() const=0;
43 virtual std::pair<const char*,const saml::SAMLResponse*> getTokens(bool xml=true, bool obj=false) const=0;
44 virtual std::pair<const char*,const saml::SAMLResponse*> getFilteredTokens(bool xml=true, bool obj=false) const=0;
49 * Creates and manages user sessions
51 * The cache abstracts a persistent (meaning across requests) cache of
52 * instances of the Session interface. Creation of new entries and entry
53 * lookup are confined to this interface to enable the implementation to
54 * remote and/or optimize calls by implementing custom versions of the
55 * Session interface as required.
57 class SHIBSP_API SessionCache
59 MAKE_NONCOPYABLE(SessionCache);
64 SessionCache(const xercesc::DOMElement* e);
66 virtual ~SessionCache();
71 #endif /* __shibsp_sessioncache_h__ */