Module jdk.incubator.adba
Package jdk.incubator.sql2
Interface ParameterizedRowPublisherOperation<T>
-
- Type Parameters:
T
- the type of the result of thisOperation
- All Superinterfaces:
Operation<T>
,ParameterizedOperation<T>
,PrimitiveOperation<T>
,RowPublisherOperation<T>
public interface ParameterizedRowPublisherOperation<T> extends RowPublisherOperation<T>, ParameterizedOperation<T>
An Operation that accepts parameters, subscribes to a sequence of rows, and returns a result.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ParameterizedRowPublisherOperation<T>
onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
.ParameterizedRowPublisherOperation<T>
set(java.lang.String id, java.lang.Object value)
Set a parameter value.ParameterizedRowPublisherOperation<T>
set(java.lang.String id, java.lang.Object value, SqlType type)
Set a parameter value.ParameterizedRowPublisherOperation<T>
set(java.lang.String id, java.util.concurrent.CompletionStage<?> source)
Set a parameter value to be the future value of aCompletionStage
.ParameterizedRowPublisherOperation<T>
set(java.lang.String id, java.util.concurrent.CompletionStage<?> source, SqlType type)
Set a parameter value to be the value of aCompletionStage
.ParameterizedRowPublisherOperation<T>
subscribe(java.util.concurrent.Flow.Subscriber<? super Result.RowColumn> subscriber, java.util.concurrent.CompletionStage<? extends T> result)
Subscribe to the stream of rows returned by thisOperation
.ParameterizedRowPublisherOperation<T>
timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically.-
Methods inherited from interface jdk.incubator.sql2.PrimitiveOperation
submit
-
-
-
-
Method Detail
-
subscribe
ParameterizedRowPublisherOperation<T> subscribe(java.util.concurrent.Flow.Subscriber<? super Result.RowColumn> subscriber, java.util.concurrent.CompletionStage<? extends T> result)
Subscribe to the stream of rows returned by thisOperation
. The value of theresult
parameter is the result of thisOperation
.- Specified by:
subscribe
in interfaceRowPublisherOperation<T>
- Parameters:
subscriber
- Not null.result
- Not null.- Returns:
- this
ParameterizedRowPublisherOperation
-
set
ParameterizedRowPublisherOperation<T> set(java.lang.String id, java.lang.Object value, SqlType type)
Set a parameter value. The value is captured and should not be modified before theOperation
is completed.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setvalue
- the value the parameter is to be set totype
- the SQL type of the value to send to the database- Returns:
- this
ParameterizedRowPublisherOperation
-
set
ParameterizedRowPublisherOperation<T> set(java.lang.String id, java.util.concurrent.CompletionStage<?> source, SqlType type)
Set a parameter value to be the value of aCompletionStage
. TheOperation
will not be executed until theCompletionStage
is completed. This method allows submittingOperation
s that depend on the result of previousOperation
s rather than requiring that the dependentOperation
be submitted only when the previousOperation
completes.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setsource
- theCompletionStage
that provides the value the parameter is to be set totype
- the SQL type of the value to send to the database- Returns:
- this
ParameterizedRowPublisherOperation
-
set
ParameterizedRowPublisherOperation<T> set(java.lang.String id, java.util.concurrent.CompletionStage<?> source)
Set a parameter value to be the future value of aCompletionStage
. TheOperation
will not be executed until theCompletionStage
is completed. This method allows submittingOperation
s that depend on the result of previousOperation
s rather than requiring that the dependentOperation
be submitted only when the previousOperation
completes. Use a default SQL type determined by the type of the value of theCompletionStage
argument.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setsource
- theCompletionStage
that provides the value the parameter is to be set to- Returns:
- this
ParameterizedRowPublisherOperation
-
set
ParameterizedRowPublisherOperation<T> set(java.lang.String id, java.lang.Object value)
Set a parameter value. Use a default SQL type determined by the type of the value argument. The value is captured and should not be modified before theOperation
is completed.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setvalue
- the value the parameter is to be set to- Returns:
- this
ParameterizedRowPublisherOperation
-
onError
ParameterizedRowPublisherOperation<T> onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
. If execution of thisOperation
results in an error, before theOperation
is completed, the handler is called with theThrowable
as the argument. The type of theThrowable
is implementation dependent.
-
timeout
ParameterizedRowPublisherOperation<T> timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically. The default value is forever. The time is counted from the beginning of Operation execution. The Operation will not be canceled beforeminTime
after the beginning of execution. Some time at leastminTime
after the beginning of execution, an attempt will be made to cancel theOperation
if it has not yet completed. Implementations are encouraged to attempt to cancel within a reasonable time, though what is reasonable is implementation dependent.
-
-