Skip to content

Commit

Permalink
refactor: reduce scope of methods in GrpcReponseWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
remcowesterhoud committed Apr 12, 2022
1 parent 0c94eae commit 45b2973
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public boolean tryWriteResponse(final int requestStreamId, final long requestId)
}

@Deprecated(since = "8.0.0")
protected static DeployProcessResponse createDeployResponse() {
static DeployProcessResponse createDeployResponse() {
final DeploymentRecord deployment = new DeploymentRecord();
deployment.wrap(valueBufferView);

Expand All @@ -155,7 +155,7 @@ protected static DeployProcessResponse createDeployResponse() {
.build();
}

protected static GeneratedMessageV3 createDeployResourceResponse() {
static GeneratedMessageV3 createDeployResourceResponse() {
final DeploymentRecord deployment = new DeploymentRecord();
deployment.wrap(valueBufferView);

Expand Down Expand Up @@ -199,7 +199,7 @@ protected static GeneratedMessageV3 createDeployResourceResponse() {
return builder.build();
}

protected static GeneratedMessageV3 createProcessInstanceResponse() {
static GeneratedMessageV3 createProcessInstanceResponse() {
final ProcessInstanceCreationRecord processInstance = new ProcessInstanceCreationRecord();
processInstance.wrap(valueBufferView);

Expand All @@ -211,7 +211,7 @@ protected static GeneratedMessageV3 createProcessInstanceResponse() {
.build();
}

protected static GeneratedMessageV3 createProcessInstanceWithResultResponse() {
static GeneratedMessageV3 createProcessInstanceWithResultResponse() {
final ProcessInstanceResultRecord processInstanceResult = new ProcessInstanceResultRecord();
processInstanceResult.wrap(valueBufferView);

Expand All @@ -224,29 +224,29 @@ protected static GeneratedMessageV3 createProcessInstanceWithResultResponse() {
.build();
}

protected static GeneratedMessageV3 createCancelInstanceResponse() {
static GeneratedMessageV3 createCancelInstanceResponse() {
return CancelProcessInstanceResponse.newBuilder().build();
}

protected static GeneratedMessageV3 createResolveIncidentResponse() {
static GeneratedMessageV3 createResolveIncidentResponse() {
final IncidentRecord incident = new IncidentRecord();
incident.wrap(valueBufferView);

return ResolveIncidentResponse.newBuilder().build();
}

protected static GeneratedMessageV3 createSetVariablesResponse() {
static GeneratedMessageV3 createSetVariablesResponse() {
final VariableDocumentRecord variableDocumentRecord = new VariableDocumentRecord();
variableDocumentRecord.wrap(valueBufferView);

return SetVariablesResponse.newBuilder().setKey(key).build();
}

protected static GeneratedMessageV3 createMessageResponse() {
static GeneratedMessageV3 createMessageResponse() {
return PublishMessageResponse.newBuilder().setKey(key).build();
}

protected static GeneratedMessageV3 createJobBatchResponse() {
static GeneratedMessageV3 createJobBatchResponse() {
final JobBatchRecord jobBatch = new JobBatchRecord();
jobBatch.wrap(valueBufferView);

Expand Down Expand Up @@ -284,23 +284,23 @@ protected static GeneratedMessageV3 createJobBatchResponse() {
.build();
}

protected static GeneratedMessageV3 createCompleteJobResponse() {
static GeneratedMessageV3 createCompleteJobResponse() {
return CompleteJobResponse.newBuilder().build();
}

protected static GeneratedMessageV3 createFailJobResponse() {
static GeneratedMessageV3 createFailJobResponse() {
return FailJobResponse.newBuilder().build();
}

protected static GeneratedMessageV3 createJobThrowErrorResponse() {
static GeneratedMessageV3 createJobThrowErrorResponse() {
return ThrowErrorResponse.newBuilder().build();
}

protected static GeneratedMessageV3 createJobUpdateRetriesResponse() {
static GeneratedMessageV3 createJobUpdateRetriesResponse() {
return UpdateJobRetriesResponse.newBuilder().build();
}

protected static GeneratedMessageV3 createJobResponse() {
static GeneratedMessageV3 createJobResponse() {
return switch ((JobIntent) intent) {
case COMPLETED -> createCompleteJobResponse();
case FAILED -> createFailJobResponse();
Expand Down

0 comments on commit 45b2973

Please sign in to comment.