Class SQLRowStream
- java.lang.Object
-
- io.vertx.mutiny.ext.sql.SQLRowStream
-
- All Implemented Interfaces:
ReadStream<io.vertx.core.json.JsonArray>,StreamBase
public class SQLRowStream extends Object implements ReadStream<io.vertx.core.json.JsonArray>
A ReadStream of Rows from the underlying RDBMS. This class follows the ReadStream semantics and will automatically close the underlying resources if all returned rows are returned. For cases where the results are ignored before the full processing of the returned rows is complete the close method **MUST** be called in order to release underlying resources. The interface is minimal in order to support all SQL clients not just JDBC. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<SQLRowStream>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description SQLRowStream(io.vertx.ext.sql.SQLRowStream delegate)SQLRowStream(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>close()Closes the stream/underlying cursor(s).VoidcloseAndAwait()Blocking variant ofclose().voidcloseAndForget()Variant ofclose()that ignores the result of the operation.intcolumn(String name)List<String>columns()SQLRowStreamendHandler(Runnable endHandler)booleanequals(Object o)SQLRowStreamexceptionHandler(Consumer<Throwable> handler)ReadStream<io.vertx.core.json.JsonArray>fetch(long arg0)io.vertx.ext.sql.SQLRowStreamgetDelegate()SQLRowStreamhandler(Consumer<io.vertx.core.json.JsonArray> handler)inthashCode()voidmoreResults()static SQLRowStreamnewInstance(io.vertx.ext.sql.SQLRowStream arg)SQLRowStreampause()Pipe<io.vertx.core.json.JsonArray>pipe()io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<io.vertx.core.json.JsonArray> dst)Pipe thisReadStreamto theWriteStream.VoidpipeToAndAwait(WriteStream<io.vertx.core.json.JsonArray> dst)Blocking variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream.) voidpipeToAndForget(WriteStream<io.vertx.core.json.JsonArray> dst)Variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStreamthat ignores the result of the operation.) SQLRowStreamresultSetClosedHandler(Runnable handler)SQLRowStreamresume()Iterable<io.vertx.core.json.JsonArray>toBlockingIterable()Stream<io.vertx.core.json.JsonArray>toBlockingStream()io.smallrye.mutiny.Multi<io.vertx.core.json.JsonArray>toMulti()StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<SQLRowStream> __TYPE_ARG
-
-
Constructor Detail
-
SQLRowStream
public SQLRowStream(io.vertx.ext.sql.SQLRowStream delegate)
-
SQLRowStream
public SQLRowStream(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.sql.SQLRowStream getDelegate()
- Specified by:
getDelegatein interfaceReadStream<io.vertx.core.json.JsonArray>- Specified by:
getDelegatein interfaceStreamBase
-
fetch
public ReadStream<io.vertx.core.json.JsonArray> fetch(long arg0)
- Specified by:
fetchin interfaceReadStream<io.vertx.core.json.JsonArray>- Returns:
- a reference to this, so the API can be used fluently
-
pipe
public Pipe<io.vertx.core.json.JsonArray> pipe()
- Specified by:
pipein interfaceReadStream<io.vertx.core.json.JsonArray>- Returns:
- a pipe
-
pipeTo
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<io.vertx.core.json.JsonArray> dst)
Description copied from interface:ReadStreamPipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handlerwill be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeToin interfaceReadStream<io.vertx.core.json.JsonArray>- Parameters:
dst- the destination write stream- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
public Void pipeToAndAwait(WriteStream<io.vertx.core.json.JsonArray> dst)
Description copied from interface:ReadStreamBlocking variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream.) This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwaitin interfaceReadStream<io.vertx.core.json.JsonArray>- Parameters:
dst- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
public void pipeToAndForget(WriteStream<io.vertx.core.json.JsonArray> dst)
Description copied from interface:ReadStreamVariant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStreamthat ignores the result of the operation.) This method subscribes on the result of
io.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from) io.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStreambut you don't need to compose it with other operations.) - Specified by:
pipeToAndForgetin interfaceReadStream<io.vertx.core.json.JsonArray>- Parameters:
dst- the destination write stream
-
exceptionHandler
public SQLRowStream exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandlerin interfaceReadStream<io.vertx.core.json.JsonArray>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
-
handler
public SQLRowStream handler(Consumer<io.vertx.core.json.JsonArray> handler)
- Specified by:
handlerin interfaceReadStream<io.vertx.core.json.JsonArray>- Returns:
-
pause
public SQLRowStream pause()
- Specified by:
pausein interfaceReadStream<io.vertx.core.json.JsonArray>- Returns:
- a reference to this, so the API can be used fluently
-
resume
public SQLRowStream resume()
- Specified by:
resumein interfaceReadStream<io.vertx.core.json.JsonArray>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
public SQLRowStream endHandler(Runnable endHandler)
- Specified by:
endHandlerin interfaceReadStream<io.vertx.core.json.JsonArray>- Returns:
-
column
public int column(String name)
- Parameters:
name- the column name- Returns:
- the json array index
-
resultSetClosedHandler
public SQLRowStream resultSetClosedHandler(Runnable handler)
- Parameters:
handler- called when the current result set is closed- Returns:
-
moreResults
public void moreResults()
-
close
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
Closes the stream/underlying cursor(s). The actual close happens asynchronously.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()
-
toMulti
@CheckReturnValue public io.smallrye.mutiny.Multi<io.vertx.core.json.JsonArray> toMulti()
- Specified by:
toMultiin interfaceReadStream<io.vertx.core.json.JsonArray>
-
toBlockingIterable
public Iterable<io.vertx.core.json.JsonArray> toBlockingIterable()
-
toBlockingStream
public Stream<io.vertx.core.json.JsonArray> toBlockingStream()
-
newInstance
public static SQLRowStream newInstance(io.vertx.ext.sql.SQLRowStream arg)
-
-