public abstract class AbstractFbWireService extends AbstractFbService<WireServiceConnection> implements FbWireService
FbWireAttachment.AcceptPacket
Modifier and Type | Field and Description |
---|---|
protected ProtocolDescriptor |
protocolDescriptor |
protected FbWireOperations |
wireOperations |
serviceListenerDispatcher
connection, exceptionListenerDispatcher
Modifier | Constructor and Description |
---|---|
protected |
AbstractFbWireService(WireServiceConnection connection,
ProtocolDescriptor descriptor)
Creates an AbstractFbWireDatabase instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAttached()
Checks if a physical connection to the server is established and if the
connection is attached to a database.
|
protected void |
checkConnected()
Checks if a physical connection to the server is established.
|
ServiceParameterBuffer |
createServiceParameterBuffer()
Creates an empty
ServiceParameterBuffer . |
ServiceRequestBuffer |
createServiceRequestBuffer() |
void |
forceClose()
Forces the connection to close without proper detach or cleanup.
|
protected XdrInputStream |
getXdrIn()
Gets the XdrInputStream.
|
protected XdrOutputStream |
getXdrOut()
Gets the XdrOutputStream.
|
XdrStreamAccess |
getXdrStreamAccess() |
boolean |
isAttached()
Current attachment status.
|
GenericResponse |
readGenericResponse(WarningMessageCallback warningCallback)
Convenience method to read a Response to a GenericResponse
|
void |
setNetworkTimeout(int milliseconds)
Sets the network timeout for this attachment.
|
addServiceListener, close, getDescribeServiceRequestBuffer, getServiceInfo, getServiceInformationProcessor, getServiceWarningCallback, internalDetach, removeServiceListener
addExceptionListener, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, getServerVersionInformation, getSynchronizationObject, removeExceptionListener, safelyDetach, setAttached, setDetached, setServerVersion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addServiceListener, getHandle, getServiceInfo, getServiceInfo, removeServiceListener, startServiceAction
authReceiveResponse
attach, close, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, getSynchronizationObject
addExceptionListener, removeExceptionListener
protected final ProtocolDescriptor protocolDescriptor
protected final FbWireOperations wireOperations
protected AbstractFbWireService(WireServiceConnection connection, ProtocolDescriptor descriptor)
connection
- A WireConnection with an established connection to the server.descriptor
- The ProtocolDescriptor that created this connection (this is
used for creating further dependent objects).public void forceClose() throws java.sql.SQLException
AbstractFbAttachment
If a given implementation does not support this, then this method should call FbAttachment.close()
.
Default implementation, calls FbAttachment.close()
forceClose
in interface FbAttachment
forceClose
in class AbstractFbAttachment<WireServiceConnection>
java.sql.SQLException
- For problems closing the connection.public final ServiceParameterBuffer createServiceParameterBuffer()
FbService
ServiceParameterBuffer
.
Attach expects a service parameter buffer to have the version as the first item. This needs to be added explicitly.
createServiceParameterBuffer
in interface FbService
public final ServiceRequestBuffer createServiceRequestBuffer()
createServiceRequestBuffer
in interface FbService
public final boolean isAttached()
FbAttachment
isAttached
in interface FbAttachment
isAttached
in class AbstractFbAttachment<WireServiceConnection>
true
if connected to the server and attached to a database or service, false
otherwise.protected final void checkConnected() throws java.sql.SQLException
checkConnected
in class AbstractFbAttachment<WireServiceConnection>
java.sql.SQLException
- If not connected.protected final void checkAttached() throws java.sql.SQLException
This method calls checkConnected()
, so it is not necessary to
call both.
java.sql.SQLException
- If the database not connected or attached.public void setNetworkTimeout(int milliseconds) throws java.sql.SQLException
FbAttachment
setNetworkTimeout
in interface FbAttachment
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.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 GenericResponse readGenericResponse(WarningMessageCallback warningCallback) throws java.sql.SQLException, java.io.IOException
FbWireAttachment
readGenericResponse
in interface FbWireAttachment
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 XdrStreamAccess getXdrStreamAccess()
getXdrStreamAccess
in interface FbWireAttachment
XdrStreamAccess
for this attachment.Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.