private void processEndpointConfigurationRefreshMsg(ActorContext context, ThriftEndpointConfigurationRefreshMessage thriftMsg) { ThriftEndpointConfigurationRefreshMessage localMsg = new ThriftEndpointConfigurationRefreshMessage(thriftMsg); localMsg.setActorClassifier(ThriftActorClassifier.LOCAL); dispatchMsg(context, localMsg, clusterService::sendEndpointConfigurationRefreshMessage); }
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; } }
private void sendEndpointConfigurationRefreshMessage(EndpointSpecificConfigurationDto configuration) { byte[] endpointKeyHashBytes = configuration.getEndpointKeyHash(); EndpointProfileDto endpointProfile = endpointService.findEndpointProfileByKeyHash(endpointKeyHashBytes); if (!configuration.getConfigurationSchemaVersion().equals(endpointProfile.getConfigurationVersion())) { return; } checkNeighbors(); String endpointKeyHash = Base64Util.encode(configuration.getEndpointKeyHash()); ApplicationDto appDto = applicationService.findAppById(endpointProfile.getApplicationId()); OperationsNodeInfo server = resolve(endpointKeyHash); if (server != null) { ThriftEndpointConfigurationRefreshMessage msg = new ThriftEndpointConfigurationRefreshMessage(); msg.setAddress(new ThriftEntityAddress(appDto.getTenantId(), appDto.getApplicationToken(), ThriftClusterEntityType.ENDPOINT, ByteBuffer.wrap(endpointKeyHashBytes))); msg.setActorClassifier(ThriftActorClassifier.GLOBAL); if (LOG.isTraceEnabled()) { LOG.trace("Sending message {} to [{}]", msg, Neighbors.getServerId(server.getConnectionInfo())); } neighbors.sendMessage(server.getConnectionInfo(), OperationsServiceMsg.fromEndpointConfigurationRefresh(msg)); } else { LOG.warn("Can't find server for endpoint [{}]", endpointKeyHash); } }
/** 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 read(org.apache.thrift.protocol.TProtocol prot, sendEndpointConfigurationRefreshMessage_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.message = new ThriftEndpointConfigurationRefreshMessage(); 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();
public ThriftEndpointConfigurationRefreshMessage deepCopy() { return new ThriftEndpointConfigurationRefreshMessage(this); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftEndpointConfigurationRefreshMessage 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 boolean equals(Object that) { if (that == null) return false; if (that instanceof ThriftEndpointConfigurationRefreshMessage) return this.equals((ThriftEndpointConfigurationRefreshMessage)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); } }
/** * Performs a deep copy on <i>other</i>. */ public ThriftEndpointConfigurationRefreshMessage(ThriftEndpointConfigurationRefreshMessage 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, sendEndpointConfigurationRefreshMessage_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 ThriftEndpointConfigurationRefreshMessage(); 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(); }
/** * Performs a deep copy on <i>other</i>. */ public sendEndpointConfigurationRefreshMessage_args(sendEndpointConfigurationRefreshMessage_args other) { if (other.isSetMessage()) { this.message = new ThriftEndpointConfigurationRefreshMessage(other.message); } }
public boolean equals(sendEndpointConfigurationRefreshMessage_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 sendEndpointConfigurationRefreshMessage(ThriftEndpointConfigurationRefreshMessage 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(); }
public boolean equals(ThriftEndpointConfigurationRefreshMessage 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(ThriftEndpointConfigurationRefreshMessage 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; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftEndpointConfigurationRefreshMessage struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetAddress()) { optionals.set(0); } if (struct.isSetActorClassifier()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetAddress()) { struct.address.write(oprot); } if (struct.isSetActorClassifier()) { oprot.writeI32(struct.actorClassifier.getValue()); } }