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,Version18Descriptor
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 protectedAbstractProtocolDescriptor(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 ServiceParameterBuffercreateAttachServiceParameterBuffer(WireServiceConnection connection)Create an attachServiceParameterBufferimplementation and populate it with supported properties for this protocol version.DatabaseParameterBuffercreateDatabaseParameterBuffer(WireDatabaseConnection connection)CreateDatabaseParameterBufferimplementation and populate it with supported properties for this protocol version.booleanequals(java.lang.Object other)intgetArchitecture()intgetMaximumType()intgetMinimumType()protected abstract ParameterConverter<WireDatabaseConnection,WireServiceConnection>getParameterConverter()intgetVersion()intgetWeight()inthashCode()booleansupportsWireCompression()-
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-trueif this version supports zlib wire compressionweight- Selection weight (higher values have higher preference)
-
-
Method Detail
-
getVersion
public final int getVersion()
- Specified by:
getVersionin interfaceProtocolDescriptor- Returns:
- The protocol version
-
getArchitecture
public final int getArchitecture()
- Specified by:
getArchitecturein interfaceProtocolDescriptor- Returns:
- Protocol architecture
-
getMinimumType
public final int getMinimumType()
- Specified by:
getMinimumTypein interfaceProtocolDescriptor- Returns:
- Minimum supported protocol type
-
getMaximumType
public final int getMaximumType()
- Specified by:
getMaximumTypein interfaceProtocolDescriptor- Returns:
- Maximum supported protocol type
-
supportsWireCompression
public final boolean supportsWireCompression()
- Specified by:
supportsWireCompressionin interfaceProtocolDescriptor- Returns:
truewhen zlib wire compression is supported
-
getWeight
public final int getWeight()
- Specified by:
getWeightin interfaceProtocolDescriptor- Returns:
- Preference weight
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object- Returns:
- Hash code based on
version,architecture,minimumType,maximumTypeandweight.
-
equals
public boolean equals(java.lang.Object other)
Default implementation for the rules described in
ProtocolDescriptor. Returnstrueif the other object is of the exact same class as this instance.- Overrides:
equalsin classjava.lang.Object
-
createDatabaseParameterBuffer
public final DatabaseParameterBuffer createDatabaseParameterBuffer(WireDatabaseConnection connection) throws java.sql.SQLException
Description copied from interface:ProtocolDescriptorCreateDatabaseParameterBufferimplementation and populate it with supported properties for this protocol version.- Specified by:
createDatabaseParameterBufferin 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:ProtocolDescriptorCreate an attachServiceParameterBufferimplementation and populate it with supported properties for this protocol version.- Specified by:
createAttachServiceParameterBufferin interfaceProtocolDescriptor- Parameters:
connection- Connection- Returns:
- ServiceParameterBuffer implementation for attach
- Throws:
java.sql.SQLException
-
getParameterConverter
protected abstract ParameterConverter<WireDatabaseConnection,WireServiceConnection> getParameterConverter()
- Returns:
ParameterConverterfor populating the database parameter buffer.
-
-