KickJava   Java API By Example, From Geeks To Geeks.

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


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
18 import org.apache.catalina.cluster.ClusterMessage;
19
20 /**
21  * Session id change cluster message
22  *
23  * @author Peter Rossbach
24  *
25  */

26 public class SessionIDMessage implements ClusterMessage {
27
28     private org.apache.catalina.cluster.Member address;
29
30     private int messageNumber;
31
32     private long timestamp;
33
34     private String JavaDoc orignalSessionID;
35
36     private String JavaDoc backupSessionID;
37
38     private String JavaDoc contextPath;
39
40     public org.apache.catalina.cluster.Member getAddress() {
41         return address;
42     }
43
44     public void setAddress(org.apache.catalina.cluster.Member address) {
45         this.address = address;
46     }
47
48     public String JavaDoc getUniqueId() {
49         StringBuffer JavaDoc result = new StringBuffer JavaDoc(getOrignalSessionID());
50         result.append("#-#");
51         result.append(getBackupSessionID());
52         result.append("#-#");
53         result.append(getMessageNumber());
54         result.append("#-#");
55         result.append(System.currentTimeMillis());
56         return result.toString();
57     }
58
59     /**
60      * @return Returns the contextPath.
61      */

62     public String JavaDoc getContextPath() {
63         return contextPath;
64     }
65     /**
66      * @param contextPath The contextPath to set.
67      */

68     public void setContextPath(String JavaDoc contextPath) {
69         this.contextPath = contextPath;
70     }
71     /**
72      * @return Returns the messageNumber.
73      */

74     public int getMessageNumber() {
75         return messageNumber;
76     }
77
78     /**
79      * @param messageNumber
80      * The messageNumber to set.
81      */

82     public void setMessageNumber(int messageNumber) {
83         this.messageNumber = messageNumber;
84     }
85
86     /**
87      * @return Returns the timestamp.
88      */

89     public long getTimestamp() {
90         return timestamp;
91     }
92
93     /**
94      * @param timestamp
95      * The timestamp to set.
96      */

97     public void setTimestamp(long timestamp) {
98         this.timestamp = timestamp;
99     }
100
101     /**
102      * @return Returns the backupSessionID.
103      */

104     public String JavaDoc getBackupSessionID() {
105         return backupSessionID;
106     }
107
108     /**
109      * @param backupSessionID
110      * The backupSessionID to set.
111      */

112     public void setBackupSessionID(String JavaDoc backupSessionID) {
113         this.backupSessionID = backupSessionID;
114     }
115
116     /**
117      * @return Returns the orignalSessionID.
118      */

119     public String JavaDoc getOrignalSessionID() {
120         return orignalSessionID;
121     }
122
123     /**
124      * @param orignalSessionID
125      * The orignalSessionID to set.
126      */

127     public void setOrignalSessionID(String JavaDoc orignalSessionID) {
128         this.orignalSessionID = orignalSessionID;
129     }
130 }
131
132
Popular Tags