1: package playwithserialization;
2:
3: import java.io.Serializable;
4: import java.lang.reflect.Field;
5: import java.util.Date;
6: import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
7:
8: /**
9: *
10: *
11: */
12: public class LogMsg implements Serializable {
13:
14: public Date getDateTime() {
15: return DateTime;
16: }
17:
18: public void setDateTime(Date DateTime) {
19: this.DateTime = DateTime;
20: }
21:
22: public String getMsg() {
23: return Msg;
24: }
25:
26: public void setMsg(String Msg) {
27: this.Msg = Msg;
28: }
29:
30: public String getMessageGroup() {
31: return MessageGroup;
32: }
33:
34: public void setMessageGroup(String MessageGroup) {
35: this.MessageGroup = MessageGroup;
36: }
37:
38: public TraceEventType getSeverity() {
39: return Severity;
40: }
41:
42: public void setSeverity(TraceEventType Severity) {
43: this.Severity = Severity;
44: }
45:
46: public String getThreadID() {
47: return threadID;
48: }
49:
50: public void setThreadID(String threadID) {
51: this.threadID = threadID;
52: }
53:
54: public String getThreadName() {
55: return ThreadName;
56: }
57:
58: public void setThreadName(String ThreadName) {
59: this.ThreadName = ThreadName;
60: }
61:
62: public String getAdditionalInfo() {
63: return AdditionalInfo;
64: }
65:
66: public void setAdditionalInfo(String AdditionalInfo) {
67: this.AdditionalInfo = AdditionalInfo;
68: }
69:
70: public String getStackTrace() {
71: return StackTrace;
72: }
73:
74: public void setStackTrace(String StackTrace) {
75: this.StackTrace = StackTrace;
76: }
77:
78: // Summary:
79: // Identifies the type of event that has caused the trace.
80: public enum TraceEventType
81: {
82: // Summary:
83: // Fatal error or application crash.
84: Critical (1),
85: //
86: // Summary:
87: // Recoverable error.
88: Error ( 2),
89:
90: //
91: // Summary:
92: // Noncritical problem.
93: Warning (4),
94: //
95: // Summary:
96: // Informational message.
97: Information (8),
98: //
99: // Summary:
100: // Debugging trace.
101: Verbose (16),
102: //
103: // Summary:
104: // Starting of a logical operation.
105:
106: Start (256),
107:
108: Stop ( 512),
109:
110: Suspend (1024),
111:
112: Resume ( 2048),
113:
114: Transfer (4096);
115:
116: private final int mOrder;
117:
118: TraceEventType(int pOrder )
119: {
120: mOrder = pOrder;
121: }
122: }
123:
124:
125: private Date DateTime ;
126:
127: private String Msg ;
128:
129: private String MessageGroup ;
130:
131: private TraceEventType Severity ;
132:
133: private String threadID ;
134:
135: private String ThreadName ;
136:
137: private String AdditionalInfo ;
138:
139: private String StackTrace ;
140:
141: public LogMsg()
142: {
143:
144: }
145:
146: public String toString() {
147: return (new ReflectionToStringBuilder(this) {
148: protected boolean accept(Field f) {
149: return true;
150: }
151: }).toString();
152: }
153: }