56797
|
1 |
/*
|
|
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
|
24 |
*/
|
|
25 |
|
|
26 |
package jdk.incubator.sql2;
|
|
27 |
|
|
28 |
import java.time.Duration;
|
|
29 |
import java.util.concurrent.CompletionStage;
|
|
30 |
import java.util.concurrent.Flow;
|
|
31 |
import java.util.function.Consumer;
|
|
32 |
|
|
33 |
/**
|
|
34 |
* An Operation that accepts parameters, subscribes to a sequence of rows, and
|
|
35 |
* returns a result.
|
|
36 |
*
|
|
37 |
* @param <T> the type of the result of this {@link Operation}
|
|
38 |
*/
|
|
39 |
public interface ParameterizedRowPublisherOperation<T>
|
|
40 |
extends RowPublisherOperation<T>, ParameterizedOperation<T> {
|
|
41 |
|
|
42 |
// Covariant overrides
|
|
43 |
|
56997
|
44 |
/**
|
|
45 |
* {@inheritDoc}
|
|
46 |
*
|
|
47 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
48 |
*/
|
56797
|
49 |
@Override
|
|
50 |
public ParameterizedRowPublisherOperation<T> subscribe(Flow.Subscriber<? super Result.RowColumn> subscriber,
|
|
51 |
CompletionStage<? extends T> result);
|
|
52 |
|
56997
|
53 |
/**
|
|
54 |
* {@inheritDoc}
|
|
55 |
*
|
|
56 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
57 |
*/
|
56797
|
58 |
@Override
|
|
59 |
public ParameterizedRowPublisherOperation<T> set(String id, Object value, SqlType type);
|
|
60 |
|
56997
|
61 |
/**
|
|
62 |
* {@inheritDoc}
|
|
63 |
*
|
|
64 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
65 |
*/
|
56797
|
66 |
@Override
|
|
67 |
public ParameterizedRowPublisherOperation<T> set(String id, CompletionStage<?> source, SqlType type);
|
|
68 |
|
56997
|
69 |
/**
|
|
70 |
* {@inheritDoc}
|
|
71 |
*
|
|
72 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
73 |
*/
|
56797
|
74 |
@Override
|
|
75 |
public ParameterizedRowPublisherOperation<T> set(String id, CompletionStage<?> source);
|
|
76 |
|
56997
|
77 |
/**
|
|
78 |
* {@inheritDoc}
|
|
79 |
*
|
|
80 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
81 |
*/
|
56797
|
82 |
@Override
|
|
83 |
public ParameterizedRowPublisherOperation<T> set(String id, Object value);
|
|
84 |
|
56997
|
85 |
/**
|
|
86 |
* {@inheritDoc}
|
|
87 |
*
|
|
88 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
89 |
*/
|
56797
|
90 |
@Override
|
|
91 |
public ParameterizedRowPublisherOperation<T> onError(Consumer<Throwable> handler);
|
|
92 |
|
56997
|
93 |
/**
|
|
94 |
* {@inheritDoc}
|
|
95 |
*
|
|
96 |
* @return this {@code ParameterizedRowPublisherOperation}
|
|
97 |
*/
|
56797
|
98 |
@Override
|
|
99 |
public ParameterizedRowPublisherOperation<T> timeout(Duration minTime);
|
|
100 |
|
|
101 |
}
|