|
| 1 | +/* |
| 2 | + * Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * Modifications copyright (C) 2017 Uber Technologies, Inc. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"). You may not |
| 7 | + * use this file except in compliance with the License. A copy of the License is |
| 8 | + * located at |
| 9 | + * |
| 10 | + * http://aws.amazon.com/apache2.0 |
| 11 | + * |
| 12 | + * or in the "license" file accompanying this file. This file is distributed on |
| 13 | + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 14 | + * express or implied. See the License for the specific language governing |
| 15 | + * permissions and limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +package com.uber.cadence.client; |
| 19 | + |
| 20 | +import com.uber.cadence.workflow.Functions; |
| 21 | + |
| 22 | +/** Used to accumulate multiple operations */ |
| 23 | +public interface BatchRequest { |
| 24 | + |
| 25 | + /** |
| 26 | + * Executes zero argument request with void return type |
| 27 | + * |
| 28 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 29 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 30 | + */ |
| 31 | + void add(Functions.Proc request); |
| 32 | + |
| 33 | + /** |
| 34 | + * Executes one argument request with void return type |
| 35 | + * |
| 36 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 37 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 38 | + * @param arg1 first request function parameter |
| 39 | + */ |
| 40 | + <A1> void add(Functions.Proc1<A1> request, A1 arg1); |
| 41 | + |
| 42 | + /** |
| 43 | + * Executes two argument request with void return type |
| 44 | + * |
| 45 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 46 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 47 | + * @param arg1 first request function parameter |
| 48 | + * @param arg2 second request function parameter |
| 49 | + */ |
| 50 | + <A1, A2> void add(Functions.Proc2<A1, A2> request, A1 arg1, A2 arg2); |
| 51 | + |
| 52 | + /** |
| 53 | + * Executes three argument request with void return type |
| 54 | + * |
| 55 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 56 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 57 | + * @param arg1 first request function parameter |
| 58 | + * @param arg2 second request function parameter |
| 59 | + * @param arg3 third request function parameter |
| 60 | + */ |
| 61 | + <A1, A2, A3> void add(Functions.Proc3<A1, A2, A3> request, A1 arg1, A2 arg2, A3 arg3); |
| 62 | + |
| 63 | + /** |
| 64 | + * Executes four argument request with void return type |
| 65 | + * |
| 66 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 67 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 68 | + * @param arg1 first request function parameter |
| 69 | + * @param arg2 second request function parameter |
| 70 | + * @param arg3 third request function parameter |
| 71 | + * @param arg4 fourth request function parameter |
| 72 | + */ |
| 73 | + <A1, A2, A3, A4> void add( |
| 74 | + Functions.Proc4<A1, A2, A3, A4> request, A1 arg1, A2 arg2, A3 arg3, A4 arg4); |
| 75 | + |
| 76 | + /** |
| 77 | + * Executes five argument request with void return type |
| 78 | + * |
| 79 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 80 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 81 | + * @param arg1 first request function parameter |
| 82 | + * @param arg2 second request function parameter |
| 83 | + * @param arg3 third request function parameter |
| 84 | + * @param arg4 fourth request function parameter |
| 85 | + * @param arg5 fifth request function parameter |
| 86 | + */ |
| 87 | + <A1, A2, A3, A4, A5> void add( |
| 88 | + Functions.Proc5<A1, A2, A3, A4, A5> request, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5); |
| 89 | + |
| 90 | + /** |
| 91 | + * Executes six argument request with void return type |
| 92 | + * |
| 93 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 94 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 95 | + * @param arg1 first request function parameter |
| 96 | + * @param arg2 second request function parameter |
| 97 | + * @param arg3 third request function parameter |
| 98 | + * @param arg4 fourth request function parameter |
| 99 | + * @param arg5 sixth request function parameter |
| 100 | + * @param arg6 sixth request function parameter |
| 101 | + */ |
| 102 | + <A1, A2, A3, A4, A5, A6> void add( |
| 103 | + Functions.Proc6<A1, A2, A3, A4, A5, A6> request, |
| 104 | + A1 arg1, |
| 105 | + A2 arg2, |
| 106 | + A3 arg3, |
| 107 | + A4 arg4, |
| 108 | + A5 arg5, |
| 109 | + A6 arg6); |
| 110 | + |
| 111 | + /** |
| 112 | + * Executes zero argument request. |
| 113 | + * |
| 114 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 115 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 116 | + */ |
| 117 | + void add(Functions.Func<?> request); |
| 118 | + |
| 119 | + /** |
| 120 | + * Executes one argument request asynchronously. |
| 121 | + * |
| 122 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 123 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 124 | + * @param arg1 first request argument |
| 125 | + */ |
| 126 | + <A1> void add(Functions.Func1<A1, ?> request, A1 arg1); |
| 127 | + |
| 128 | + /** |
| 129 | + * Executes two argument request asynchronously. |
| 130 | + * |
| 131 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 132 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 133 | + * @param arg1 first request function parameter |
| 134 | + * @param arg2 second request function parameter |
| 135 | + */ |
| 136 | + <A1, A2> void add(Functions.Func2<A1, A2, ?> request, A1 arg1, A2 arg2); |
| 137 | + |
| 138 | + /** |
| 139 | + * Executes three argument request asynchronously. |
| 140 | + * |
| 141 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 142 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 143 | + * @param arg1 first request function parameter |
| 144 | + * @param arg2 second request function parameter |
| 145 | + * @param arg3 third request function parameter |
| 146 | + */ |
| 147 | + <A1, A2, A3> void add(Functions.Func3<A1, A2, A3, ?> request, A1 arg1, A2 arg2, A3 arg3); |
| 148 | + |
| 149 | + /** |
| 150 | + * Executes four argument request asynchronously. |
| 151 | + * |
| 152 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 153 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 154 | + * @param arg1 first request function parameter |
| 155 | + * @param arg2 second request function parameter |
| 156 | + * @param arg3 third request function parameter |
| 157 | + * @param arg4 fourth request function parameter |
| 158 | + */ |
| 159 | + <A1, A2, A3, A4> void add( |
| 160 | + Functions.Func4<A1, A2, A3, A4, ?> request, A1 arg1, A2 arg2, A3 arg3, A4 arg4); |
| 161 | + |
| 162 | + /** |
| 163 | + * Executes five argument request asynchronously. |
| 164 | + * |
| 165 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 166 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 167 | + * @param arg1 first request function parameter |
| 168 | + * @param arg2 second request function parameter |
| 169 | + * @param arg3 third request function parameter |
| 170 | + * @param arg4 fourth request function parameter |
| 171 | + * @param arg5 sixth request function parameter |
| 172 | + */ |
| 173 | + <A1, A2, A3, A4, A5> void add( |
| 174 | + Functions.Func5<A1, A2, A3, A4, A5, ?> request, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5); |
| 175 | + |
| 176 | + /** |
| 177 | + * Executes six argument request asynchronously. |
| 178 | + * |
| 179 | + * @param request The only supported value is method reference to a proxy created through {@link |
| 180 | + * WorkflowClient#newWorkflowStub(Class, WorkflowOptions)}. |
| 181 | + * @param arg1 first request argument |
| 182 | + * @param arg2 second request function parameter |
| 183 | + * @param arg3 third request function parameter |
| 184 | + * @param arg4 fourth request function parameter |
| 185 | + * @param arg5 sixth request function parameter |
| 186 | + * @param arg6 sixth request function parameter |
| 187 | + */ |
| 188 | + <A1, A2, A3, A4, A5, A6> void add( |
| 189 | + Functions.Func6<A1, A2, A3, A4, A5, A6, ?> request, |
| 190 | + A1 arg1, |
| 191 | + A2 arg2, |
| 192 | + A3 arg3, |
| 193 | + A4 arg4, |
| 194 | + A5 arg5, |
| 195 | + A6 arg6); |
| 196 | +} |
0 commit comments