public ThriftEndpointDeregistrationMessage deepCopy() { return new ThriftEndpointDeregistrationMessage(this); }
public Object getFieldValue(_Fields field) { switch (field) { case ADDRESS: return getAddress(); case ACTOR_CLASSIFIER: return getActorClassifier(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ADDRESS: if (value == null) { unsetAddress(); } else { setAddress((ThriftEntityAddress)value); } break; case ACTOR_CLASSIFIER: if (value == null) { unsetActorClassifier(); } else { setActorClassifier((ThriftActorClassifier)value); } break; } }
/** 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 ADDRESS: return isSetAddress(); case ACTOR_CLASSIFIER: return isSetActorClassifier(); } throw new IllegalStateException(); }
@Override public void removeEndpointProfile(EndpointProfileDto endpointProfile) throws ControlServiceException { checkNeighbors(); byte[] endpointKeyHash = endpointProfile.getEndpointKeyHash(); this.endpointService.removeEndpointProfileByKeyHash(endpointKeyHash); ApplicationDto appDto = getApplication(endpointProfile.getApplicationId()); ThriftEndpointDeregistrationMessage nf = new ThriftEndpointDeregistrationMessage(); nf.setAddress( new ThriftEntityAddress( appDto.getTenantId(), appDto.getApplicationToken(), ThriftClusterEntityType.ENDPOINT, ByteBuffer.wrap(endpointKeyHash) ) ); nf.setActorClassifier(ThriftActorClassifier.APPLICATION); neighbors.brodcastMessage(OperationsServiceMsg.fromDeregistration(nf)); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, onEndpointDeregistration_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.message = new ThriftEndpointDeregistrationMessage(); struct.message.read(iprot); struct.setMessageIsSet(true); } } }
struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.actorClassifier = org.kaaproject.kaa.server.common.thrift.gen.operations.ThriftActorClassifier.findByValue(iprot.readI32()); struct.setActorClassifierIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@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); } } }
@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 boolean equals(Object that) { if (that == null) return false; if (that instanceof ThriftEndpointDeregistrationMessage) return this.equals((ThriftEndpointDeregistrationMessage)that); return false; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
checkNeighbors(); ApplicationDto appDto = getApplication(endpointRegistration.getApplicationId()); ThriftEndpointDeregistrationMessage nf = new ThriftEndpointDeregistrationMessage(); nf.setAddress( new ThriftEntityAddress( appDto.getTenantId(), nf.setActorClassifier(ThriftActorClassifier.APPLICATION); neighbors.brodcastMessage(OperationsServiceMsg.fromDeregistration(nf));
/** * 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; } }
public void read(org.apache.thrift.protocol.TProtocol iprot, onEndpointDeregistration_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // MESSAGE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.message = new ThriftEndpointDeregistrationMessage(); struct.message.read(iprot); struct.setMessageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); }
public boolean equals(onEndpointDeregistration_args that) { if (that == null) return false; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); if (this_present_message || that_present_message) { if (!(this_present_message && that_present_message)) return false; if (!this.message.equals(that.message)) return false; } return true; }
@Override public void onEndpointDeregistrationMessage(ThriftEndpointDeregistrationMessage msg) { EndpointAddress address = fromThriftAddress(msg.getAddress()); ActorClassifier classifier = fromThriftActorClassifier(msg.getActorClassifier()); listener.onEndpointActorMsg(new ThriftEndpointActorMsg<>(address, classifier, msg)); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_address = true && (isSetAddress()); list.add(present_address); if (present_address) list.add(address); boolean present_actorClassifier = true && (isSetActorClassifier()); list.add(present_actorClassifier); if (present_actorClassifier) list.add(actorClassifier.getValue()); return list.hashCode(); }
/** * Performs a deep copy on <i>other</i>. */ public onEndpointDeregistration_args(onEndpointDeregistration_args other) { if (other.isSetMessage()) { this.message = new ThriftEndpointDeregistrationMessage(other.message); } }
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 int compareTo(ThriftEndpointDeregistrationMessage other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetAddress()).compareTo(other.isSetAddress()); if (lastComparison != 0) { return lastComparison; } if (isSetAddress()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, other.address); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetActorClassifier()).compareTo(other.isSetActorClassifier()); if (lastComparison != 0) { return lastComparison; } if (isSetActorClassifier()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.actorClassifier, other.actorClassifier); if (lastComparison != 0) { return lastComparison; } } return 0; }