|
| 1 | +/* |
| 2 | + * Copyright (C) 2020 Temporal Technologies, Inc. All Rights Reserved. |
| 3 | + * |
| 4 | + * Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | + * |
| 6 | + * Modifications copyright (C) 2017 Uber Technologies, Inc. |
| 7 | + * |
| 8 | + * Licensed under the Apache License, Version 2.0 (the "License"). You may not |
| 9 | + * use this file except in compliance with the License. A copy of the License is |
| 10 | + * located at |
| 11 | + * |
| 12 | + * http://aws.amazon.com/apache2.0 |
| 13 | + * |
| 14 | + * or in the "license" file accompanying this file. This file is distributed on |
| 15 | + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 16 | + * express or implied. See the License for the specific language governing |
| 17 | + * permissions and limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +package io.temporal.common.interceptors; |
| 21 | + |
| 22 | +import io.temporal.api.common.v1.WorkflowExecution; |
| 23 | +import io.temporal.client.WorkflowOptions; |
| 24 | + |
| 25 | +public interface WorkflowStubOutboundInterceptor { |
| 26 | + final class WorkflowInput { |
| 27 | + private final Header header; |
| 28 | + private final Object[] arguments; |
| 29 | + private final WorkflowOptions options; |
| 30 | + |
| 31 | + public WorkflowInput(Header header, Object[] arguments, WorkflowOptions options) { |
| 32 | + this.header = header; |
| 33 | + this.arguments = arguments; |
| 34 | + this.options = options; |
| 35 | + } |
| 36 | + |
| 37 | + public Header getHeader() { |
| 38 | + return header; |
| 39 | + } |
| 40 | + |
| 41 | + public Object[] getArguments() { |
| 42 | + return arguments; |
| 43 | + } |
| 44 | + |
| 45 | + public WorkflowOptions getOptions() { |
| 46 | + return options; |
| 47 | + } |
| 48 | + } |
| 49 | + |
| 50 | + final class WorkflowInputWithSignal { |
| 51 | + |
| 52 | + private final WorkflowInput workflowInput; |
| 53 | + private final String signalName; |
| 54 | + private final Object[] signalArguments; |
| 55 | + |
| 56 | + public WorkflowInputWithSignal( |
| 57 | + WorkflowInput workflowInput, String signalName, Object[] signalArguments) { |
| 58 | + this.workflowInput = workflowInput; |
| 59 | + this.signalName = signalName; |
| 60 | + this.signalArguments = signalArguments; |
| 61 | + } |
| 62 | + |
| 63 | + public WorkflowInput getWorkflowInput() { |
| 64 | + return workflowInput; |
| 65 | + } |
| 66 | + |
| 67 | + public String getSignalName() { |
| 68 | + return signalName; |
| 69 | + } |
| 70 | + |
| 71 | + public Object[] getSignalArguments() { |
| 72 | + return signalArguments; |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + final class WorkflowOutput { |
| 77 | + private final WorkflowExecution workflowExecution; |
| 78 | + |
| 79 | + public WorkflowOutput(WorkflowExecution workflowExecution) { |
| 80 | + this.workflowExecution = workflowExecution; |
| 81 | + } |
| 82 | + |
| 83 | + public WorkflowExecution getWorkflowExecution() { |
| 84 | + return workflowExecution; |
| 85 | + } |
| 86 | + } |
| 87 | + |
| 88 | + WorkflowOutput startWithOptions(WorkflowInput input); |
| 89 | + |
| 90 | + WorkflowOutput signalWithStartWithOptions(WorkflowInputWithSignal input); |
| 91 | +} |
0 commit comments