001: package tools.tracesviewer;
002:
003: import java.io.*;
004:
005: public class TracesMessage implements Serializable {
006:
007: String messageFrom = null;
008: String messageTo = null;
009: String messageTime = null;
010: String messageTimeStamp = null;
011: String messageString = null;
012: String messageFirstLine = null;
013: String messageStatusInfo = null;
014: String messageTransactionId = null;
015: String debugLine = null;
016:
017: String beforeDebug;
018: String afterDebug;
019:
020: public TracesMessage() {
021: }
022:
023: public TracesMessage(String messageFrom, String messageTo,
024: String messageTime, String messageFirstLine,
025: String messageString, String messageStatusInfo,
026: String messageTransactionId, String messageTimeStamp,
027: String debugLine) {
028: this .messageFrom = messageFrom;
029: this .messageTo = messageTo;
030: this .messageTime = messageTime;
031: this .messageString = messageString;
032: this .messageFirstLine = messageFirstLine;
033: this .messageStatusInfo = messageStatusInfo;
034: this .messageTransactionId = messageTransactionId;
035: this .messageTimeStamp = messageTimeStamp;
036: this .debugLine = debugLine;
037: }
038:
039: private String getKey() {
040: if (messageTimeStamp != null) {
041: return messageFirstLine + messageTransactionId + ":"
042: + messageTimeStamp;
043: } else {
044: // Generate a random time stamp
045: return messageFirstLine + messageTransactionId + ":"
046: + (int) (Math.random() * 1000);
047: }
048: }
049:
050: /**
051: * To check for insertion into the hash table.
052: *
053: */
054: public int hashCode() {
055: return getKey().hashCode();
056: }
057:
058: public void setFrom(String from) {
059: messageFrom = from;
060: }
061:
062: public void setTo(String to) {
063: messageTo = to;
064: }
065:
066: public void setTime(String time) {
067: messageTime = time;
068: }
069:
070: public void setMessageString(String str) {
071: messageString = str;
072: }
073:
074: public void setFirstLine(String FirstLine) {
075: messageFirstLine = FirstLine;
076: }
077:
078: public void setStatusInfo(String statusInfo) {
079: messageStatusInfo = statusInfo;
080: }
081:
082: public void setTransactionId(String transactionId) {
083: messageTransactionId = transactionId;
084: }
085:
086: public String getFrom() {
087: return messageFrom;
088: }
089:
090: public String getTo() {
091: return messageTo;
092: }
093:
094: public String getTime() {
095: return messageTime;
096: }
097:
098: public String getMessageString() {
099: //System.out.println("messageContent:"+messageString);
100: return messageString;
101: //+
102: //"\n-------------------\n" +
103: //"|debugLogLine = " + debugLine +" |" +
104: //"\n-------------------";
105: }
106:
107: public String getFirstLine() {
108: return messageFirstLine;
109: }
110:
111: public String getStatusInfo() {
112: return messageStatusInfo;
113: }
114:
115: public String getTransactionId() {
116: return messageTransactionId;
117: }
118: }
|