T
- Type of attach propertiesC
- Type of connection handlepublic abstract class WireConnection<T extends IAttachProperties<T>,C extends FbWireAttachment> extends AbstractConnection<T,C> implements java.io.Closeable
attachProperties
Modifier | Constructor and Description |
---|---|
protected |
WireConnection(T attachProperties)
Creates a WireConnection (without establishing a connection to the
server) with the default protocol collection.
|
protected |
WireConnection(T attachProperties,
IEncodingFactory encodingFactory,
ProtocolCollection protocols)
Creates a WireConnection (without establishing a connection to the
server).
|
Modifier and Type | Method and Description |
---|---|
void |
clearAuthData()
Clear authentication data.
|
void |
close()
Closes the TCP/IP connection.
|
protected abstract C |
createConnectionHandle(ProtocolDescriptor protocolDescriptor)
Creates the connection handle for this type of connection.
|
protected void |
finalize() |
ClientAuthBlock |
getClientAuthBlock() |
int |
getProtocolArchitecture() |
int |
getProtocolMinimumType() |
int |
getProtocolVersion() |
XdrStreamAccess |
getXdrStreamAccess() |
C |
identify()
Performs the connection identification phase of the Wire protocol and
returns the FbWireDatabase implementation for the agreed protocol.
|
boolean |
isConnected() |
int |
readNextOperation()
Reads the next operation code.
|
void |
resetSocketTimeout()
Resets the socket timeout to the configured socketTimeout.
|
void |
setSoTimeout(int socketTimeout)
Sets the socket blocking timeout (SO_TIMEOUT) of the socket.
|
void |
socketConnect()
Establishes the TCP/IP connection to serverName and portNumber of this
Connection
|
void |
writeDirect(byte[] data)
Writes directly to the
OutputStream of the underlying socket. |
getAttachObjectName, getAttachProperties, getEncoding, getEncodingDefinition, getEncodingFactory, getPortNumber, getServerName
protected WireConnection(T attachProperties) throws java.sql.SQLException
attachProperties
- Attach propertiesjava.sql.SQLException
protected WireConnection(T attachProperties, IEncodingFactory encodingFactory, ProtocolCollection protocols) throws java.sql.SQLException
attachProperties
- Attach propertiesencodingFactory
- Factory for encoding definitionsprotocols
- The collection of protocols to use for this connection.java.sql.SQLException
public final boolean isConnected()
public final int getProtocolVersion()
public final int getProtocolArchitecture()
public final int getProtocolMinimumType()
public final ClientAuthBlock getClientAuthBlock()
public final void setSoTimeout(int socketTimeout) throws java.sql.SQLException
This method can also be called if a connection is established
socketTimeout
- Value of the socket timeout (in milliseconds)java.sql.SQLException
- If the timeout value cannot be changedpublic final void resetSocketTimeout() throws java.sql.SQLException
java.sql.SQLException
- If the timeout value cannot be changedpublic final void socketConnect() throws java.sql.SQLException
java.sql.SQLTimeoutException
- If the connection cannot be established within the connect
timeout (either explicitly set or implied by the OS timeout
of the socket)java.sql.SQLException
- If the connection cannot be established.public final XdrStreamAccess getXdrStreamAccess()
public final C identify() throws java.sql.SQLException
identify
in class AbstractConnection<T extends IAttachProperties<T>,C extends FbWireAttachment>
java.sql.SQLTimeoutException
java.sql.SQLException
public final void clearAuthData()
protected abstract C createConnectionHandle(ProtocolDescriptor protocolDescriptor)
protocolDescriptor
- The protocol descriptor selected by the identify phasepublic final int readNextOperation() throws java.io.IOException
WireProtocolConstants.op_dummy
codes received.java.io.IOException
- if an error occurs while reading from the underlying InputStreampublic final void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- if closing failsprotected final void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public final void writeDirect(byte[] data) throws java.io.IOException
OutputStream
of the underlying socket.data
- Data to writejava.io.IOException
- If there is no socket, the socket is closed, or for errors writing to the socket.Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.