01: /*
02: * Copyright 1999,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.apache.catalina.cluster;
17:
18: /**
19: *
20: * <B>Class Description:</B><BR>
21: * The SessionMessage class is a class that is used when a session has been
22: * created, modified, expired in a Tomcat cluster node.<BR>
23: *
24: * The following events are currently available:
25: * <ul>
26: * <li><pre>public static final int EVT_SESSION_CREATED</pre><li>
27: * <li><pre>public static final int EVT_SESSION_ACCESSED</pre><li>
28: * <li><pre>public static final int EVT_ATTRIBUTE_ADDED</pre><li>
29: * <li><pre>public static final int EVT_ATTRIBUTE_REMOVED</pre><li>
30: * <li><pre>public static final int EVT_SESSION_EXPIRED_WONOTIFY</pre><li>
31: * <li><pre>public static final int EVT_SESSION_EXPIRED_WNOTIFY</pre><li>
32: * <li><pre>public static final int EVT_GET_ALL_SESSIONS</pre><li>
33: * <li><pre>public static final int EVT_SET_USER_PRINCIPAL</pre><li>
34: * <li><pre>public static final int EVT_SET_SESSION_NOTE</pre><li>
35: * <li><pre>public static final int EVT_REMOVE_SESSION_NOTE</pre><li>
36: * </ul>
37: *
38: */
39: import java.security.Principal;
40: import org.apache.catalina.cluster.Member;
41:
42: public interface SessionMessage extends ClusterMessage,
43: java.io.Serializable {
44:
45: /**
46: * Event type used when a session has been created on a node
47: */
48: public static final int EVT_SESSION_CREATED = 1;
49: /**
50: * Event type used when a session has expired
51: */
52: public static final int EVT_SESSION_EXPIRED = 2;
53:
54: /**
55: * Event type used when a session has been accessed (ie, last access time
56: * has been updated. This is used so that the replicated sessions will not expire
57: * on the network
58: */
59: public static final int EVT_SESSION_ACCESSED = 3;
60: /**
61: * Event type used when a server comes online for the first time.
62: * The first thing the newly started server wants to do is to grab the
63: * all the sessions from one of the nodes and keep the same state in there
64: */
65: public static final int EVT_GET_ALL_SESSIONS = 4;
66: /**
67: * Event type used when an attribute has been added to a session,
68: * the attribute will be sent to all the other nodes in the cluster
69: */
70: public static final int EVT_SESSION_DELTA = 13;
71:
72: /**
73: * When a session state is transferred, this is the event.
74: */
75: public static final int EVT_ALL_SESSION_DATA = 12;
76:
77: public String getContextName();
78:
79: public String getEventTypeString();
80:
81: /**
82: * returns the event type
83: * @return one of the event types EVT_XXXX
84: */
85: public int getEventType();
86:
87: /**
88: * @return the serialized data for the session
89: */
90: public byte[] getSession();
91:
92: /**
93: * @return the session ID for the session
94: */
95: public String getSessionID();
96:
97: }//SessionMessage
|