Class V11WireOperations
- All Implemented Interfaces:
FbWireOperations
- Direct Known Subclasses:
V13WireOperations
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.wire.FbWireOperations
FbWireOperations.ProcessAttachCallback -
Constructor Summary
ConstructorsConstructorDescriptionV11WireOperations(WireConnection<?, ?> connection, WarningMessageCallback defaultWarningMessageCallback) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAction to perform after the deferred action has been queued inenqueueDeferredAction(DeferredAction).protected voidafterProcessDeferredActions(int processedDeferredActions) Can be used for additional actions after processing deferred actions (e.g.voidCompletes pending deferred actions.protected final booleanReports if an explicit sync action is required to complete deferred actions.protected final intThe number of deferred actions currently waiting.final voidenqueueDeferredAction(DeferredAction deferredAction) Enqueue a deferred action.final voidProcesses any deferred actions.Methods inherited from class org.firebirdsql.gds.ng.wire.version10.V10WireOperations
authReceiveResponseMethods inherited from class org.firebirdsql.gds.ng.wire.AbstractWireOperations
addServerKeys, clearServerKeys, consumePackets, getAttachProperties, getClientAuthBlock, getConnection, getDefaultWarningMessageCallback, getEncoding, getPluginSpecificData, getXdrIn, getXdrOut, getXdrStreamAccess, handleCryptKeyCallback, processOperation, processResponse, processResponseWarnings, readBatchCompletionResponse, readGenericResponse, readNextOperation, readOperationResponse, readResponse, readSqlResponse, readStatusVector, readStatusVector, setNetworkTimeout, withLock, writeDirect
-
Constructor Details
-
V11WireOperations
public V11WireOperations(WireConnection<?, ?> connection, WarningMessageCallback defaultWarningMessageCallback)
-
-
Method Details
-
enqueueDeferredAction
Description copied from interface:FbWireOperationsEnqueue a deferred action.FbDatabase implementations that do not support deferred actions are allowed to throw an
UnsupportedOperationException(which the default implementation does).- Parameters:
deferredAction- Deferred action- Throws:
SQLException- for errors forcing handling of oversized queue usingop_ping(orop_batch_sync)
-
afterEnqueueDeferredAction
Action to perform after the deferred action has been queued inenqueueDeferredAction(DeferredAction).This method should only be called by
enqueueDeferredAction(DeferredAction), and can be used to implement forcing processing of deferred actions if too many are queued.- Throws:
SQLException- for errors forcing handling of oversized queue usingop_ping(orop_batch_sync)
-
deferredActionCount
protected final int deferredActionCount()The number of deferred actions currently waiting.This method should be called when locked on
AbstractWireOperations.withLock().- Returns:
- number of deferred actions
-
completeDeferredActionsRequiresSync
protected final boolean completeDeferredActionsRequiresSync()Reports if an explicit sync action is required to complete deferred actions.For wire protocol v11 - v15, the only sync action needed is a flush, in v16 and higher an
op_pingorop_batch_syncis needed (in some cases, a flush would suffice, but we're considering the worst case here).Failure to flush or sync (depending on the protocol version) may result in indefinite blocking. The sync action is not needed when deferred actions are processed as part of a normal request/response cycle (as there the request will behave as the sync action).
- Returns:
trueif one or more of the deferred action require an explicit sync action.- Since:
- 6
-
completeDeferredActions
Description copied from interface:FbWireOperationsCompletes pending deferred actions.Wire protocol implementations that do not support deferred actions should simply do nothing.
- Throws:
SQLException- for errors forcing ping/batch sync
-
processDeferredActions
public final void processDeferredActions()Description copied from interface:FbWireOperationsProcesses any deferred actions. Protocol versions that do not support deferred actions should simply do nothing.WARNING: If the server queues deferred responses, and expects an operation (e.g.
op_batch_sync,op_batch_execorop_ping) to actual send those responses, this method may block indefinitely. -
afterProcessDeferredActions
protected void afterProcessDeferredActions(int processedDeferredActions) Can be used for additional actions after processing deferred actions (e.g. trim a large deferred actions list to its default capacity).This implementation trims if
processedDeferredActions > 10. When overridden, it is recommend to call this method throughsuperto still trim (e.g. in a more limited set of circumstances) and perform any other actions this method may perform. If the overridden method wants to forgo trimming, it should pass-1forprocessedDeferredActions.- Parameters:
processedDeferredActions- number of processed deferred actions, or-1to ensure no trim is performed
-