private ThriftEntityAddress toEntityAddress(EntityClusterAddress source) { ThriftEntityAddress address = new ThriftEntityAddress(); address.setTenantId(source.getTenantId()); address.setApplicationToken(source.getAppToken()); address.setEntityId(source.getEntityId()); return address; }
public Object getFieldValue(_Fields field) { switch (field) { case TENANT_ID: return getTenantId(); case APPLICATION_TOKEN: return getApplicationToken(); case ENTITY_TYPE: return getEntityType(); case ENTITY_ID: return getEntityId(); } throw new IllegalStateException(); }
case TENANT_ID: if (value == null) { unsetTenantId(); } else { setTenantId((String)value); unsetApplicationToken(); } else { setApplicationToken((String)value); unsetEntityType(); } else { setEntityType((ThriftClusterEntityType)value); unsetEntityId(); } else { setEntityId((ByteBuffer)value);
private EndpointAddress fromThriftAddress(ThriftEntityAddress source) { return new EndpointAddress( source.getTenantId(), source.getApplicationToken(), EndpointObjectHash.fromBytes(source.getEntityId())); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftEntityClusterAddress struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.nodeId = iprot.readString(); struct.setNodeIdIsSet(true); } if (incoming.get(1)) { struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } } }
public ThriftEntityAddress deepCopy() { return new ThriftEntityAddress(this); }
public byte[] getEntityId() { setEntityId(org.apache.thrift.TBaseHelper.rightSize(entityId)); return entityId == null ? null : entityId.array(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ThriftEntityAddress) return this.equals((ThriftEntityAddress)that); return false; }
private ThriftEntityClusterAddress toAddress(EndpointClusterAddress source) { ThriftEntityClusterAddress address = toEntityClusterAddress(source); address.getAddress().setEntityType(ThriftClusterEntityType.ENDPOINT); return address; }
@Override public void onEntityRouteMessages(List<ThriftEntityRouteMessage> msgs) { for (ThriftEntityRouteMessage msg : msgs) { switch (msg.getAddress().getAddress().getEntityType()) { case ENDPOINT: listener.onRouteMsg(fromThriftMsg(msg)); break; default: LOG.error("Unknown entity type: {}", msg.getAddress().getAddress().getEntityType()); } } }
@Override public void onEndpointDeregistration(ThriftEndpointDeregistrationMessage message) throws TException { LOG.debug("Received Event about endpoint deregistration {}", message); byte[] address = message.getAddress().getEntityId(); EndpointObjectHash hash = EndpointObjectHash.fromBytes(address); clusterService.onEndpointDeregistrationMessage(message); PublicKey endpointPublickKey = cacheService.getEndpointKey(hash); if (endpointPublickKey != null) { cacheService.resetEndpointKey(hash, endpointPublickKey); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftEndpointDeregistrationMessage struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } if (incoming.get(1)) { struct.actorClassifier = org.kaaproject.kaa.server.common.thrift.gen.operations.ThriftActorClassifier.findByValue(iprot.readI32()); struct.setActorClassifierIsSet(true); } } }
private EndpointClusterAddress fromThriftAddress(ThriftEntityClusterAddress source) { ThriftEntityAddress address = source.getAddress(); EndpointObjectHash endpointKey = EndpointObjectHash.fromBytes(address.getEntityId()); return new EndpointClusterAddress( source.getNodeId(), address.getTenantId(), address.getApplicationToken(), endpointKey); }
/** * Performs a deep copy on <i>other</i>. */ public ThriftEntityClusterAddress(ThriftEntityClusterAddress other) { if (other.isSetNodeId()) { this.nodeId = other.nodeId; } if (other.isSetAddress()) { this.address = new ThriftEntityAddress(other.address); } }
public boolean equals(ThriftEntityClusterAddress that) { if (that == null) return false; boolean this_present_nodeId = true && this.isSetNodeId(); boolean that_present_nodeId = true && that.isSetNodeId(); if (this_present_nodeId || that_present_nodeId) { if (!(this_present_nodeId && that_present_nodeId)) return false; if (!this.nodeId.equals(that.nodeId)) return false; } boolean this_present_address = true && this.isSetAddress(); boolean that_present_address = true && that.isSetAddress(); if (this_present_address || that_present_address) { if (!(this_present_address && that_present_address)) return false; if (!this.address.equals(that.address)) return false; } return true; }
case 2: // ADDRESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } else {
/** * Performs a deep copy on <i>other</i>. */ public ThriftServerProfileUpdateMessage(ThriftServerProfileUpdateMessage other) { if (other.isSetAddress()) { this.address = new ThriftEntityAddress(other.address); } if (other.isSetActorClassifier()) { this.actorClassifier = other.actorClassifier; } }
public boolean equals(ThriftEndpointDeregistrationMessage that) { if (that == null) return false; boolean this_present_address = true && this.isSetAddress(); boolean that_present_address = true && that.isSetAddress(); if (this_present_address || that_present_address) { if (!(this_present_address && that_present_address)) return false; if (!this.address.equals(that.address)) return false; } boolean this_present_actorClassifier = true && this.isSetActorClassifier(); boolean that_present_actorClassifier = true && that.isSetActorClassifier(); if (this_present_actorClassifier || that_present_actorClassifier) { if (!(this_present_actorClassifier && that_present_actorClassifier)) return false; if (!this.actorClassifier.equals(that.actorClassifier)) return false; } return true; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftServerProfileUpdateMessage struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } if (incoming.get(1)) { struct.actorClassifier = org.kaaproject.kaa.server.common.thrift.gen.operations.ThriftActorClassifier.findByValue(iprot.readI32()); struct.setActorClassifierIsSet(true); } } }
/** * Performs a deep copy on <i>other</i>. */ public ThriftEndpointDeregistrationMessage(ThriftEndpointDeregistrationMessage other) { if (other.isSetAddress()) { this.address = new ThriftEntityAddress(other.address); } if (other.isSetActorClassifier()) { this.actorClassifier = other.actorClassifier; } }