1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package com.mindtree.techworks.insight.spi;
25
26 import java.io.Serializable;
27
28 import com.mindtree.techworks.insight.model.ReceiverFormat;
29
30
31
32
33
34
35
36
37
38
39
40
41 public class LogNamespace implements Serializable {
42
43
44
45
46 private static final long serialVersionUID = 1148642272921507002L;
47
48
49
50
51 private String sourceString;
52
53
54
55
56 private String localSourceString;
57
58
59
60
61 private ReceiverFormat[] receiverFormat;
62
63
64
65
66 private String nodeId;
67
68
69
70
71
72
73
74
75 public LogNamespace(String sourceString, String localSourceString, ReceiverFormat[] receiverFormat, String nodeId) {
76 this.sourceString = sourceString;
77 this.localSourceString = localSourceString;
78 this.receiverFormat = receiverFormat;
79 this.nodeId = nodeId;
80 }
81
82
83
84
85
86 public String getNamespaceAsString() {
87 return "[" + this.nodeId + "] " + this.sourceString;
88 }
89
90
91
92
93
94 public boolean equals(Object namespace) {
95 if (this == namespace) {
96 return true;
97 }
98
99 if (namespace instanceof LogNamespace) {
100 LogNamespace otherNamespace = (LogNamespace)namespace;
101
102 if ((this.sourceString != null && otherNamespace.sourceString == null) ||
103 (otherNamespace.sourceString != null && this.sourceString == null)) {
104 return false;
105 }
106 if (this.sourceString != null && otherNamespace.sourceString != null
107 && !this.sourceString.equals(otherNamespace.sourceString)) {
108 return false;
109 }
110
111 if ((this.nodeId != null && otherNamespace.nodeId == null) ||
112 (otherNamespace.nodeId != null && this.nodeId == null)) {
113 return false;
114 }
115 if (this.nodeId != null && otherNamespace.nodeId != null && !this.nodeId.equals(otherNamespace.nodeId)) {
116 return false;
117 }
118 }
119 return true;
120 }
121
122
123
124
125 public String getNodeId() {
126 return nodeId;
127 }
128
129
130
131
132 public ReceiverFormat[] getReceiverFormat() {
133 return receiverFormat;
134 }
135
136
137
138
139
140 public String getSourceString() {
141 return sourceString;
142 }
143
144
145
146
147 public String getLocalSourceString() {
148 return localSourceString;
149 }
150 }