| 5535 |
amar.kumar |
1 |
/**
|
|
|
2 |
* Autogenerated by Thrift Compiler (0.7.0)
|
|
|
3 |
*
|
|
|
4 |
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
*/
|
|
|
6 |
package in.shop2020.alert;
|
|
|
7 |
|
|
|
8 |
import java.util.List;
|
|
|
9 |
import java.util.ArrayList;
|
|
|
10 |
import java.util.Map;
|
|
|
11 |
import java.util.HashMap;
|
|
|
12 |
import java.util.EnumMap;
|
|
|
13 |
import java.util.Set;
|
|
|
14 |
import java.util.HashSet;
|
|
|
15 |
import java.util.EnumSet;
|
|
|
16 |
import java.util.Collections;
|
|
|
17 |
import java.util.BitSet;
|
|
|
18 |
import java.nio.ByteBuffer;
|
|
|
19 |
import java.util.Arrays;
|
|
|
20 |
import org.slf4j.Logger;
|
|
|
21 |
import org.slf4j.LoggerFactory;
|
|
|
22 |
|
|
|
23 |
public class AlertedEntity implements org.apache.thrift.TBase<AlertedEntity, AlertedEntity._Fields>, java.io.Serializable, Cloneable {
|
|
|
24 |
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlertedEntity");
|
|
|
25 |
|
|
|
26 |
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
|
|
|
27 |
private static final org.apache.thrift.protocol.TField ENTITY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("entityType", org.apache.thrift.protocol.TType.I32, (short)2);
|
|
|
28 |
private static final org.apache.thrift.protocol.TField EVENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("eventType", org.apache.thrift.protocol.TType.I32, (short)3);
|
|
|
29 |
private static final org.apache.thrift.protocol.TField ENTITY_IDENTIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("entityIdentifier", org.apache.thrift.protocol.TType.STRING, (short)4);
|
|
|
30 |
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)5);
|
|
|
31 |
private static final org.apache.thrift.protocol.TField ENTITY_PROCESSED_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("entityProcessedState", org.apache.thrift.protocol.TType.I32, (short)6);
|
|
|
32 |
private static final org.apache.thrift.protocol.TField LAST_ALERTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastAlertedTime", org.apache.thrift.protocol.TType.I64, (short)7);
|
|
|
33 |
|
|
|
34 |
private long id; // required
|
|
|
35 |
private EntityType entityType; // required
|
|
|
36 |
private int eventType; // required
|
|
|
37 |
private String entityIdentifier; // required
|
|
|
38 |
private String description; // required
|
|
|
39 |
private EntityProcessedState entityProcessedState; // required
|
|
|
40 |
private long lastAlertedTime; // required
|
|
|
41 |
|
|
|
42 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
|
|
43 |
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
|
|
44 |
ID((short)1, "id"),
|
|
|
45 |
/**
|
|
|
46 |
*
|
|
|
47 |
* @see EntityType
|
|
|
48 |
*/
|
|
|
49 |
ENTITY_TYPE((short)2, "entityType"),
|
|
|
50 |
EVENT_TYPE((short)3, "eventType"),
|
|
|
51 |
ENTITY_IDENTIFIER((short)4, "entityIdentifier"),
|
|
|
52 |
DESCRIPTION((short)5, "description"),
|
|
|
53 |
/**
|
|
|
54 |
*
|
|
|
55 |
* @see EntityProcessedState
|
|
|
56 |
*/
|
|
|
57 |
ENTITY_PROCESSED_STATE((short)6, "entityProcessedState"),
|
|
|
58 |
LAST_ALERTED_TIME((short)7, "lastAlertedTime");
|
|
|
59 |
|
|
|
60 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
61 |
|
|
|
62 |
static {
|
|
|
63 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
64 |
byName.put(field.getFieldName(), field);
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
/**
|
|
|
69 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
70 |
*/
|
|
|
71 |
public static _Fields findByThriftId(int fieldId) {
|
|
|
72 |
switch(fieldId) {
|
|
|
73 |
case 1: // ID
|
|
|
74 |
return ID;
|
|
|
75 |
case 2: // ENTITY_TYPE
|
|
|
76 |
return ENTITY_TYPE;
|
|
|
77 |
case 3: // EVENT_TYPE
|
|
|
78 |
return EVENT_TYPE;
|
|
|
79 |
case 4: // ENTITY_IDENTIFIER
|
|
|
80 |
return ENTITY_IDENTIFIER;
|
|
|
81 |
case 5: // DESCRIPTION
|
|
|
82 |
return DESCRIPTION;
|
|
|
83 |
case 6: // ENTITY_PROCESSED_STATE
|
|
|
84 |
return ENTITY_PROCESSED_STATE;
|
|
|
85 |
case 7: // LAST_ALERTED_TIME
|
|
|
86 |
return LAST_ALERTED_TIME;
|
|
|
87 |
default:
|
|
|
88 |
return null;
|
|
|
89 |
}
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
/**
|
|
|
93 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
94 |
* if it is not found.
|
|
|
95 |
*/
|
|
|
96 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
97 |
_Fields fields = findByThriftId(fieldId);
|
|
|
98 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
99 |
return fields;
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
/**
|
|
|
103 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
104 |
*/
|
|
|
105 |
public static _Fields findByName(String name) {
|
|
|
106 |
return byName.get(name);
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
private final short _thriftId;
|
|
|
110 |
private final String _fieldName;
|
|
|
111 |
|
|
|
112 |
_Fields(short thriftId, String fieldName) {
|
|
|
113 |
_thriftId = thriftId;
|
|
|
114 |
_fieldName = fieldName;
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
public short getThriftFieldId() {
|
|
|
118 |
return _thriftId;
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
public String getFieldName() {
|
|
|
122 |
return _fieldName;
|
|
|
123 |
}
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
// isset id assignments
|
|
|
127 |
private static final int __ID_ISSET_ID = 0;
|
|
|
128 |
private static final int __EVENTTYPE_ISSET_ID = 1;
|
|
|
129 |
private static final int __LASTALERTEDTIME_ISSET_ID = 2;
|
|
|
130 |
private BitSet __isset_bit_vector = new BitSet(3);
|
|
|
131 |
|
|
|
132 |
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
|
|
133 |
static {
|
|
|
134 |
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
|
|
135 |
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
136 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
137 |
tmpMap.put(_Fields.ENTITY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("entityType", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
138 |
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityType.class)));
|
|
|
139 |
tmpMap.put(_Fields.EVENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("eventType", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
140 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
|
|
141 |
tmpMap.put(_Fields.ENTITY_IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("entityIdentifier", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
142 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
|
143 |
tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
144 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
|
145 |
tmpMap.put(_Fields.ENTITY_PROCESSED_STATE, new org.apache.thrift.meta_data.FieldMetaData("entityProcessedState", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
146 |
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityProcessedState.class)));
|
|
|
147 |
tmpMap.put(_Fields.LAST_ALERTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastAlertedTime", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
148 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
149 |
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
|
|
150 |
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlertedEntity.class, metaDataMap);
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
public AlertedEntity() {
|
|
|
154 |
}
|
|
|
155 |
|
|
|
156 |
public AlertedEntity(
|
|
|
157 |
long id,
|
|
|
158 |
EntityType entityType,
|
|
|
159 |
int eventType,
|
|
|
160 |
String entityIdentifier,
|
|
|
161 |
String description,
|
|
|
162 |
EntityProcessedState entityProcessedState,
|
|
|
163 |
long lastAlertedTime)
|
|
|
164 |
{
|
|
|
165 |
this();
|
|
|
166 |
this.id = id;
|
|
|
167 |
setIdIsSet(true);
|
|
|
168 |
this.entityType = entityType;
|
|
|
169 |
this.eventType = eventType;
|
|
|
170 |
setEventTypeIsSet(true);
|
|
|
171 |
this.entityIdentifier = entityIdentifier;
|
|
|
172 |
this.description = description;
|
|
|
173 |
this.entityProcessedState = entityProcessedState;
|
|
|
174 |
this.lastAlertedTime = lastAlertedTime;
|
|
|
175 |
setLastAlertedTimeIsSet(true);
|
|
|
176 |
}
|
|
|
177 |
|
|
|
178 |
/**
|
|
|
179 |
* Performs a deep copy on <i>other</i>.
|
|
|
180 |
*/
|
|
|
181 |
public AlertedEntity(AlertedEntity other) {
|
|
|
182 |
__isset_bit_vector.clear();
|
|
|
183 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
184 |
this.id = other.id;
|
|
|
185 |
if (other.isSetEntityType()) {
|
|
|
186 |
this.entityType = other.entityType;
|
|
|
187 |
}
|
|
|
188 |
this.eventType = other.eventType;
|
|
|
189 |
if (other.isSetEntityIdentifier()) {
|
|
|
190 |
this.entityIdentifier = other.entityIdentifier;
|
|
|
191 |
}
|
|
|
192 |
if (other.isSetDescription()) {
|
|
|
193 |
this.description = other.description;
|
|
|
194 |
}
|
|
|
195 |
if (other.isSetEntityProcessedState()) {
|
|
|
196 |
this.entityProcessedState = other.entityProcessedState;
|
|
|
197 |
}
|
|
|
198 |
this.lastAlertedTime = other.lastAlertedTime;
|
|
|
199 |
}
|
|
|
200 |
|
|
|
201 |
public AlertedEntity deepCopy() {
|
|
|
202 |
return new AlertedEntity(this);
|
|
|
203 |
}
|
|
|
204 |
|
|
|
205 |
@Override
|
|
|
206 |
public void clear() {
|
|
|
207 |
setIdIsSet(false);
|
|
|
208 |
this.id = 0;
|
|
|
209 |
this.entityType = null;
|
|
|
210 |
setEventTypeIsSet(false);
|
|
|
211 |
this.eventType = 0;
|
|
|
212 |
this.entityIdentifier = null;
|
|
|
213 |
this.description = null;
|
|
|
214 |
this.entityProcessedState = null;
|
|
|
215 |
setLastAlertedTimeIsSet(false);
|
|
|
216 |
this.lastAlertedTime = 0;
|
|
|
217 |
}
|
|
|
218 |
|
|
|
219 |
public long getId() {
|
|
|
220 |
return this.id;
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
public void setId(long id) {
|
|
|
224 |
this.id = id;
|
|
|
225 |
setIdIsSet(true);
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
public void unsetId() {
|
|
|
229 |
__isset_bit_vector.clear(__ID_ISSET_ID);
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
/** Returns true if field id is set (has been assigned a value) and false otherwise */
|
|
|
233 |
public boolean isSetId() {
|
|
|
234 |
return __isset_bit_vector.get(__ID_ISSET_ID);
|
|
|
235 |
}
|
|
|
236 |
|
|
|
237 |
public void setIdIsSet(boolean value) {
|
|
|
238 |
__isset_bit_vector.set(__ID_ISSET_ID, value);
|
|
|
239 |
}
|
|
|
240 |
|
|
|
241 |
/**
|
|
|
242 |
*
|
|
|
243 |
* @see EntityType
|
|
|
244 |
*/
|
|
|
245 |
public EntityType getEntityType() {
|
|
|
246 |
return this.entityType;
|
|
|
247 |
}
|
|
|
248 |
|
|
|
249 |
/**
|
|
|
250 |
*
|
|
|
251 |
* @see EntityType
|
|
|
252 |
*/
|
|
|
253 |
public void setEntityType(EntityType entityType) {
|
|
|
254 |
this.entityType = entityType;
|
|
|
255 |
}
|
|
|
256 |
|
|
|
257 |
public void unsetEntityType() {
|
|
|
258 |
this.entityType = null;
|
|
|
259 |
}
|
|
|
260 |
|
|
|
261 |
/** Returns true if field entityType is set (has been assigned a value) and false otherwise */
|
|
|
262 |
public boolean isSetEntityType() {
|
|
|
263 |
return this.entityType != null;
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
public void setEntityTypeIsSet(boolean value) {
|
|
|
267 |
if (!value) {
|
|
|
268 |
this.entityType = null;
|
|
|
269 |
}
|
|
|
270 |
}
|
|
|
271 |
|
|
|
272 |
public int getEventType() {
|
|
|
273 |
return this.eventType;
|
|
|
274 |
}
|
|
|
275 |
|
|
|
276 |
public void setEventType(int eventType) {
|
|
|
277 |
this.eventType = eventType;
|
|
|
278 |
setEventTypeIsSet(true);
|
|
|
279 |
}
|
|
|
280 |
|
|
|
281 |
public void unsetEventType() {
|
|
|
282 |
__isset_bit_vector.clear(__EVENTTYPE_ISSET_ID);
|
|
|
283 |
}
|
|
|
284 |
|
|
|
285 |
/** Returns true if field eventType is set (has been assigned a value) and false otherwise */
|
|
|
286 |
public boolean isSetEventType() {
|
|
|
287 |
return __isset_bit_vector.get(__EVENTTYPE_ISSET_ID);
|
|
|
288 |
}
|
|
|
289 |
|
|
|
290 |
public void setEventTypeIsSet(boolean value) {
|
|
|
291 |
__isset_bit_vector.set(__EVENTTYPE_ISSET_ID, value);
|
|
|
292 |
}
|
|
|
293 |
|
|
|
294 |
public String getEntityIdentifier() {
|
|
|
295 |
return this.entityIdentifier;
|
|
|
296 |
}
|
|
|
297 |
|
|
|
298 |
public void setEntityIdentifier(String entityIdentifier) {
|
|
|
299 |
this.entityIdentifier = entityIdentifier;
|
|
|
300 |
}
|
|
|
301 |
|
|
|
302 |
public void unsetEntityIdentifier() {
|
|
|
303 |
this.entityIdentifier = null;
|
|
|
304 |
}
|
|
|
305 |
|
|
|
306 |
/** Returns true if field entityIdentifier is set (has been assigned a value) and false otherwise */
|
|
|
307 |
public boolean isSetEntityIdentifier() {
|
|
|
308 |
return this.entityIdentifier != null;
|
|
|
309 |
}
|
|
|
310 |
|
|
|
311 |
public void setEntityIdentifierIsSet(boolean value) {
|
|
|
312 |
if (!value) {
|
|
|
313 |
this.entityIdentifier = null;
|
|
|
314 |
}
|
|
|
315 |
}
|
|
|
316 |
|
|
|
317 |
public String getDescription() {
|
|
|
318 |
return this.description;
|
|
|
319 |
}
|
|
|
320 |
|
|
|
321 |
public void setDescription(String description) {
|
|
|
322 |
this.description = description;
|
|
|
323 |
}
|
|
|
324 |
|
|
|
325 |
public void unsetDescription() {
|
|
|
326 |
this.description = null;
|
|
|
327 |
}
|
|
|
328 |
|
|
|
329 |
/** Returns true if field description is set (has been assigned a value) and false otherwise */
|
|
|
330 |
public boolean isSetDescription() {
|
|
|
331 |
return this.description != null;
|
|
|
332 |
}
|
|
|
333 |
|
|
|
334 |
public void setDescriptionIsSet(boolean value) {
|
|
|
335 |
if (!value) {
|
|
|
336 |
this.description = null;
|
|
|
337 |
}
|
|
|
338 |
}
|
|
|
339 |
|
|
|
340 |
/**
|
|
|
341 |
*
|
|
|
342 |
* @see EntityProcessedState
|
|
|
343 |
*/
|
|
|
344 |
public EntityProcessedState getEntityProcessedState() {
|
|
|
345 |
return this.entityProcessedState;
|
|
|
346 |
}
|
|
|
347 |
|
|
|
348 |
/**
|
|
|
349 |
*
|
|
|
350 |
* @see EntityProcessedState
|
|
|
351 |
*/
|
|
|
352 |
public void setEntityProcessedState(EntityProcessedState entityProcessedState) {
|
|
|
353 |
this.entityProcessedState = entityProcessedState;
|
|
|
354 |
}
|
|
|
355 |
|
|
|
356 |
public void unsetEntityProcessedState() {
|
|
|
357 |
this.entityProcessedState = null;
|
|
|
358 |
}
|
|
|
359 |
|
|
|
360 |
/** Returns true if field entityProcessedState is set (has been assigned a value) and false otherwise */
|
|
|
361 |
public boolean isSetEntityProcessedState() {
|
|
|
362 |
return this.entityProcessedState != null;
|
|
|
363 |
}
|
|
|
364 |
|
|
|
365 |
public void setEntityProcessedStateIsSet(boolean value) {
|
|
|
366 |
if (!value) {
|
|
|
367 |
this.entityProcessedState = null;
|
|
|
368 |
}
|
|
|
369 |
}
|
|
|
370 |
|
|
|
371 |
public long getLastAlertedTime() {
|
|
|
372 |
return this.lastAlertedTime;
|
|
|
373 |
}
|
|
|
374 |
|
|
|
375 |
public void setLastAlertedTime(long lastAlertedTime) {
|
|
|
376 |
this.lastAlertedTime = lastAlertedTime;
|
|
|
377 |
setLastAlertedTimeIsSet(true);
|
|
|
378 |
}
|
|
|
379 |
|
|
|
380 |
public void unsetLastAlertedTime() {
|
|
|
381 |
__isset_bit_vector.clear(__LASTALERTEDTIME_ISSET_ID);
|
|
|
382 |
}
|
|
|
383 |
|
|
|
384 |
/** Returns true if field lastAlertedTime is set (has been assigned a value) and false otherwise */
|
|
|
385 |
public boolean isSetLastAlertedTime() {
|
|
|
386 |
return __isset_bit_vector.get(__LASTALERTEDTIME_ISSET_ID);
|
|
|
387 |
}
|
|
|
388 |
|
|
|
389 |
public void setLastAlertedTimeIsSet(boolean value) {
|
|
|
390 |
__isset_bit_vector.set(__LASTALERTEDTIME_ISSET_ID, value);
|
|
|
391 |
}
|
|
|
392 |
|
|
|
393 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
394 |
switch (field) {
|
|
|
395 |
case ID:
|
|
|
396 |
if (value == null) {
|
|
|
397 |
unsetId();
|
|
|
398 |
} else {
|
|
|
399 |
setId((Long)value);
|
|
|
400 |
}
|
|
|
401 |
break;
|
|
|
402 |
|
|
|
403 |
case ENTITY_TYPE:
|
|
|
404 |
if (value == null) {
|
|
|
405 |
unsetEntityType();
|
|
|
406 |
} else {
|
|
|
407 |
setEntityType((EntityType)value);
|
|
|
408 |
}
|
|
|
409 |
break;
|
|
|
410 |
|
|
|
411 |
case EVENT_TYPE:
|
|
|
412 |
if (value == null) {
|
|
|
413 |
unsetEventType();
|
|
|
414 |
} else {
|
|
|
415 |
setEventType((Integer)value);
|
|
|
416 |
}
|
|
|
417 |
break;
|
|
|
418 |
|
|
|
419 |
case ENTITY_IDENTIFIER:
|
|
|
420 |
if (value == null) {
|
|
|
421 |
unsetEntityIdentifier();
|
|
|
422 |
} else {
|
|
|
423 |
setEntityIdentifier((String)value);
|
|
|
424 |
}
|
|
|
425 |
break;
|
|
|
426 |
|
|
|
427 |
case DESCRIPTION:
|
|
|
428 |
if (value == null) {
|
|
|
429 |
unsetDescription();
|
|
|
430 |
} else {
|
|
|
431 |
setDescription((String)value);
|
|
|
432 |
}
|
|
|
433 |
break;
|
|
|
434 |
|
|
|
435 |
case ENTITY_PROCESSED_STATE:
|
|
|
436 |
if (value == null) {
|
|
|
437 |
unsetEntityProcessedState();
|
|
|
438 |
} else {
|
|
|
439 |
setEntityProcessedState((EntityProcessedState)value);
|
|
|
440 |
}
|
|
|
441 |
break;
|
|
|
442 |
|
|
|
443 |
case LAST_ALERTED_TIME:
|
|
|
444 |
if (value == null) {
|
|
|
445 |
unsetLastAlertedTime();
|
|
|
446 |
} else {
|
|
|
447 |
setLastAlertedTime((Long)value);
|
|
|
448 |
}
|
|
|
449 |
break;
|
|
|
450 |
|
|
|
451 |
}
|
|
|
452 |
}
|
|
|
453 |
|
|
|
454 |
public Object getFieldValue(_Fields field) {
|
|
|
455 |
switch (field) {
|
|
|
456 |
case ID:
|
|
|
457 |
return Long.valueOf(getId());
|
|
|
458 |
|
|
|
459 |
case ENTITY_TYPE:
|
|
|
460 |
return getEntityType();
|
|
|
461 |
|
|
|
462 |
case EVENT_TYPE:
|
|
|
463 |
return Integer.valueOf(getEventType());
|
|
|
464 |
|
|
|
465 |
case ENTITY_IDENTIFIER:
|
|
|
466 |
return getEntityIdentifier();
|
|
|
467 |
|
|
|
468 |
case DESCRIPTION:
|
|
|
469 |
return getDescription();
|
|
|
470 |
|
|
|
471 |
case ENTITY_PROCESSED_STATE:
|
|
|
472 |
return getEntityProcessedState();
|
|
|
473 |
|
|
|
474 |
case LAST_ALERTED_TIME:
|
|
|
475 |
return Long.valueOf(getLastAlertedTime());
|
|
|
476 |
|
|
|
477 |
}
|
|
|
478 |
throw new IllegalStateException();
|
|
|
479 |
}
|
|
|
480 |
|
|
|
481 |
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
|
|
482 |
public boolean isSet(_Fields field) {
|
|
|
483 |
if (field == null) {
|
|
|
484 |
throw new IllegalArgumentException();
|
|
|
485 |
}
|
|
|
486 |
|
|
|
487 |
switch (field) {
|
|
|
488 |
case ID:
|
|
|
489 |
return isSetId();
|
|
|
490 |
case ENTITY_TYPE:
|
|
|
491 |
return isSetEntityType();
|
|
|
492 |
case EVENT_TYPE:
|
|
|
493 |
return isSetEventType();
|
|
|
494 |
case ENTITY_IDENTIFIER:
|
|
|
495 |
return isSetEntityIdentifier();
|
|
|
496 |
case DESCRIPTION:
|
|
|
497 |
return isSetDescription();
|
|
|
498 |
case ENTITY_PROCESSED_STATE:
|
|
|
499 |
return isSetEntityProcessedState();
|
|
|
500 |
case LAST_ALERTED_TIME:
|
|
|
501 |
return isSetLastAlertedTime();
|
|
|
502 |
}
|
|
|
503 |
throw new IllegalStateException();
|
|
|
504 |
}
|
|
|
505 |
|
|
|
506 |
@Override
|
|
|
507 |
public boolean equals(Object that) {
|
|
|
508 |
if (that == null)
|
|
|
509 |
return false;
|
|
|
510 |
if (that instanceof AlertedEntity)
|
|
|
511 |
return this.equals((AlertedEntity)that);
|
|
|
512 |
return false;
|
|
|
513 |
}
|
|
|
514 |
|
|
|
515 |
public boolean equals(AlertedEntity that) {
|
|
|
516 |
if (that == null)
|
|
|
517 |
return false;
|
|
|
518 |
|
|
|
519 |
boolean this_present_id = true;
|
|
|
520 |
boolean that_present_id = true;
|
|
|
521 |
if (this_present_id || that_present_id) {
|
|
|
522 |
if (!(this_present_id && that_present_id))
|
|
|
523 |
return false;
|
|
|
524 |
if (this.id != that.id)
|
|
|
525 |
return false;
|
|
|
526 |
}
|
|
|
527 |
|
|
|
528 |
boolean this_present_entityType = true && this.isSetEntityType();
|
|
|
529 |
boolean that_present_entityType = true && that.isSetEntityType();
|
|
|
530 |
if (this_present_entityType || that_present_entityType) {
|
|
|
531 |
if (!(this_present_entityType && that_present_entityType))
|
|
|
532 |
return false;
|
|
|
533 |
if (!this.entityType.equals(that.entityType))
|
|
|
534 |
return false;
|
|
|
535 |
}
|
|
|
536 |
|
|
|
537 |
boolean this_present_eventType = true;
|
|
|
538 |
boolean that_present_eventType = true;
|
|
|
539 |
if (this_present_eventType || that_present_eventType) {
|
|
|
540 |
if (!(this_present_eventType && that_present_eventType))
|
|
|
541 |
return false;
|
|
|
542 |
if (this.eventType != that.eventType)
|
|
|
543 |
return false;
|
|
|
544 |
}
|
|
|
545 |
|
|
|
546 |
boolean this_present_entityIdentifier = true && this.isSetEntityIdentifier();
|
|
|
547 |
boolean that_present_entityIdentifier = true && that.isSetEntityIdentifier();
|
|
|
548 |
if (this_present_entityIdentifier || that_present_entityIdentifier) {
|
|
|
549 |
if (!(this_present_entityIdentifier && that_present_entityIdentifier))
|
|
|
550 |
return false;
|
|
|
551 |
if (!this.entityIdentifier.equals(that.entityIdentifier))
|
|
|
552 |
return false;
|
|
|
553 |
}
|
|
|
554 |
|
|
|
555 |
boolean this_present_description = true && this.isSetDescription();
|
|
|
556 |
boolean that_present_description = true && that.isSetDescription();
|
|
|
557 |
if (this_present_description || that_present_description) {
|
|
|
558 |
if (!(this_present_description && that_present_description))
|
|
|
559 |
return false;
|
|
|
560 |
if (!this.description.equals(that.description))
|
|
|
561 |
return false;
|
|
|
562 |
}
|
|
|
563 |
|
|
|
564 |
boolean this_present_entityProcessedState = true && this.isSetEntityProcessedState();
|
|
|
565 |
boolean that_present_entityProcessedState = true && that.isSetEntityProcessedState();
|
|
|
566 |
if (this_present_entityProcessedState || that_present_entityProcessedState) {
|
|
|
567 |
if (!(this_present_entityProcessedState && that_present_entityProcessedState))
|
|
|
568 |
return false;
|
|
|
569 |
if (!this.entityProcessedState.equals(that.entityProcessedState))
|
|
|
570 |
return false;
|
|
|
571 |
}
|
|
|
572 |
|
|
|
573 |
boolean this_present_lastAlertedTime = true;
|
|
|
574 |
boolean that_present_lastAlertedTime = true;
|
|
|
575 |
if (this_present_lastAlertedTime || that_present_lastAlertedTime) {
|
|
|
576 |
if (!(this_present_lastAlertedTime && that_present_lastAlertedTime))
|
|
|
577 |
return false;
|
|
|
578 |
if (this.lastAlertedTime != that.lastAlertedTime)
|
|
|
579 |
return false;
|
|
|
580 |
}
|
|
|
581 |
|
|
|
582 |
return true;
|
|
|
583 |
}
|
|
|
584 |
|
|
|
585 |
@Override
|
|
|
586 |
public int hashCode() {
|
|
|
587 |
return 0;
|
|
|
588 |
}
|
|
|
589 |
|
|
|
590 |
public int compareTo(AlertedEntity other) {
|
|
|
591 |
if (!getClass().equals(other.getClass())) {
|
|
|
592 |
return getClass().getName().compareTo(other.getClass().getName());
|
|
|
593 |
}
|
|
|
594 |
|
|
|
595 |
int lastComparison = 0;
|
|
|
596 |
AlertedEntity typedOther = (AlertedEntity)other;
|
|
|
597 |
|
|
|
598 |
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
|
|
|
599 |
if (lastComparison != 0) {
|
|
|
600 |
return lastComparison;
|
|
|
601 |
}
|
|
|
602 |
if (isSetId()) {
|
|
|
603 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
|
|
|
604 |
if (lastComparison != 0) {
|
|
|
605 |
return lastComparison;
|
|
|
606 |
}
|
|
|
607 |
}
|
|
|
608 |
lastComparison = Boolean.valueOf(isSetEntityType()).compareTo(typedOther.isSetEntityType());
|
|
|
609 |
if (lastComparison != 0) {
|
|
|
610 |
return lastComparison;
|
|
|
611 |
}
|
|
|
612 |
if (isSetEntityType()) {
|
|
|
613 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityType, typedOther.entityType);
|
|
|
614 |
if (lastComparison != 0) {
|
|
|
615 |
return lastComparison;
|
|
|
616 |
}
|
|
|
617 |
}
|
|
|
618 |
lastComparison = Boolean.valueOf(isSetEventType()).compareTo(typedOther.isSetEventType());
|
|
|
619 |
if (lastComparison != 0) {
|
|
|
620 |
return lastComparison;
|
|
|
621 |
}
|
|
|
622 |
if (isSetEventType()) {
|
|
|
623 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventType, typedOther.eventType);
|
|
|
624 |
if (lastComparison != 0) {
|
|
|
625 |
return lastComparison;
|
|
|
626 |
}
|
|
|
627 |
}
|
|
|
628 |
lastComparison = Boolean.valueOf(isSetEntityIdentifier()).compareTo(typedOther.isSetEntityIdentifier());
|
|
|
629 |
if (lastComparison != 0) {
|
|
|
630 |
return lastComparison;
|
|
|
631 |
}
|
|
|
632 |
if (isSetEntityIdentifier()) {
|
|
|
633 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityIdentifier, typedOther.entityIdentifier);
|
|
|
634 |
if (lastComparison != 0) {
|
|
|
635 |
return lastComparison;
|
|
|
636 |
}
|
|
|
637 |
}
|
|
|
638 |
lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
|
|
|
639 |
if (lastComparison != 0) {
|
|
|
640 |
return lastComparison;
|
|
|
641 |
}
|
|
|
642 |
if (isSetDescription()) {
|
|
|
643 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
|
|
|
644 |
if (lastComparison != 0) {
|
|
|
645 |
return lastComparison;
|
|
|
646 |
}
|
|
|
647 |
}
|
|
|
648 |
lastComparison = Boolean.valueOf(isSetEntityProcessedState()).compareTo(typedOther.isSetEntityProcessedState());
|
|
|
649 |
if (lastComparison != 0) {
|
|
|
650 |
return lastComparison;
|
|
|
651 |
}
|
|
|
652 |
if (isSetEntityProcessedState()) {
|
|
|
653 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityProcessedState, typedOther.entityProcessedState);
|
|
|
654 |
if (lastComparison != 0) {
|
|
|
655 |
return lastComparison;
|
|
|
656 |
}
|
|
|
657 |
}
|
|
|
658 |
lastComparison = Boolean.valueOf(isSetLastAlertedTime()).compareTo(typedOther.isSetLastAlertedTime());
|
|
|
659 |
if (lastComparison != 0) {
|
|
|
660 |
return lastComparison;
|
|
|
661 |
}
|
|
|
662 |
if (isSetLastAlertedTime()) {
|
|
|
663 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastAlertedTime, typedOther.lastAlertedTime);
|
|
|
664 |
if (lastComparison != 0) {
|
|
|
665 |
return lastComparison;
|
|
|
666 |
}
|
|
|
667 |
}
|
|
|
668 |
return 0;
|
|
|
669 |
}
|
|
|
670 |
|
|
|
671 |
public _Fields fieldForId(int fieldId) {
|
|
|
672 |
return _Fields.findByThriftId(fieldId);
|
|
|
673 |
}
|
|
|
674 |
|
|
|
675 |
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
|
|
676 |
org.apache.thrift.protocol.TField field;
|
|
|
677 |
iprot.readStructBegin();
|
|
|
678 |
while (true)
|
|
|
679 |
{
|
|
|
680 |
field = iprot.readFieldBegin();
|
|
|
681 |
if (field.type == org.apache.thrift.protocol.TType.STOP) {
|
|
|
682 |
break;
|
|
|
683 |
}
|
|
|
684 |
switch (field.id) {
|
|
|
685 |
case 1: // ID
|
|
|
686 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
687 |
this.id = iprot.readI64();
|
|
|
688 |
setIdIsSet(true);
|
|
|
689 |
} else {
|
|
|
690 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
691 |
}
|
|
|
692 |
break;
|
|
|
693 |
case 2: // ENTITY_TYPE
|
|
|
694 |
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
|
|
695 |
this.entityType = EntityType.findByValue(iprot.readI32());
|
|
|
696 |
} else {
|
|
|
697 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
698 |
}
|
|
|
699 |
break;
|
|
|
700 |
case 3: // EVENT_TYPE
|
|
|
701 |
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
|
|
702 |
this.eventType = iprot.readI32();
|
|
|
703 |
setEventTypeIsSet(true);
|
|
|
704 |
} else {
|
|
|
705 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
706 |
}
|
|
|
707 |
break;
|
|
|
708 |
case 4: // ENTITY_IDENTIFIER
|
|
|
709 |
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
|
|
710 |
this.entityIdentifier = iprot.readString();
|
|
|
711 |
} else {
|
|
|
712 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
713 |
}
|
|
|
714 |
break;
|
|
|
715 |
case 5: // DESCRIPTION
|
|
|
716 |
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
|
|
717 |
this.description = iprot.readString();
|
|
|
718 |
} else {
|
|
|
719 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
720 |
}
|
|
|
721 |
break;
|
|
|
722 |
case 6: // ENTITY_PROCESSED_STATE
|
|
|
723 |
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
|
|
724 |
this.entityProcessedState = EntityProcessedState.findByValue(iprot.readI32());
|
|
|
725 |
} else {
|
|
|
726 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
727 |
}
|
|
|
728 |
break;
|
|
|
729 |
case 7: // LAST_ALERTED_TIME
|
|
|
730 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
731 |
this.lastAlertedTime = iprot.readI64();
|
|
|
732 |
setLastAlertedTimeIsSet(true);
|
|
|
733 |
} else {
|
|
|
734 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
735 |
}
|
|
|
736 |
break;
|
|
|
737 |
default:
|
|
|
738 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
739 |
}
|
|
|
740 |
iprot.readFieldEnd();
|
|
|
741 |
}
|
|
|
742 |
iprot.readStructEnd();
|
|
|
743 |
validate();
|
|
|
744 |
}
|
|
|
745 |
|
|
|
746 |
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
|
|
747 |
validate();
|
|
|
748 |
|
|
|
749 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
750 |
oprot.writeFieldBegin(ID_FIELD_DESC);
|
|
|
751 |
oprot.writeI64(this.id);
|
|
|
752 |
oprot.writeFieldEnd();
|
|
|
753 |
if (this.entityType != null) {
|
|
|
754 |
oprot.writeFieldBegin(ENTITY_TYPE_FIELD_DESC);
|
|
|
755 |
oprot.writeI32(this.entityType.getValue());
|
|
|
756 |
oprot.writeFieldEnd();
|
|
|
757 |
}
|
|
|
758 |
oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC);
|
|
|
759 |
oprot.writeI32(this.eventType);
|
|
|
760 |
oprot.writeFieldEnd();
|
|
|
761 |
if (this.entityIdentifier != null) {
|
|
|
762 |
oprot.writeFieldBegin(ENTITY_IDENTIFIER_FIELD_DESC);
|
|
|
763 |
oprot.writeString(this.entityIdentifier);
|
|
|
764 |
oprot.writeFieldEnd();
|
|
|
765 |
}
|
|
|
766 |
if (this.description != null) {
|
|
|
767 |
oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
|
|
|
768 |
oprot.writeString(this.description);
|
|
|
769 |
oprot.writeFieldEnd();
|
|
|
770 |
}
|
|
|
771 |
if (this.entityProcessedState != null) {
|
|
|
772 |
oprot.writeFieldBegin(ENTITY_PROCESSED_STATE_FIELD_DESC);
|
|
|
773 |
oprot.writeI32(this.entityProcessedState.getValue());
|
|
|
774 |
oprot.writeFieldEnd();
|
|
|
775 |
}
|
|
|
776 |
oprot.writeFieldBegin(LAST_ALERTED_TIME_FIELD_DESC);
|
|
|
777 |
oprot.writeI64(this.lastAlertedTime);
|
|
|
778 |
oprot.writeFieldEnd();
|
|
|
779 |
oprot.writeFieldStop();
|
|
|
780 |
oprot.writeStructEnd();
|
|
|
781 |
}
|
|
|
782 |
|
|
|
783 |
@Override
|
|
|
784 |
public String toString() {
|
|
|
785 |
StringBuilder sb = new StringBuilder("AlertedEntity(");
|
|
|
786 |
boolean first = true;
|
|
|
787 |
|
|
|
788 |
sb.append("id:");
|
|
|
789 |
sb.append(this.id);
|
|
|
790 |
first = false;
|
|
|
791 |
if (!first) sb.append(", ");
|
|
|
792 |
sb.append("entityType:");
|
|
|
793 |
if (this.entityType == null) {
|
|
|
794 |
sb.append("null");
|
|
|
795 |
} else {
|
|
|
796 |
sb.append(this.entityType);
|
|
|
797 |
}
|
|
|
798 |
first = false;
|
|
|
799 |
if (!first) sb.append(", ");
|
|
|
800 |
sb.append("eventType:");
|
|
|
801 |
sb.append(this.eventType);
|
|
|
802 |
first = false;
|
|
|
803 |
if (!first) sb.append(", ");
|
|
|
804 |
sb.append("entityIdentifier:");
|
|
|
805 |
if (this.entityIdentifier == null) {
|
|
|
806 |
sb.append("null");
|
|
|
807 |
} else {
|
|
|
808 |
sb.append(this.entityIdentifier);
|
|
|
809 |
}
|
|
|
810 |
first = false;
|
|
|
811 |
if (!first) sb.append(", ");
|
|
|
812 |
sb.append("description:");
|
|
|
813 |
if (this.description == null) {
|
|
|
814 |
sb.append("null");
|
|
|
815 |
} else {
|
|
|
816 |
sb.append(this.description);
|
|
|
817 |
}
|
|
|
818 |
first = false;
|
|
|
819 |
if (!first) sb.append(", ");
|
|
|
820 |
sb.append("entityProcessedState:");
|
|
|
821 |
if (this.entityProcessedState == null) {
|
|
|
822 |
sb.append("null");
|
|
|
823 |
} else {
|
|
|
824 |
sb.append(this.entityProcessedState);
|
|
|
825 |
}
|
|
|
826 |
first = false;
|
|
|
827 |
if (!first) sb.append(", ");
|
|
|
828 |
sb.append("lastAlertedTime:");
|
|
|
829 |
sb.append(this.lastAlertedTime);
|
|
|
830 |
first = false;
|
|
|
831 |
sb.append(")");
|
|
|
832 |
return sb.toString();
|
|
|
833 |
}
|
|
|
834 |
|
|
|
835 |
public void validate() throws org.apache.thrift.TException {
|
|
|
836 |
// check for required fields
|
|
|
837 |
}
|
|
|
838 |
|
|
|
839 |
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
|
|
840 |
try {
|
|
|
841 |
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
|
|
|
842 |
} catch (org.apache.thrift.TException te) {
|
|
|
843 |
throw new java.io.IOException(te);
|
|
|
844 |
}
|
|
|
845 |
}
|
|
|
846 |
|
|
|
847 |
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
|
|
|
848 |
try {
|
|
|
849 |
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
|
|
|
850 |
__isset_bit_vector = new BitSet(1);
|
|
|
851 |
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
|
|
|
852 |
} catch (org.apache.thrift.TException te) {
|
|
|
853 |
throw new java.io.IOException(te);
|
|
|
854 |
}
|
|
|
855 |
}
|
|
|
856 |
|
|
|
857 |
}
|
|
|
858 |
|