java.lang.Object
org.firebirdsql.gds.ng.AbstractFbBlob
org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
- All Implemented Interfaces:
AutoCloseable
,FbBlob
,DatabaseListener
,ExceptionListenable
,TransactionListener
,FbWireBlob
- Direct Known Subclasses:
AbstractFbWireInputBlob
,AbstractFbWireOutputBlob
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
Operation codes to open an input or output blob.Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.FbBlob
FbBlob.SeekMode
-
Field Summary
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
exceptionListenerDispatcher
Fields inherited from interface org.firebirdsql.gds.ng.FbBlob
NO_BLOB_ID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractFbWireBlob
(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Internal implementation ofAbstractFbBlob.cancel()
.protected void
Internal implementation ofAbstractFbBlob.close()
.byte[]
getBlobInfo
(byte[] requestItems, int bufferLength) Request blob info.final int
protected final XdrInputStream
getXdrIn()
Gets the XdrInputStream.protected final XdrOutputStream
Gets the XdrOutputStream.protected void
releaseBlob
(int releaseOperation) Release this blob with the specified operation.protected void
Release Java resources held.protected final void
sendOpen
(AbstractFbWireBlob.BlobOpenOperation openOperation) protected final void
setHandle
(int blobHandle) Methods inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearTransaction, close, createBlobLengthProcessor, detached, detaching, get, get, get, getBlobInfo, getBlobParameterBuffer, getMaximumSegmentSize, getTransaction, isEndingTransaction, isEof, isOpen, length, putSegment, removeExceptionListener, resetEof, setEof, setOpen, transactionStateChanged, validateBufferLength, warningReceived, withLock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListener
Methods inherited from interface org.firebirdsql.gds.ng.FbBlob
cancel, close, get, get, getBlobId, getBlobInfo, getMaximumSegmentSize, getSegment, isEof, isOpen, isOutput, length, open, put, putSegment, seek
-
Constructor Details
-
AbstractFbWireBlob
protected AbstractFbWireBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer)
-
-
Method Details
-
getDatabase
- Specified by:
getDatabase
in interfaceFbBlob
- Overrides:
getDatabase
in classAbstractFbBlob
- Returns:
- The database connection that created this blob
-
getHandle
public final int getHandle() -
setHandle
protected final void setHandle(int blobHandle) - Parameters:
blobHandle
- The Firebird blob handle identifier
-
releaseBlob
Release this blob with the specified operation.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.
- Parameters:
releaseOperation
- EitherWireProtocolConstants.op_close_blob
orWireProtocolConstants.op_cancel_blob
- Throws:
SQLException
- For database communication errors.
-
sendOpen
protected final void sendOpen(AbstractFbWireBlob.BlobOpenOperation openOperation) throws SQLException - Throws:
SQLException
-
closeImpl
Description copied from class:AbstractFbBlob
Internal implementation ofAbstractFbBlob.close()
. The implementation does not need to check for attached database and active transaction, nor does it need to mark this blob as closed.- Specified by:
closeImpl
in classAbstractFbBlob
- Throws:
SQLException
-
cancelImpl
Description copied from class:AbstractFbBlob
Internal implementation ofAbstractFbBlob.cancel()
. The implementation does not need to check for attached database and active transaction, nor does it need to mark this blob as closed.- Specified by:
cancelImpl
in classAbstractFbBlob
- Throws:
SQLException
-
releaseResources
protected void releaseResources()Description copied from class:AbstractFbBlob
Release Java resources held. This should not communicate with the Firebird server.- Specified by:
releaseResources
in classAbstractFbBlob
-
getBlobInfo
Description copied from interface:FbBlob
Request blob info.- Specified by:
getBlobInfo
in interfaceFbBlob
- Parameters:
requestItems
- Array of info items to requestbufferLength
- Response buffer length to use- Returns:
- Response buffer
- Throws:
SQLException
-
getXdrIn
Gets the XdrInputStream.- Returns:
- instance of XdrInputStream
- Throws:
SQLException
- if no connection is opened or when exceptions occur retrieving the InputStream- Since:
- 6
-
getXdrOut
Gets the XdrOutputStream.- Returns:
- instance of XdrOutputStream
- Throws:
SQLException
- if no connection is opened or when exceptions occur retrieving the OutputStream- Since:
- 6
-