public Builder mergeFrom(io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest other) { if (other == io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getCorrelationKey().isEmpty()) { correlationKey_ = other.correlationKey_; onChanged(); } if (other.getTimeToLive() != 0L) { setTimeToLive(other.getTimeToLive()); } if (!other.getMessageId().isEmpty()) { messageId_ = other.messageId_; onChanged(); } if (!other.getPayload().isEmpty()) { payload_ = other.payload_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public PublishMessageCommandImpl( final GatewayStub asyncStub, final ZeebeClientConfiguration configuration, ZeebeObjectMapper objectMapper) { super(objectMapper); this.asyncStub = asyncStub; this.builder = PublishMessageRequest.newBuilder(); builder.setTimeToLive(configuration.getDefaultMessageTimeToLive().toMillis()); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (!getCorrelationKeyBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, correlationKey_); } if (timeToLive_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, timeToLive_); } if (!getMessageIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, messageId_); } if (!getPayloadBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, payload_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "PublishMessage", requestType = io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest.class, responseType = io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest, io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageResponse> getPublishMessageMethod() { io.grpc.MethodDescriptor<io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest, io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageResponse> getPublishMessageMethod; if ((getPublishMessageMethod = GatewayGrpc.getPublishMessageMethod) == null) { synchronized (GatewayGrpc.class) { if ((getPublishMessageMethod = GatewayGrpc.getPublishMessageMethod) == null) { GatewayGrpc.getPublishMessageMethod = getPublishMessageMethod = io.grpc.MethodDescriptor.<io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest, io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "gateway_protocol.Gateway", "PublishMessage")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageResponse.getDefaultInstance())) .setSchemaDescriptor(new GatewayMethodDescriptorSupplier("PublishMessage")) .build(); } } } return getPublishMessageMethod; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (!getCorrelationKeyBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, correlationKey_); } if (timeToLive_ != 0L) { output.writeInt64(3, timeToLive_); } if (!getMessageIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, messageId_); } if (!getPayloadBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, payload_); } unknownFields.writeTo(output); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest)) { return super.equals(obj); } io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest other = (io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && getCorrelationKey() .equals(other.getCorrelationKey()); result = result && (getTimeToLive() == other.getTimeToLive()); result = result && getMessageId() .equals(other.getMessageId()); result = result && getPayload() .equals(other.getPayload()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CORRELATIONKEY_FIELD_NUMBER; hash = (53 * hash) + getCorrelationKey().hashCode(); hash = (37 * hash) + TIMETOLIVE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getTimeToLive()); hash = (37 * hash) + MESSAGEID_FIELD_NUMBER; hash = (53 * hash) + getMessageId().hashCode(); hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayload().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
/** * <pre> * the message payload as a JSON document; see CreateWorkflowInstanceRequest for the * rules about payloads * </pre> * * <code>string payload = 5;</code> */ public Builder clearPayload() { payload_ = getDefaultInstance().getPayload(); onChanged(); return this; } /**
/** * <pre> * the correlation key of the message * </pre> * * <code>string correlationKey = 2;</code> */ public Builder clearCorrelationKey() { correlationKey_ = getDefaultInstance().getCorrelationKey(); onChanged(); return this; } /**
/** * <pre> * the name of the message * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
/** * <pre> * the unique ID of the message; can be omitted. only useful to ensure only one message * with the given ID will ever be published (during its lifetime) * </pre> * * <code>string messageId = 4;</code> */ public Builder clearMessageId() { messageId_ = getDefaultInstance().getMessageId(); onChanged(); return this; } /**
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest getDefaultInstanceForType() { return io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest.getDefaultInstance(); }
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest buildPartial() { io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest result = new io.zeebe.gateway.protocol.GatewayOuterClass.PublishMessageRequest(this); result.name_ = name_; result.correlationKey_ = correlationKey_; result.timeToLive_ = timeToLive_; result.messageId_ = messageId_; result.payload_ = payload_; onBuilt(); return result; }
public PublishMessageCommandImpl( final GatewayStub asyncStub, final ZeebeClientConfiguration configuration, ZeebeObjectMapper objectMapper) { super(objectMapper); this.asyncStub = asyncStub; this.builder = PublishMessageRequest.newBuilder(); builder.setTimeToLive(configuration.getDefaultMessageTimeToLive().toMillis()); }
public static BrokerPublishMessageRequest toPublishMessageRequest( PublishMessageRequest grpcRequest) { final BrokerPublishMessageRequest brokerRequest = new BrokerPublishMessageRequest(grpcRequest.getName(), grpcRequest.getCorrelationKey()); brokerRequest .setMessageId(grpcRequest.getMessageId()) .setTimeToLive(grpcRequest.getTimeToLive()) .setPayload(ensureJsonSet(grpcRequest.getPayload())); return brokerRequest; }