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 SummaryConstructors Modifier Constructor Description protectedAbstractProtocolDescriptor(int version, int architecture, int minimumType, int maximumType, boolean supportsWireCompression, int weight)Initializes the basic ProtocolDescriptor fields.
 - 
Method SummaryAll 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.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.firebirdsql.gds.ng.wire.ProtocolDescriptorcreateAsynchronousChannel, createBlrCalculator, createDatabase, createInputBlob, createOutputBlob, createService, createServiceParameterBuffer, createServiceRequestBuffer, createStatement, createTransaction, createWireOperations
 
- 
 
- 
- 
- 
Constructor Detail- 
AbstractProtocolDescriptorprotected AbstractProtocolDescriptor(int version, int architecture, int minimumType, int maximumType, boolean supportsWireCompression, int weight)Initializes the basic ProtocolDescriptor fields.- Parameters:
- version- Version of the protocol
- architecture- Architecture of the protocol
- minimumType- Minimum supported protocol type
- maximumType- Maximum supported protocol type
- supportsWireCompression-- trueif this version supports zlib wire compression
- weight- Selection weight (higher values have higher preference)
 
 
- 
 - 
Method Detail- 
getVersionpublic final int getVersion() - Specified by:
- getVersionin interface- ProtocolDescriptor
- Returns:
- The protocol version
 
 - 
getArchitecturepublic final int getArchitecture() - Specified by:
- getArchitecturein interface- ProtocolDescriptor
- Returns:
- Protocol architecture
 
 - 
getMinimumTypepublic final int getMinimumType() - Specified by:
- getMinimumTypein interface- ProtocolDescriptor
- Returns:
- Minimum supported protocol type
 
 - 
getMaximumTypepublic final int getMaximumType() - Specified by:
- getMaximumTypein interface- ProtocolDescriptor
- Returns:
- Maximum supported protocol type
 
 - 
supportsWireCompressionpublic final boolean supportsWireCompression() - Specified by:
- supportsWireCompressionin interface- ProtocolDescriptor
- Returns:
- truewhen zlib wire compression is supported
 
 - 
getWeightpublic final int getWeight() - Specified by:
- getWeightin interface- ProtocolDescriptor
- Returns:
- Preference weight
 
 - 
hashCodepublic final int hashCode() - Overrides:
- hashCodein class- java.lang.Object
- Returns:
- Hash code based on version,architecture,minimumType,maximumTypeandweight.
 
 - 
equalspublic 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 class- java.lang.Object
 
 - 
createDatabaseParameterBufferpublic 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 interface- ProtocolDescriptor
- Parameters:
- connection- Connection
- Returns:
- DatabaseParameterBuffer implementation
- Throws:
- java.sql.SQLException
 
 - 
createAttachServiceParameterBufferpublic 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 interface- ProtocolDescriptor
- Parameters:
- connection- Connection
- Returns:
- ServiceParameterBuffer implementation for attach
- Throws:
- java.sql.SQLException
 
 - 
getParameterConverterprotected abstract ParameterConverter<WireDatabaseConnection,WireServiceConnection> getParameterConverter() - Returns:
- ParameterConverterfor populating the database parameter buffer.
 
 
- 
 
-