01: // ========================================================================
02: // $Id: State.java,v 1.3 2004/05/09 20:30:47 gregwilkins Exp $
03: // Copyright 2002-2004 Mort Bay Consulting Pty. Ltd.
04: // ------------------------------------------------------------------------
05: // Licensed under the Apache License, Version 2.0 (the "License");
06: // you may not use this file except in compliance with the License.
07: // You may obtain a copy of the License at
08: // http://www.apache.org/licenses/LICENSE-2.0
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14: // ========================================================================
15:
16: package org.mortbay.j2ee.session;
17:
18: //----------------------------------------
19:
20: import java.rmi.RemoteException;
21: import java.util.Enumeration;
22: import java.util.Map;
23:
24: //----------------------------------------
25: // The API around the isolated state encapsulated by an HttpSession -
26: // NOT quite the same as an HttpSession interface...
27: // It would be much cheaper to have set/removeAttribute return a
28: // boolean or void - but we HAVE TO HAVE the old binding to use in
29: // ValueUnbound events...
30: //----------------------------------------
31:
32: /**
33: * Implemented by objects wishing to be used to store the state from
34: * an HttpSession.
35: *
36: * @author <a href="mailto:jules@mortbay.com">Jules Gosnell</a>
37: * @version 1.0
38: */
39: public interface State {
40: // invariant field accessors
41: String getId() throws RemoteException;
42:
43: int getActualMaxInactiveInterval() throws RemoteException;
44:
45: long getCreationTime() throws RemoteException;
46:
47: // variant field accessors
48: Map getAttributes() throws RemoteException;
49:
50: void setAttributes(Map attributes) throws RemoteException;
51:
52: long getLastAccessedTime() throws RemoteException;
53:
54: void setLastAccessedTime(long time) throws RemoteException;
55:
56: int getMaxInactiveInterval() throws RemoteException;
57:
58: void setMaxInactiveInterval(int interval) throws RemoteException;
59:
60: // compound fn-ality
61: Object getAttribute(String name) throws RemoteException;
62:
63: Object setAttribute(String name, Object value, boolean returnValue)
64: throws RemoteException;
65:
66: Object removeAttribute(String name, boolean returnValue)
67: throws RemoteException;
68:
69: Enumeration getAttributeNameEnumeration() throws RemoteException;
70:
71: String[] getAttributeNameStringArray() throws RemoteException;
72:
73: boolean isValid() throws RemoteException;
74: }
|