|
43 | 43 | * |
44 | 44 | * @see graphql.execution.instrumentation.Instrumentation |
45 | 45 | */ |
46 | | -@SuppressWarnings("deprecation") |
47 | 46 | @PublicApi |
48 | 47 | public class ChainedInstrumentation implements Instrumentation { |
49 | 48 |
|
@@ -112,72 +111,33 @@ protected void chainedConsume(InstrumentationState state, BiConsumer<Instrumenta |
112 | 111 | } |
113 | 112 | } |
114 | 113 |
|
115 | | - @Override |
116 | | - public InstrumentationState createState() { |
117 | | - return Assert.assertShouldNeverHappen("createStateAsync should only ever be used"); |
118 | | - } |
119 | | - |
120 | | - @Override |
121 | | - public @Nullable InstrumentationState createState(InstrumentationCreateStateParameters parameters) { |
122 | | - return Assert.assertShouldNeverHappen("createStateAsync should only ever be used"); |
123 | | - } |
124 | | - |
125 | 114 | @Override |
126 | 115 | public @NotNull CompletableFuture<InstrumentationState> createStateAsync(InstrumentationCreateStateParameters parameters) { |
127 | 116 | return ChainedInstrumentationState.combineAll(instrumentations, parameters); |
128 | 117 | } |
129 | 118 |
|
130 | | - @Override |
131 | | - @NotNull |
132 | | - public InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters) { |
133 | | - // these assert methods have been left in so that we truly never call these methods, either in production nor in tests |
134 | | - // later when the deprecated methods are removed, this will disappear. |
135 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginExecution" + " was called"); |
136 | | - } |
137 | | - |
138 | 119 | @Override |
139 | 120 | public InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters, InstrumentationState state) { |
140 | 121 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginExecution(parameters, specificState)); |
141 | 122 | } |
142 | 123 |
|
143 | | - @Override |
144 | | - @NotNull |
145 | | - public InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters) { |
146 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginParse" + " was called"); |
147 | | - } |
148 | 124 |
|
149 | 125 | @Override |
150 | 126 | public InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters, InstrumentationState state) { |
151 | 127 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginParse(parameters, specificState)); |
152 | 128 | } |
153 | 129 |
|
154 | | - @Override |
155 | | - @NotNull |
156 | | - public InstrumentationContext<List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters) { |
157 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginValidation" + " was called"); |
158 | | - } |
159 | 130 |
|
160 | 131 | @Override |
161 | 132 | public InstrumentationContext<List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters, InstrumentationState state) { |
162 | 133 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginValidation(parameters, specificState)); |
163 | 134 | } |
164 | 135 |
|
165 | | - @Override |
166 | | - @NotNull |
167 | | - public InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters) { |
168 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginExecuteOperation" + " was called"); |
169 | | - } |
170 | | - |
171 | 136 | @Override |
172 | 137 | public InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state) { |
173 | 138 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginExecuteOperation(parameters, specificState)); |
174 | 139 | } |
175 | 140 |
|
176 | | - @Override |
177 | | - @NotNull |
178 | | - public ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters) { |
179 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginExecutionStrategy" + " was called"); |
180 | | - } |
181 | 141 |
|
182 | 142 | @Override |
183 | 143 | public ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters, InstrumentationState state) { |
@@ -211,148 +171,67 @@ public InstrumentationContext<Object> beginDeferredField(InstrumentationState in |
211 | 171 | return new ChainedDeferredExecutionStrategyInstrumentationContext(chainedMapAndDropNulls(instrumentationState, Instrumentation::beginDeferredField)); |
212 | 172 | } |
213 | 173 |
|
214 | | - @Override |
215 | | - @NotNull |
216 | | - public InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters) { |
217 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginSubscribedFieldEvent" + " was called"); |
218 | | - } |
219 | 174 |
|
220 | 175 | @Override |
221 | 176 | public InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters, InstrumentationState state) { |
222 | 177 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginSubscribedFieldEvent(parameters, specificState)); |
223 | 178 | } |
224 | 179 |
|
225 | | - @Override |
226 | | - @NotNull |
227 | | - public InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters) { |
228 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginField" + " was called"); |
229 | | - } |
230 | | - |
231 | | - @Override |
232 | | - public InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters, InstrumentationState state) { |
233 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginField" + " was called"); |
234 | | - } |
235 | | - |
236 | 180 | @Override |
237 | 181 | public @Nullable InstrumentationContext<Object> beginFieldExecution(InstrumentationFieldParameters parameters, InstrumentationState state) { |
238 | 182 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginFieldExecution(parameters, specificState)); |
239 | 183 | } |
240 | 184 |
|
241 | | - @Override |
242 | | - @NotNull |
243 | | - public InstrumentationContext<Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters) { |
244 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginFieldFetch" + " was called"); |
245 | | - } |
246 | | - |
247 | 185 | @Override |
248 | 186 | public InstrumentationContext<Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters, InstrumentationState state) { |
249 | 187 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginFieldFetch(parameters, specificState)); |
250 | 188 | } |
251 | 189 |
|
252 | | - |
253 | | - @Override |
254 | | - @NotNull |
255 | | - public InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters) { |
256 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginFieldComplete" + " was called"); |
257 | | - } |
258 | | - |
259 | | - @Override |
260 | | - public InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) { |
261 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginFieldComplete" + " was called"); |
262 | | - } |
263 | | - |
264 | 190 | @Override |
265 | 191 | public @Nullable InstrumentationContext<Object> beginFieldCompletion(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) { |
266 | 192 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginFieldCompletion(parameters, specificState)); |
267 | 193 | } |
268 | 194 |
|
269 | 195 |
|
270 | | - @Override |
271 | | - @NotNull |
272 | | - public InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters) { |
273 | | - return Assert.assertShouldNeverHappen("The deprecated " + "beginFieldListComplete" + " was called"); |
274 | | - } |
275 | | - |
276 | | - @Override |
277 | | - public InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) { |
278 | | - return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginFieldListComplete(parameters, specificState)); |
279 | | - } |
280 | | - |
281 | 196 | @Override |
282 | 197 | public @Nullable InstrumentationContext<Object> beginFieldListCompletion(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) { |
283 | 198 | return chainedCtx(state, (instrumentation, specificState) -> instrumentation.beginFieldListCompletion(parameters, specificState)); |
284 | 199 | } |
285 | 200 |
|
286 | | - @Override |
287 | | - @NotNull |
288 | | - public ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters) { |
289 | | - return Assert.assertShouldNeverHappen("The deprecated " + "instrumentExecutionInput" + " was called"); |
290 | | - } |
291 | | - |
292 | 201 | @NotNull |
293 | 202 | @Override |
294 | 203 | public ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters, InstrumentationState state) { |
295 | 204 | return chainedInstrument(state, executionInput, (instrumentation, specificState, accumulator) -> instrumentation.instrumentExecutionInput(accumulator, parameters, specificState)); |
296 | 205 | } |
297 | 206 |
|
298 | | - @Override |
299 | | - @NotNull |
300 | | - public DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters) { |
301 | | - return Assert.assertShouldNeverHappen("The deprecated " + "instrumentDocumentAndVariables" + " was called"); |
302 | | - } |
303 | | - |
304 | 207 | @NotNull |
305 | 208 | @Override |
306 | 209 | public DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters, InstrumentationState state) { |
307 | 210 | return chainedInstrument(state, documentAndVariables, (instrumentation, specificState, accumulator) -> |
308 | 211 | instrumentation.instrumentDocumentAndVariables(accumulator, parameters, specificState)); |
309 | 212 | } |
310 | 213 |
|
311 | | - @Override |
312 | | - @NotNull |
313 | | - public GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters) { |
314 | | - return Assert.assertShouldNeverHappen("The deprecated " + "instrumentSchema" + " was called"); |
315 | | - } |
316 | | - |
317 | 214 | @NotNull |
318 | 215 | @Override |
319 | 216 | public GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters, InstrumentationState state) { |
320 | 217 | return chainedInstrument(state, schema, (instrumentation, specificState, accumulator) -> |
321 | 218 | instrumentation.instrumentSchema(accumulator, parameters, specificState)); |
322 | 219 | } |
323 | 220 |
|
324 | | - @Override |
325 | | - @NotNull |
326 | | - public ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters) { |
327 | | - return Assert.assertShouldNeverHappen("The deprecated " + "instrumentExecutionContext" + " was called"); |
328 | | - } |
329 | | - |
330 | 221 | @NotNull |
331 | 222 | @Override |
332 | 223 | public ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters, InstrumentationState state) { |
333 | 224 | return chainedInstrument(state, executionContext, (instrumentation, specificState, accumulator) -> |
334 | 225 | instrumentation.instrumentExecutionContext(accumulator, parameters, specificState)); |
335 | 226 | } |
336 | 227 |
|
337 | | - @Override |
338 | | - @NotNull |
339 | | - public DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters) { |
340 | | - return Assert.assertShouldNeverHappen("The deprecated " + "instrumentDataFetcher" + " was called"); |
341 | | - } |
342 | | - |
343 | 228 | @NotNull |
344 | 229 | @Override |
345 | 230 | public DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters, InstrumentationState state) { |
346 | 231 | return chainedInstrument(state, dataFetcher, (Instrumentation instrumentation, InstrumentationState specificState, DataFetcher<?> accumulator) -> |
347 | 232 | instrumentation.instrumentDataFetcher(accumulator, parameters, specificState)); |
348 | 233 | } |
349 | 234 |
|
350 | | - @Override |
351 | | - @NotNull |
352 | | - public CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters) { |
353 | | - return Assert.assertShouldNeverHappen("The deprecated " + "instrumentExecutionResult" + " was called"); |
354 | | - } |
355 | | - |
356 | 235 | @NotNull |
357 | 236 | @Override |
358 | 237 | public CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters, InstrumentationState state) { |
|
0 commit comments