java.lang.Object
org.firebirdsql.gds.ng.wire.AbstractProtocolDescriptor
- All Implemented Interfaces:
ProtocolDescriptor
- Direct Known Subclasses:
Version10Descriptor
,Version11Descriptor
,Version12Descriptor
,Version13Descriptor
,Version15Descriptor
,Version16Descriptor
,Version18Descriptor
Abstract class to simplify implementation of
ProtocolDescriptor
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractProtocolDescriptor
(int version, int architecture, int minimumType, int maximumType, boolean supportsWireCompression, int weight) Initializes the basic ProtocolDescriptor fields. -
Method Summary
Modifier and TypeMethodDescriptionfinal ServiceParameterBuffer
Create an attachServiceParameterBuffer
implementation and populate it with supported properties for this protocol version.createBlrCalculator
(FbWireDatabase database) CreateBlrCalculator
implementation for this protocol version.final DatabaseParameterBuffer
createDatabaseParameterBuffer
(WireDatabaseConnection connection) CreateDatabaseParameterBuffer
implementation and populate it with supported properties for this protocol version.boolean
final int
final int
final int
protected abstract ParameterConverter<WireDatabaseConnection,
WireServiceConnection> final int
final int
final int
hashCode()
final boolean
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.firebirdsql.gds.ng.wire.ProtocolDescriptor
createAsynchronousChannel, createDatabase, createInputBlob, createOutputBlob, createService, createServiceParameterBuffer, createServiceRequestBuffer, createStatement, createTransaction, createWireOperations
-
Constructor Details
-
AbstractProtocolDescriptor
protected AbstractProtocolDescriptor(int version, int architecture, int minimumType, int maximumType, boolean supportsWireCompression, int weight) Initializes the basic ProtocolDescriptor fields.- Parameters:
version
- Version of the protocolarchitecture
- Architecture of the protocolminimumType
- Minimum supported protocol typemaximumType
- Maximum supported protocol typesupportsWireCompression
-true
if this version supports zlib wire compressionweight
- Selection weight (higher values have higher preference)
-
-
Method Details
-
getVersion
public final int getVersion()- Specified by:
getVersion
in interfaceProtocolDescriptor
- Returns:
- The protocol version
-
getArchitecture
public final int getArchitecture()- Specified by:
getArchitecture
in interfaceProtocolDescriptor
- Returns:
- Protocol architecture
-
getMinimumType
public final int getMinimumType()- Specified by:
getMinimumType
in interfaceProtocolDescriptor
- Returns:
- Minimum supported protocol type
-
getMaximumType
public final int getMaximumType()- Specified by:
getMaximumType
in interfaceProtocolDescriptor
- Returns:
- Maximum supported protocol type
-
supportsWireCompression
public final boolean supportsWireCompression()- Specified by:
supportsWireCompression
in interfaceProtocolDescriptor
- Returns:
true
when zlib wire compression is supported
-
getWeight
public final int getWeight()- Specified by:
getWeight
in interfaceProtocolDescriptor
- Returns:
- Preference weight
-
createBlrCalculator
Description copied from interface:ProtocolDescriptor
CreateBlrCalculator
implementation for this protocol version.- Specified by:
createBlrCalculator
in interfaceProtocolDescriptor
- Parameters:
database
- FbWireDatabase of the current database- Returns:
- BlrCalculator implementation
-
hashCode
public final int hashCode() -
equals
Default implementation for the rules described in
ProtocolDescriptor
. Returnstrue
if the other object is of the exact same class as this instance. -
createDatabaseParameterBuffer
public final DatabaseParameterBuffer createDatabaseParameterBuffer(WireDatabaseConnection connection) throws SQLException Description copied from interface:ProtocolDescriptor
CreateDatabaseParameterBuffer
implementation and populate it with supported properties for this protocol version.- Specified by:
createDatabaseParameterBuffer
in interfaceProtocolDescriptor
- Parameters:
connection
- Connection- Returns:
- DatabaseParameterBuffer implementation
- Throws:
SQLException
-
createAttachServiceParameterBuffer
public final ServiceParameterBuffer createAttachServiceParameterBuffer(WireServiceConnection connection) throws SQLException Description copied from interface:ProtocolDescriptor
Create an attachServiceParameterBuffer
implementation and populate it with supported properties for this protocol version.- Specified by:
createAttachServiceParameterBuffer
in interfaceProtocolDescriptor
- Parameters:
connection
- Connection- Returns:
- ServiceParameterBuffer implementation for attach
- Throws:
SQLException
-
getParameterConverter
protected abstract ParameterConverter<WireDatabaseConnection,WireServiceConnection> getParameterConverter()- Returns:
ParameterConverter
for populating the database parameter buffer.
-