Package com.tangosol.coherence.dslquery
Interface Statement
-
- All Known Implementing Classes:
AbstractQueryPlusStatementBuilder.AbstractStatement
,AbstractSnapshotStatement
,AbstractStatement
,ArchiveSnapshotStatementBuilder.ArchiveSnapshotStatement
,BackupStatementBuilder.BackupStatement
,CommandsStatementBuilder.CommandsQueryPlusStatement
,CreateCacheStatementBuilder.CreateCacheStatement
,CreateIndexStatementBuilder.CreateIndexStatement
,CreateSnapshotStatementBuilder.CreateSnapshotStatement
,DeleteStatementBuilder.DeleteStatement
,DropCacheStatementBuilder.DropCacheStatement
,DropIndexStatementBuilder.DropIndexStatement
,ExtendedLanguageStatementBuilder.ExtendedLanguageQueryPlusStatement
,ForceRecoveryStatementBuilder.ForceRecoveryStatement
,HelpStatementBuilder.HelpQueryPlusStatement
,InsertStatementBuilder.InsertStatement
,ListArchiverStatementBuilder.ListArchiverStatement
,ListServicesStatementBuilder.ListServicesStatement
,ListSnapshotsStatementBuilder.ListSnapshotsStatement
,QueryRecorderStatementBuilder.QueryRecorderStatement
,RecoverSnapshotStatementBuilder.RecoverSnapshotStatement
,RemoveSnapshotStatementBuilder.RemoveSnapshotStatement
,RestoreStatementBuilder.RestoreStatement
,ResumeServiceStatementBuilder.ResumeServiceStatement
,RetrieveSnapshotStatementBuilder.RetrieveSnapshotStatement
,SanityCheckStatementBuilder.SanityCheckQueryPlusStatement
,SelectStatementBuilder.SelectStatement
,ServicesStatementBuilder.ServicesQueryPlusStatement
,SetTimeoutStatementBuilder.SetTimeoutStatement
,SourceStatementBuilder.SourceStatement
,SuspendServiceStatementBuilder.SuspendServiceStatement
,TraceStatementBuilder.TraceQueryPlusStatement
,TruncateCacheStatementBuilder.TruncateCacheStatement
,UpdateStatementBuilder.UpdateStatement
,ValidateSnapshotStatementBuilder.ValidateSnapshotStatement
,WheneverStatementBuilder.WheneverQueryPlusStatement
public interface Statement
Implementations of this interface are able to execute CohQL statements, for example a Select, Update, a backup command etc.Each
execution
is provided acontext
in which to execute the statement and is obliged to return aresult
to the caller. Ths allows the caller to invoke statement agnostic operations, which each implementation can specialize based on the format of the results.- Since:
- Coherence 12.2.1
- Author:
- jk 2013.12.09
- See Also:
StatementResult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StatementResult
execute(ExecutionContext ctx)
Execute a CohQL query or command and return the relevantresult
.default CompletableFuture<StatementResult>
executeAsync(ExecutionContext ctx)
Execute a CohQL query or command asynchronously and return theCompletableFuture
with the relevantresult
.String
getExecutionConfirmation(ExecutionContext ctx)
Return a string that will be used as a question to confirm execution of a statement.default boolean
isManagingTimeout()
Obtain a flag indicating whether this Statement will manage its own timeout handling.void
sanityCheck(ExecutionContext ctx)
Perform sanity checks on the statement that will be executed.void
showPlan(PrintWriter out)
Output to the providedPrintWriter
a human readable trace of the actions that will be taken by this statement if or when executed.
-
-
-
Method Detail
-
execute
StatementResult execute(ExecutionContext ctx)
Execute a CohQL query or command and return the relevantresult
.- Parameters:
ctx
- thecontext
to use- Returns:
- a StatementResult containing the results of executing the statement
-
executeAsync
default CompletableFuture<StatementResult> executeAsync(ExecutionContext ctx)
Execute a CohQL query or command asynchronously and return theCompletableFuture
with the relevantresult
.- Parameters:
ctx
- thecontext
to use- Returns:
- a StatementResult future containing the results of executing the statement
- Throws:
UnsupportedOperationException
- if this statement does not support asynchronous execution
-
sanityCheck
void sanityCheck(ExecutionContext ctx)
Perform sanity checks on the statement that will be executed.Implementations can fail sanity checking by throwing an unchecked exception (RuntimeException).
- Parameters:
ctx
- thecontext
to use- Throws:
RuntimeException
- if sanity checking fails
-
showPlan
void showPlan(PrintWriter out)
Output to the providedPrintWriter
a human readable trace of the actions that will be taken by this statement if or when executed.- Parameters:
out
- the PrintWriter to write the trace to
-
getExecutionConfirmation
String getExecutionConfirmation(ExecutionContext ctx)
Return a string that will be used as a question to confirm execution of a statement. If null is returned then no confirmation is required.- Parameters:
ctx
- thecontext
to use- Returns:
- a String that will be used to confirm execution of a statement
-
isManagingTimeout
default boolean isManagingTimeout()
Obtain a flag indicating whether this Statement will manage its own timeout handling.- Returns:
- true if this Statement manages timeout handling or false if the StatementExecutor should manage timeouts.
-
-