1 package org.apache.catalina.cluster.session; 2 3 4 import org.apache.catalina.cluster.Member; 5 13 14 public class SessionMessageImpl implements SessionMessage, java.io.Serializable { 15 public SessionMessageImpl() { 16 } 17 18 19 23 private int mEvtType = -1; 24 private byte[] mSession; 25 private String mSessionID; 26 private Member mSrc; 27 private String mContextName; 28 private long serializationTimestamp; 29 private String uniqueId; 30 31 32 61 private SessionMessageImpl( String contextName, 62 int eventtype, 63 byte[] session, 64 String sessionID) 65 { 66 mEvtType = eventtype; 67 mSession = session; 68 mSessionID = sessionID; 69 mContextName = contextName; 70 uniqueId = sessionID; 71 } 72 73 public SessionMessageImpl( String contextName, 74 int eventtype, 75 byte[] session, 76 String sessionID, 77 String uniqueID) 78 { 79 this(contextName,eventtype,session,sessionID); 80 uniqueId = uniqueID; 81 } 82 83 87 public int getEventType() { return mEvtType; } 88 91 public byte[] getSession() { return mSession;} 92 95 public String getSessionID(){ return mSessionID; } 96 99 103 105 107 public void setTimestamp(long time) {serializationTimestamp=time;} 108 public long getTimestamp() { return serializationTimestamp;} 109 112 public String getEventTypeString() 113 { 114 switch (mEvtType) 115 { 116 case EVT_SESSION_CREATED : return "SESSION-MODIFIED"; 117 case EVT_SESSION_EXPIRED : return "SESSION-EXPIRED"; 118 case EVT_SESSION_ACCESSED : return "SESSION-ACCESSED"; 119 case EVT_GET_ALL_SESSIONS : return "SESSION-GET-ALL"; 120 case EVT_SESSION_DELTA : return "SESSION-DELTA"; 121 case EVT_ALL_SESSION_DATA : return "ALL-SESSION-DATA"; 122 default : return "UNKNOWN-EVENT-TYPE"; 123 } 124 } 125 126 131 public Member getAddress() 132 { 133 return this.mSrc; 134 } 135 136 141 public void setAddress(Member src) 142 { 143 this.mSrc = src; 144 } 145 146 public String getContextName() { 147 return mContextName; 148 } 149 public String getUniqueId() { 150 return uniqueId; 151 } 152 public void setUniqueId(String uniqueId) { 153 this.uniqueId = uniqueId; 154 } 155 156 157 } 158 | Popular Tags |