001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.catalina.ha.session;
018:
019: import org.apache.catalina.ha.ClusterMessage;
020:
021: /**
022: *
023: * <B>Class Description:</B><BR>
024: * The SessionMessage class is a class that is used when a session has been
025: * created, modified, expired in a Tomcat cluster node.<BR>
026: *
027: * The following events are currently available:
028: * <ul>
029: * <li><pre>public static final int EVT_SESSION_CREATED</pre><li>
030: * <li><pre>public static final int EVT_SESSION_ACCESSED</pre><li>
031: * <li><pre>public static final int EVT_ATTRIBUTE_ADDED</pre><li>
032: * <li><pre>public static final int EVT_ATTRIBUTE_REMOVED</pre><li>
033: * <li><pre>public static final int EVT_SESSION_EXPIRED_WONOTIFY</pre><li>
034: * <li><pre>public static final int EVT_SESSION_EXPIRED_WNOTIFY</pre><li>
035: * <li><pre>public static final int EVT_GET_ALL_SESSIONS</pre><li>
036: * <li><pre>public static final int EVT_SET_USER_PRINCIPAL</pre><li>
037: * <li><pre>public static final int EVT_SET_SESSION_NOTE</pre><li>
038: * <li><pre>public static final int EVT_REMOVE_SESSION_NOTE</pre><li>
039: * </ul>
040: *
041: */
042:
043: public interface SessionMessage extends ClusterMessage,
044: java.io.Serializable {
045:
046: /**
047: * Event type used when a session has been created on a node
048: */
049: public static final int EVT_SESSION_CREATED = 1;
050: /**
051: * Event type used when a session has expired
052: */
053: public static final int EVT_SESSION_EXPIRED = 2;
054:
055: /**
056: * Event type used when a session has been accessed (ie, last access time
057: * has been updated. This is used so that the replicated sessions will not expire
058: * on the network
059: */
060: public static final int EVT_SESSION_ACCESSED = 3;
061: /**
062: * Event type used when a server comes online for the first time.
063: * The first thing the newly started server wants to do is to grab the
064: * all the sessions from one of the nodes and keep the same state in there
065: */
066: public static final int EVT_GET_ALL_SESSIONS = 4;
067: /**
068: * Event type used when an attribute has been added to a session,
069: * the attribute will be sent to all the other nodes in the cluster
070: */
071: public static final int EVT_SESSION_DELTA = 13;
072:
073: /**
074: * When a session state is transferred, this is the event.
075: */
076: public static final int EVT_ALL_SESSION_DATA = 12;
077:
078: /**
079: * When a session state is complete transferred, this is the event.
080: */
081: public static final int EVT_ALL_SESSION_TRANSFERCOMPLETE = 14;
082:
083: public String getContextName();
084:
085: public String getEventTypeString();
086:
087: /**
088: * returns the event type
089: * @return one of the event types EVT_XXXX
090: */
091: public int getEventType();
092:
093: /**
094: * @return the serialized data for the session
095: */
096: public byte[] getSession();
097:
098: /**
099: * @return the session ID for the session
100: */
101: public String getSessionID();
102:
103: }//SessionMessage
|