public abstract class AbstractWireOperations extends java.lang.Object implements FbWireOperations
FbWireOperations.ProcessAttachCallback
Modifier | Constructor and Description |
---|---|
protected |
AbstractWireOperations(WireConnection<?,?> connection,
WarningMessageCallback defaultWarningMessageCallback,
java.lang.Object syncObject) |
Modifier and Type | Method and Description |
---|---|
protected void |
addServerKeys(byte[] serverKeys) |
protected void |
clearServerKeys() |
void |
consumePackets(int numberOfResponses,
WarningMessageCallback warningCallback)
Consumes packets notifying for warnings, but ignoring exceptions thrown from the packet.
|
protected IAttachProperties<?> |
getAttachProperties() |
protected ClientAuthBlock |
getClientAuthBlock() |
protected WireConnection<?,?> |
getConnection() |
protected WarningMessageCallback |
getDefaultWarningMessageCallback() |
protected Encoding |
getEncoding() |
protected java.util.List<EncryptionIdentifier> |
getEncryptionIdentifiers() |
protected java.lang.Object |
getSynchronizationObject() |
protected XdrInputStream |
getXdrIn()
Gets the XdrInputStream.
|
protected XdrOutputStream |
getXdrOut()
Gets the XdrOutputStream.
|
XdrStreamAccess |
getXdrStreamAccess() |
protected Response |
processOperation(int operation)
Reads the response based on the specified operation.
|
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 warningCallback)
Convenience method to read a Response to a GenericResponse
|
int |
readNextOperation()
Reads the next operation.
|
Response |
readOperationResponse(int operationCode,
WarningMessageCallback warningCallback)
Reads the response from the server when the operation code has already been read.
|
Response |
readResponse(WarningMessageCallback warningCallback)
Reads the response from the server.
|
Response |
readSingleResponse(WarningMessageCallback warningCallback)
Reads the response from the server.
|
SqlResponse |
readSqlResponse(WarningMessageCallback warningCallback)
Convenience method to read a Response to a SqlResponse
|
java.sql.SQLException |
readStatusVector()
Process the status vector and returns the associated
SQLException
instance. |
void |
writeDirect(byte[] data)
Writes directly to the
OutputStream of the underlying connection. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authReceiveResponse, enqueueDeferredAction, processDeferredActions
protected AbstractWireOperations(WireConnection<?,?> connection, WarningMessageCallback defaultWarningMessageCallback, java.lang.Object syncObject)
public final XdrStreamAccess getXdrStreamAccess()
getXdrStreamAccess
in interface FbWireOperations
XdrStreamAccess
for this service.protected final Encoding getEncoding()
protected final XdrInputStream getXdrIn() throws java.sql.SQLException
java.sql.SQLException
- If no connection is opened or when exceptions occur
retrieving the InputStreamprotected final XdrOutputStream getXdrOut() throws java.sql.SQLException
java.sql.SQLException
- If no connection is opened or when exceptions occur
retrieving the OutputStreampublic final java.sql.SQLException readStatusVector() throws java.sql.SQLException
FbWireOperations
SQLException
instance.
NOTE: This method returns the SQLException read from the status vector, and only throws SQLException when an error occurs processing the status ector.
readStatusVector
in interface FbWireOperations
java.sql.SQLException
- for errors reading or processing the status vectorpublic final Response readResponse(WarningMessageCallback warningCallback) throws java.sql.SQLException, java.io.IOException
FbWireOperations
readResponse
in interface FbWireOperations
warningCallback
- 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.public final Response readOperationResponse(int operationCode, WarningMessageCallback warningCallback) throws java.sql.SQLException, java.io.IOException
FbWireOperations
readOperationResponse
in interface FbWireOperations
operationCode
- The operation codewarningCallback
- 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.FbWireOperations.readResponse(WarningMessageCallback)
public final Response readSingleResponse(WarningMessageCallback warningCallback) throws java.sql.SQLException, java.io.IOException
FbWireOperations
readSingleResponse
in interface FbWireOperations
warningCallback
- Callback object for signalling warnings, null
to register warning on the default callbackjava.sql.SQLException
- For errors returned from the server, or when attempting to
readjava.io.IOException
- For errors reading the response from the connection.public final int readNextOperation() throws java.io.IOException
WireConnection.readNextOperation()
.java.io.IOException
- For errors reading the operation from the connectionprotected final Response processOperation(int operation) throws java.sql.SQLException, java.io.IOException
operation
- Database operationjava.sql.SQLException
- For errors reading the response from the connection.java.io.IOException
- For errors reading the response from the connection.public final void processResponse(Response response) throws java.sql.SQLException
processResponse
in interface FbWireOperations
response
- Response to processjava.sql.SQLException
- For errors returned from the server.public final void processResponseWarnings(Response response, WarningMessageCallback warningCallback)
processResponseWarnings
in interface FbWireOperations
response
- Response to processpublic final GenericResponse readGenericResponse(WarningMessageCallback warningCallback) throws java.sql.SQLException, java.io.IOException
FbWireOperations
readGenericResponse
in interface FbWireOperations
warningCallback
- 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.public final SqlResponse readSqlResponse(WarningMessageCallback warningCallback) throws java.sql.SQLException, java.io.IOException
FbWireOperations
readSqlResponse
in interface FbWireOperations
warningCallback
- 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.public final void consumePackets(int numberOfResponses, WarningMessageCallback warningCallback)
FbWireOperations
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).
consumePackets
in interface FbWireOperations
numberOfResponses
- Number of responses to consume.warningCallback
- Callback for warningspublic final void writeDirect(byte[] data) throws java.io.IOException
FbWireOperations
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.
writeDirect
in interface FbWireOperations
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[])
protected final java.lang.Object getSynchronizationObject()
protected final void addServerKeys(byte[] serverKeys) throws java.sql.SQLException
java.sql.SQLException
protected final void clearServerKeys()
protected final ClientAuthBlock getClientAuthBlock()
protected final IAttachProperties<?> getAttachProperties()
protected final java.util.List<EncryptionIdentifier> getEncryptionIdentifiers()
protected final WireConnection<?,?> getConnection()
protected final WarningMessageCallback getDefaultWarningMessageCallback()
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.