Package org.firebirdsql.gds.ng.wire
Class AbstractProtocolDescriptor
- java.lang.Object
-
- org.firebirdsql.gds.ng.wire.AbstractProtocolDescriptor
-
- All Implemented Interfaces:
ProtocolDescriptor
- Direct Known Subclasses:
Version10Descriptor
,Version11Descriptor
,Version12Descriptor
,Version13Descriptor
,Version15Descriptor
,Version16Descriptor
public abstract class AbstractProtocolDescriptor extends java.lang.Object implements ProtocolDescriptor
Abstract class to simplify implementation ofProtocolDescriptor
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractProtocolDescriptor(int version, int architecture, int minimumType, int maximumType, boolean supportsWireCompression, int weight)
Initializes the basic ProtocolDescriptor fields.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ServiceParameterBuffer
createAttachServiceParameterBuffer(WireServiceConnection connection)
Create an attachServiceParameterBuffer
implementation and populate it with supported properties for this protocol version.DatabaseParameterBuffer
createDatabaseParameterBuffer(WireDatabaseConnection connection)
CreateDatabaseParameterBuffer
implementation and populate it with supported properties for this protocol version.boolean
equals(java.lang.Object other)
int
getArchitecture()
int
getMaximumType()
int
getMinimumType()
protected abstract ParameterConverter<WireDatabaseConnection,WireServiceConnection>
getParameterConverter()
int
getVersion()
int
getWeight()
int
hashCode()
boolean
supportsWireCompression()
-
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, createBlrCalculator, createDatabase, createInputBlob, createOutputBlob, createService, createServiceParameterBuffer, createServiceRequestBuffer, createStatement, createTransaction, createWireOperations
-
-
-
-
Constructor Detail
-
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 Detail
-
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
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- Hash code based on
version
,architecture
,minimumType
,maximumType
andweight
.
-
equals
public boolean equals(java.lang.Object other)
Default implementation for the rules described in
ProtocolDescriptor
. Returnstrue
if the other object is of the exact same class as this instance.- Overrides:
equals
in classjava.lang.Object
-
createDatabaseParameterBuffer
public final DatabaseParameterBuffer createDatabaseParameterBuffer(WireDatabaseConnection connection) throws java.sql.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:
java.sql.SQLException
-
createAttachServiceParameterBuffer
public final ServiceParameterBuffer createAttachServiceParameterBuffer(WireServiceConnection connection) throws java.sql.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:
java.sql.SQLException
-
getParameterConverter
protected abstract ParameterConverter<WireDatabaseConnection,WireServiceConnection> getParameterConverter()
- Returns:
ParameterConverter
for populating the database parameter buffer.
-
-