Large reorg of shibsp lib, new SPRequest API, ported modules, shifted code out of...
[shibboleth/sp.git] / shibsp / SessionCache.h
1 /*
2  *  Copyright 2001-2006 Internet2
3  * 
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /**
18  * @file shibsp/SessionCache.h
19  * 
20  * Caches and manages user sessions
21  */
22
23 #ifndef __shibsp_sessioncache_h__
24 #define __shibsp_sessioncache_h__
25
26 #include <xmltooling/Lockable.h>
27 #include <xercesc/dom/DOM.hpp>
28
29 namespace shibsp {
30
31     class SHIBSP_API Session : public virtual xmltooling::Lockable
32     {
33         MAKE_NONCOPYABLE(Session);
34     protected:
35         Session() {}
36         virtual ~Session() {}
37     public:
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;
45         */
46     };
47     
48     /**
49      * Creates and manages user sessions
50      * 
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.
56      */
57     class SHIBSP_API SessionCache
58     {
59         MAKE_NONCOPYABLE(SessionCache);
60     public:
61         /**
62          * Constructor
63          */
64         SessionCache(const xercesc::DOMElement* e);
65
66         virtual ~SessionCache();
67
68     };
69 };
70
71 #endif /* __shibsp_sessioncache_h__ */