public Event deepCopy() { return new Event(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Event) return this.equals((Event)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case USER_ID: return getUserId(); case TENANT_ID: return getTenantId(); case ENDPOINT_EVENT: return getEndpointEvent(); case ROUTE_ADDRESS: return getRouteAddress(); } throw new IllegalStateException(); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case USER_ID: return isSetUserId(); case TENANT_ID: return isSetTenantId(); case ENDPOINT_EVENT: return isSetEndpointEvent(); case ROUTE_ADDRESS: return isSetRouteAddress(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public Event(Event other) { if (other.isSetUserId()) { this.userId = other.userId; } if (other.isSetTenantId()) { this.tenantId = other.tenantId; } if (other.isSetEndpointEvent()) { this.endpointEvent = new EndpointEvent(other.endpointEvent); } if (other.isSetRouteAddress()) { this.routeAddress = new RouteAddress(other.routeAddress); } }
LOG.debug("Event: {}", event.toString()); for (EventServiceListener listener : listeners) { org.kaaproject.kaa.server.sync.Event localEvent; try { localEvent = AvroEncDec.convert(eventConverter.get().fromByteArray( event.getEndpointEvent().getEventData())); EndpointEvent endpointEvent = new EndpointEvent( EndpointObjectHash.fromBytes(event.getEndpointEvent().getSender()), localEvent, UUID.fromString( event.getEndpointEvent().getUuid()), event.getEndpointEvent().getCreateTime(), event.getEndpointEvent().getVersion()); RouteTableAddress recipient = new RouteTableAddress( EndpointObjectHash.fromBytes(event.getRouteAddress().getEndpointKey()), event.getRouteAddress().getApplicationToken(), event.getRouteAddress().getOperationsServerId()); RemoteEndpointEvent remoteEvent = new RemoteEndpointEvent( event.getTenantId(), event.getUserId(), endpointEvent, recipient); listener.onEvent(remoteEvent); } catch (IOException ex) {
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_userId = true && (isSetUserId()); list.add(present_userId); if (present_userId) list.add(userId); boolean present_tenantId = true && (isSetTenantId()); list.add(present_tenantId); if (present_tenantId) list.add(tenantId); boolean present_endpointEvent = true && (isSetEndpointEvent()); list.add(present_endpointEvent); if (present_endpointEvent) list.add(endpointEvent); boolean present_routeAddress = true && (isSetRouteAddress()); list.add(present_routeAddress); if (present_routeAddress) list.add(routeAddress); return list.hashCode(); }
if (!(this_present_event && that_present_event)) return false; if (!this.event.equals(that.event)) return false;
remoteEndpointEvent.getEvent() .getCreateTime(), remoteEndpointEvent.getEvent().getVersion()); Event event = new Event( remoteEndpointEvent.getUserId(), remoteEndpointEvent.getTenantId(),
return false; boolean this_present_userId = true && this.isSetUserId(); boolean that_present_userId = true && that.isSetUserId(); if (this_present_userId || that_present_userId) { if (!(this_present_userId && that_present_userId)) boolean this_present_tenantId = true && this.isSetTenantId(); boolean that_present_tenantId = true && that.isSetTenantId(); if (this_present_tenantId || that_present_tenantId) { if (!(this_present_tenantId && that_present_tenantId)) boolean this_present_endpointEvent = true && this.isSetEndpointEvent(); boolean that_present_endpointEvent = true && that.isSetEndpointEvent(); if (this_present_endpointEvent || that_present_endpointEvent) { if (!(this_present_endpointEvent && that_present_endpointEvent)) boolean this_present_routeAddress = true && this.isSetRouteAddress(); boolean that_present_routeAddress = true && that.isSetRouteAddress(); if (this_present_routeAddress || that_present_routeAddress) { if (!(this_present_routeAddress && that_present_routeAddress))
void removeEvent(Event event) { foreach(event e in this.events) { if(event.equals(e)) { // remove e from the events array } } }
/** * Performs a deep copy on <i>other</i>. */ public Message(Message other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetType()) { this.type = other.type; } this.eventId = other.eventId; if (other.isSetEvent()) { this.event = new Event(other.event); } if (other.isSetRoute()) { this.route = new EventRoute(other.route); } if (other.isSetUserRoute()) { this.userRoute = new UserRouteInfo(other.userRoute); } if (other.isSetEndpointRouteUpdate()) { this.endpointRouteUpdate = new EndpointRouteUpdate(other.endpointRouteUpdate); } if (other.isSetEndpointStateUpdate()) { this.endpointStateUpdate = new EndpointStateUpdate(other.endpointStateUpdate); } }
lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId()); if (lastComparison != 0) { return lastComparison; if (isSetUserId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetTenantId()).compareTo(other.isSetTenantId()); if (lastComparison != 0) { return lastComparison; if (isSetTenantId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tenantId, other.tenantId); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetEndpointEvent()).compareTo(other.isSetEndpointEvent()); if (lastComparison != 0) { return lastComparison; if (isSetEndpointEvent()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endpointEvent, other.endpointEvent); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetRouteAddress()).compareTo(other.isSetRouteAddress()); if (lastComparison != 0) { return lastComparison; if (isSetRouteAddress()) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, Event struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetUserId()) { optionals.set(0); } if (struct.isSetTenantId()) { optionals.set(1); } if (struct.isSetEndpointEvent()) { optionals.set(2); } if (struct.isSetRouteAddress()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetUserId()) { oprot.writeString(struct.userId); } if (struct.isSetTenantId()) { oprot.writeString(struct.tenantId); } if (struct.isSetEndpointEvent()) { struct.endpointEvent.write(oprot); } if (struct.isSetRouteAddress()) { struct.routeAddress.write(oprot); } }