public abstract class AbstractFbWireBlob extends AbstractFbBlob implements FbWireBlob
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractFbWireBlob.BlobOpenOperation
Operation codes to open an input or output blob.
|
AbstractFbBlob.BlobState
FbBlob.SeekMode
exceptionListenerDispatcher
NO_BLOB_ID
Modifier | Constructor and Description |
---|---|
protected |
AbstractFbWireBlob(FbWireDatabase database,
FbWireTransaction transaction,
BlobParameterBuffer blobParameterBuffer) |
Modifier and Type | Method and Description |
---|---|
protected void |
cancelImpl()
Internal implementation of
AbstractFbBlob.cancel() . |
protected void |
closeImpl()
Internal implementation of
AbstractFbBlob.close() . |
byte[] |
getBlobInfo(byte[] requestItems,
int bufferLength)
Request blob info.
|
FbWireDatabase |
getDatabase() |
int |
getHandle()
Returns the blob handle identifier.
|
protected XdrInputStream |
getXdrIn()
Gets the XdrInputStream.
|
protected XdrOutputStream |
getXdrOut()
Gets the XdrOutputStream.
|
protected void |
processOpenResponse(GenericResponse genericResponse) |
protected void |
receiveOpenResponse() |
protected void |
releaseBlob(int releaseOperation)
Release this blob with the specified operation.
|
protected void |
releaseResources()
Release Java resources held.
|
protected void |
sendOpen(AbstractFbWireBlob.BlobOpenOperation openOperation,
boolean flush) |
protected void |
setHandle(int blobHandle) |
protected <T> DeferredAction |
wrapDeferredResponse(DeferredResponse<T> deferredResponse,
java.util.function.Function<Response,T> responseMapper)
Wraps a deferred response to produce a deferred action that can be added using
FbWireDatabase.enqueueDeferredAction(DeferredAction) , notifying the exception listener of this blob for
exceptions. |
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearDeferredException, clearTransaction, close, createBlobLengthProcessor, detached, detaching, errorOccurred, get, get, get, getBlobInfo, getBlobParameterBuffer, getKnownBlobInfoItems, getMaximumSegmentSize, getState, getTransaction, isEndingTransaction, isEof, isOpen, length, putSegment, registerDeferredException, removeExceptionListener, resetEof, setEof, setState, throwAndClearDeferredException, transactionStateChanged, transferDeferredExceptionTo, validateBufferLength, warningReceived, withLock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, close, get, get, getBlobId, getBlobInfo, getMaximumSegmentSize, getSegment, isEof, isOpen, isOutput, length, open, put, putSegment, seek
addExceptionListener, removeExceptionListener
protected AbstractFbWireBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer) throws java.sql.SQLException
java.sql.SQLException
public FbWireDatabase getDatabase()
getDatabase
in interface FbBlob
getDatabase
in class AbstractFbBlob
public final int getHandle()
FbBlob
If the blob wasn't opened yet, this will return 0
. If the blob was deferred opened (client-side only),
this will return an invalid blob handle value (e.g. 0xFFFF
, though this value is potentially
protocol/implementation specific).
protected final void setHandle(int blobHandle)
blobHandle
- The Firebird blob handle identifierprotected void releaseBlob(int releaseOperation) throws java.sql.SQLException
Implementations should only do the operation and not perform any further clean up or checks on attached database and active transaction, as those checks and clean up should be done by the caller.
If the blob state is AbstractFbBlob.BlobState.DELAYED_OPEN
, this method is
effectively a no-op.
releaseOperation
- Either WireProtocolConstants.op_close_blob
or WireProtocolConstants.op_cancel_blob
java.sql.SQLException
- For database communication errors.protected final void sendOpen(AbstractFbWireBlob.BlobOpenOperation openOperation, boolean flush) throws java.sql.SQLException
java.sql.SQLException
protected final void receiveOpenResponse() throws java.sql.SQLException
java.sql.SQLException
protected void processOpenResponse(GenericResponse genericResponse) throws java.sql.SQLException
java.sql.SQLException
protected void closeImpl() throws java.sql.SQLException
AbstractFbBlob
AbstractFbBlob.close()
. The implementation does not need
to check for attached database and active transaction, nor does it need to mark this blob as closed.closeImpl
in class AbstractFbBlob
java.sql.SQLException
protected void cancelImpl() throws java.sql.SQLException
AbstractFbBlob
AbstractFbBlob.cancel()
. The implementation does not need
to check for attached database and active transaction, nor does it need to mark this blob as closed.cancelImpl
in class AbstractFbBlob
java.sql.SQLException
protected void releaseResources()
AbstractFbBlob
releaseResources
in class AbstractFbBlob
public byte[] getBlobInfo(byte[] requestItems, int bufferLength) throws java.sql.SQLException
FbBlob
getBlobInfo
in interface FbBlob
requestItems
- Array of info items to requestbufferLength
- Response buffer length to usejava.sql.SQLException
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 OutputStreamprotected final <T> DeferredAction wrapDeferredResponse(DeferredResponse<T> deferredResponse, java.util.function.Function<Response,T> responseMapper)
FbWireDatabase.enqueueDeferredAction(DeferredAction)
, notifying the exception listener of this blob for
exceptions.
This should only be used with protocol versions that support deferred responses. Its placement in the hierarchy is due to support for both input and output blobs.
T
- type of deferred responsedeferredResponse
- deferred response to wrapresponseMapper
- Function to map a Response
to the object expected by the deferred responseCopyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.