KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > cluster > session > SessionMessage


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
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 package org.apache.catalina.cluster.session;
17 import org.apache.catalina.cluster.ClusterMessage;
18
19 /**
20  *
21  * <B>Class Description:</B><BR>
22  * The SessionMessage class is a class that is used when a session has been
23  * created, modified, expired in a Tomcat cluster node.<BR>
24  *
25  * The following events are currently available:
26  * <ul>
27  * <li><pre>public static final int EVT_SESSION_CREATED</pre><li>
28  * <li><pre>public static final int EVT_SESSION_ACCESSED</pre><li>
29  * <li><pre>public static final int EVT_ATTRIBUTE_ADDED</pre><li>
30  * <li><pre>public static final int EVT_ATTRIBUTE_REMOVED</pre><li>
31  * <li><pre>public static final int EVT_SESSION_EXPIRED_WONOTIFY</pre><li>
32  * <li><pre>public static final int EVT_SESSION_EXPIRED_WNOTIFY</pre><li>
33  * <li><pre>public static final int EVT_GET_ALL_SESSIONS</pre><li>
34  * <li><pre>public static final int EVT_SET_USER_PRINCIPAL</pre><li>
35  * <li><pre>public static final int EVT_SET_SESSION_NOTE</pre><li>
36  * <li><pre>public static final int EVT_REMOVE_SESSION_NOTE</pre><li>
37  * </ul>
38  *
39  */

40
41 public interface SessionMessage extends ClusterMessage, java.io.Serializable JavaDoc
42 {
43
44     /**
45      * Event type used when a session has been created on a node
46      */

47     public static final int EVT_SESSION_CREATED = 1;
48     /**
49      * Event type used when a session has expired
50      */

51     public static final int EVT_SESSION_EXPIRED = 2;
52
53     /**
54      * Event type used when a session has been accessed (ie, last access time
55      * has been updated. This is used so that the replicated sessions will not expire
56      * on the network
57      */

58     public static final int EVT_SESSION_ACCESSED = 3;
59     /**
60      * Event type used when a server comes online for the first time.
61      * The first thing the newly started server wants to do is to grab the
62      * all the sessions from one of the nodes and keep the same state in there
63      */

64     public static final int EVT_GET_ALL_SESSIONS = 4;
65     /**
66      * Event type used when an attribute has been added to a session,
67      * the attribute will be sent to all the other nodes in the cluster
68      */

69     public static final int EVT_SESSION_DELTA = 13;
70
71     /**
72      * When a session state is transferred, this is the event.
73      */

74     public static final int EVT_ALL_SESSION_DATA = 12;
75     
76
77     
78     public String JavaDoc getContextName();
79     
80     public String JavaDoc getEventTypeString();
81     
82     /**
83      * returns the event type
84      * @return one of the event types EVT_XXXX
85      */

86     public int getEventType();
87     /**
88      * @return the serialized data for the session
89      */

90     public byte[] getSession();
91     /**
92      * @return the session ID for the session
93      */

94     public String JavaDoc getSessionID();
95     
96
97
98 }//SessionMessage
99
Popular Tags