public interface FbWireOperations
Modifier and Type | Interface and Description |
---|---|
static interface |
FbWireOperations.ProcessAttachCallback |
Modifier and Type | Method and Description |
---|---|
void |
authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket,
DbCryptCallback dbCryptCallback,
FbWireOperations.ProcessAttachCallback processAttachCallback)
Receive authentication response from the server.
|
void |
consumePackets(int numberOfResponses,
WarningMessageCallback warningCallback)
Consumes packets notifying for warnings, but ignoring exceptions thrown from the packet.
|
default void |
enqueueDeferredAction(DeferredAction deferredAction)
Enqueue a deferred action.
|
XdrStreamAccess |
getXdrStreamAccess() |
void |
handleCryptKeyCallback(DbCryptCallback dbCryptCallback)
Handles the database encryption key callback.
|
default void |
processDeferredActions()
Processes any deferred actions.
|
void |
processResponse(Response response) |
void |
processResponseWarnings(Response response,
WarningMessageCallback warningCallback)
Checks if the response included a warning and signals that warning to the
WarningMessageCallback.
|
GenericResponse |
readGenericResponse(WarningMessageCallback callback)
Convenience method to read a Response to a GenericResponse
|
Response |
readOperationResponse(int operationCode,
WarningMessageCallback callback)
Reads the response from the server when the operation code has already been read.
|
Response |
readResponse(WarningMessageCallback callback)
Reads the response from the server.
|
SqlResponse |
readSqlResponse(WarningMessageCallback callback)
Convenience method to read a Response to a SqlResponse
|
java.sql.SQLException |
readStatusVector()
Process the status vector and returns the associated
SQLException
instance. |
void |
setNetworkTimeout(int milliseconds)
Sets the network timeout for this attachment.
|
void |
writeDirect(byte[] data)
Writes directly to the
OutputStream of the underlying connection. |
XdrStreamAccess getXdrStreamAccess()
XdrStreamAccess
for this service.java.sql.SQLException readStatusVector() throws java.sql.SQLException
SQLException
instance.
NOTE: This method returns the SQLException read from the status vector, and only throws SQLException when an error occurs processing the status vector.
java.sql.SQLException
- for errors reading or processing the status vectorResponse readResponse(WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException
callback
- Callback object for warnings, null
for default callbackResponse
read.java.sql.SQLException
- For errors returned from the server, or when attempting to readjava.io.IOException
- For errors reading the response from the connection.Response readOperationResponse(int operationCode, WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException
operationCode
- The operation codecallback
- Callback object for warnings, null
for default callbackResponse
read.java.sql.SQLException
- For errors returned from the server, or when attempting to readjava.io.IOException
- For errors reading the response from the connection.readResponse(WarningMessageCallback)
GenericResponse readGenericResponse(WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException
callback
- Callback object for warnings, null
for default callbackjava.sql.SQLException
- For errors returned from the server, or when attempting to
read.java.io.IOException
- For errors reading the response from the connection.SqlResponse readSqlResponse(WarningMessageCallback callback) throws java.sql.SQLException, java.io.IOException
callback
- Callback object for warnings, null
for default callbackjava.sql.SQLException
- For errors returned from the server, or when attempting to
read.java.io.IOException
- For errors reading the response from the connection.void handleCryptKeyCallback(DbCryptCallback dbCryptCallback) throws java.io.IOException, java.sql.SQLException
dbCryptCallback
- Database encryption callback pluginjava.io.IOException
- For errors reading data from the socketjava.sql.SQLException
- For database errorsjava.sql.SQLFeatureNotSupportedException
- If this protocol version does not support crypt key callbacksdefault void enqueueDeferredAction(DeferredAction deferredAction)
FbDatabase implementations that do not support deferred actions are allowed to throw an
UnsupportedOperationException
(which the default implementation does).
deferredAction
- Deferred actionvoid consumePackets(int numberOfResponses, WarningMessageCallback warningCallback)
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).
numberOfResponses
- Number of responses to consume.warningCallback
- Callback for warningsdefault void processDeferredActions()
WARNING: If the server queues deferred responses, and expects an operation (e.g. op_batch_sync
,
op_batch_exec
or op_ping
) to actual send those responses, this method may block indefinitely.
void processResponse(Response response) throws java.sql.SQLException
response
- Response to processjava.sql.SQLException
- For errors returned from the server.void processResponseWarnings(Response response, WarningMessageCallback warningCallback)
response
- Response to processvoid writeDirect(byte[] data) throws java.io.IOException
OutputStream
of 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.
data
- Data to writejava.io.IOException
- If there is no socket, the socket is closed, or for errors writing to the socket.WireConnection.writeDirect(byte[])
void authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket, DbCryptCallback dbCryptCallback, FbWireOperations.ProcessAttachCallback processAttachCallback) throws java.io.IOException, java.sql.SQLException
This method is only relevant for protocol V13 or higher.
acceptPacket
- Packet with op_cond_accept
data, or null
when 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 responsejava.io.IOException
- For errors reading the response from the connection.java.sql.SQLException
- For errors returned from the server, or when attempting to
read.void setNetworkTimeout(int milliseconds) throws java.sql.SQLException
milliseconds
- Timeout in milliseconds; 0 means no timeout. If the attachment doesn't support milliseconds, it should
round up to the nearest second.java.sql.SQLException
- If this attachment is closed, the value of milliseconds
is smaller than 0, or if setting the
timeout fails.java.sql.SQLFeatureNotSupportedException
- If this attachment doesn't support changing the network timeout.Copyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.