Interface FbWireOperations
- 
- All Known Implementing Classes:
- AbstractWireOperations,- V10WireOperations,- V11WireOperations,- V13WireOperations,- V15WireOperations,- V16WireOperations,- V19WireOperations
 
 public interface FbWireOperationsCommon connection operations shared by database and service handles- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceFbWireOperations.ProcessAttachCallback
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidauthReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket, DbCryptCallback dbCryptCallback, FbWireOperations.ProcessAttachCallback processAttachCallback)Receive authentication response from the server.voidconsumePackets(int numberOfResponses, WarningMessageCallback warningCallback)Consumes packets notifying for warnings, but ignoring exceptions thrown from the packet.default voidenqueueDeferredAction(DeferredAction deferredAction)Enqueue a deferred action.XdrStreamAccessgetXdrStreamAccess()voidhandleCryptKeyCallback(DbCryptCallback dbCryptCallback)Handles the database encryption key callback.default voidprocessDeferredActions()Processes any deferred actions.voidprocessResponse(Response response)voidprocessResponseWarnings(Response response, WarningMessageCallback warningCallback)Checks if the response included a warning and signals that warning to the WarningMessageCallback.GenericResponsereadGenericResponse(WarningMessageCallback callback)Convenience method to read a Response to a GenericResponseintreadNextOperation()Reads the next operation code, after processing deferred packets.ResponsereadOperationResponse(int operationCode, WarningMessageCallback callback)Reads the response from the server when the operation code has already been read.ResponsereadResponse(WarningMessageCallback callback)Reads the response from the server.SqlResponsereadSqlResponse(WarningMessageCallback callback)Convenience method to read a Response to a SqlResponsejava.sql.SQLExceptionreadStatusVector()Process the status vector and returns the associatedSQLExceptioninstance.voidsetNetworkTimeout(int milliseconds)Sets the network timeout for this attachment.voidwriteDirect(byte[] data)Writes directly to theOutputStreamof the underlying connection.
 
- 
- 
- 
Method Detail- 
getXdrStreamAccessXdrStreamAccess getXdrStreamAccess() - Returns:
- Instance of XdrStreamAccessfor this service.
 
 - 
readStatusVectorjava.sql.SQLException readStatusVector() throws java.sql.SQLExceptionProcess the status vector and returns the associatedSQLExceptioninstance.NOTE: This method returns the SQLException read from the status vector, and only throws SQLException when an error occurs processing the status vector. - Returns:
- SQLException from the status vector
- Throws:
- java.sql.SQLException- for errors reading or processing the status vector
 
 - 
readResponseResponse readResponse(WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException Reads the response from the server.- Parameters:
- callback- Callback object for warnings,- nullfor default callback
- Returns:
- Responseread.
- Throws:
- java.sql.SQLException- For errors returned from the server, or when attempting to read
- java.io.IOException- For errors reading the response from the connection.
 
 - 
readNextOperationint readNextOperation() throws java.io.IOExceptionReads the next operation code, after processing deferred packets.In general, calling readResponse(WarningMessageCallback)or one of the specificreadXXXResponsemethods should be preferred to read the response code and the response body. Use this method only for reading custom responses, or if you need to process the response in a way that is not possible withreadResponse(WarningMessageCallback).- Returns:
- next operation
- Throws:
- java.io.IOException- for errors reading the operation from the connection
- Since:
- 5.0.7
 
 - 
readOperationResponseResponse readOperationResponse(int operationCode, WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException Reads the response from the server when the operation code has already been read.- Parameters:
- operationCode- The operation code
- callback- Callback object for warnings,- nullfor default callback
- Returns:
- Responseread.
- Throws:
- java.sql.SQLException- For errors returned from the server, or when attempting to read
- java.io.IOException- For errors reading the response from the connection.
- See Also:
- readResponse(WarningMessageCallback)
 
 - 
readGenericResponseGenericResponse readGenericResponse(WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException Convenience method to read a Response to a GenericResponse- Parameters:
- callback- Callback object for warnings,- nullfor default callback
- Returns:
- GenericResponse
- Throws:
- java.sql.SQLException- For errors returned from the server, or when attempting to read.
- java.io.IOException- For errors reading the response from the connection.
 
 - 
readSqlResponseSqlResponse readSqlResponse(WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException Convenience method to read a Response to a SqlResponse- Parameters:
- callback- Callback object for warnings,- nullfor default callback
- Returns:
- SqlResponse
- Throws:
- java.sql.SQLException- For errors returned from the server, or when attempting to read.
- java.io.IOException- For errors reading the response from the connection.
 
 - 
handleCryptKeyCallbackvoid handleCryptKeyCallback(DbCryptCallback dbCryptCallback) throws java.io.IOException, java.sql.SQLException Handles the database encryption key callback.- Parameters:
- dbCryptCallback- Database encryption callback plugin
- Throws:
- java.io.IOException- For errors reading data from the socket
- java.sql.SQLException- For database errors
- java.sql.SQLFeatureNotSupportedException- If this protocol version does not support crypt key callbacks
- Since:
- 4.0
 
 - 
enqueueDeferredActiondefault void enqueueDeferredAction(DeferredAction deferredAction) Enqueue 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
 
 - 
consumePacketsvoid consumePackets(int numberOfResponses, WarningMessageCallback warningCallback)Consumes packets notifying for warnings, but ignoring exceptions thrown from the packet.This method should only be used inside the implementation if either packets need to be ignored, or to ensure that there is no backlog of packets (eg when an exception occurs during processing of multiple package responses). - Parameters:
- numberOfResponses- Number of responses to consume.
- warningCallback- Callback for warnings
 
 - 
processDeferredActionsdefault void processDeferredActions() Processes 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.
 - 
processResponsevoid processResponse(Response response) throws java.sql.SQLException - Parameters:
- response- Response to process
- Throws:
- java.sql.SQLException- For errors returned from the server.
 
 - 
processResponseWarningsvoid processResponseWarnings(Response response, WarningMessageCallback warningCallback) Checks if the response included a warning and signals that warning to the WarningMessageCallback.- Parameters:
- response- Response to process
 
 - 
writeDirectvoid writeDirect(byte[] data) throws java.io.IOExceptionWrites directly to theOutputStreamof the underlying connection.Use of this method might lead to hard to find race conditions in the protocol. It is currently only used to allow FbDatabase.cancelOperation(int)to work.- Parameters:
- data- Data to write
- Throws:
- java.io.IOException- If there is no socket, the socket is closed, or for errors writing to the socket.
- See Also:
- WireConnection.writeDirect(byte[])
 
 - 
authReceiveResponsevoid authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket, DbCryptCallback dbCryptCallback, FbWireOperations.ProcessAttachCallback processAttachCallback) throws java.io.IOException, java.sql.SQLException Receive authentication response from the server.This method is only relevant for protocol V13 or higher. - Parameters:
- acceptPacket- Packet with- op_cond_acceptdata, or- nullwhen the data should be read from the connection.
- dbCryptCallback- Database encryption callback (ignored by protocols v12 and lower)
- processAttachCallback- Callback for processing the final attach response
- Throws:
- java.io.IOException- For errors reading the response from the connection.
- java.sql.SQLException- For errors returned from the server, or when attempting to read.
 
 - 
setNetworkTimeoutvoid setNetworkTimeout(int milliseconds) throws java.sql.SQLExceptionSets the network timeout for this attachment.- Parameters:
- milliseconds- Timeout in milliseconds; 0 means no timeout. If the attachment doesn't support milliseconds, it should round up to the nearest second.
- Throws:
- java.sql.SQLException- If this attachment is closed, the value of- millisecondsis smaller than 0, or if setting the timeout fails.
- java.sql.SQLFeatureNotSupportedException- If this attachment doesn't support changing the network timeout.
 
 
- 
 
-