Interface ProtocolDescriptor

  • All Known Implementing Classes:
    AbstractProtocolDescriptor, Version10Descriptor, Version11Descriptor, Version12Descriptor, Version13Descriptor, Version15Descriptor, Version16Descriptor, Version18Descriptor

    public interface ProtocolDescriptor
    Descriptor of protocol information.

    The driver maintains a list of default protocol descriptors that are loaded using a ServiceLoader from the file META-INF/services/org.firebirdsql.gds.ng.wire.ProtocolDescriptor

    Protocol descriptors loaded this way are required to adhere to the following rules:

    • They provide a no-arg constructor
    • All instances of a specific implementation class created with the no-arg constructor have the same Object.hashCode().
    • All instances of a specific implementation class created with the no-arg constructor are considered equal to each other by the Object.equals(Object) implementation

    Since:
    3.0
    Author:
    Mark Rotteveel
    • Method Detail

      • getVersion

        int getVersion()
        Returns:
        The protocol version
      • getArchitecture

        int getArchitecture()
        Returns:
        Protocol architecture
      • getMinimumType

        int getMinimumType()
        Returns:
        Minimum supported protocol type
      • getMaximumType

        int getMaximumType()
        Returns:
        Maximum supported protocol type
      • supportsWireCompression

        boolean supportsWireCompression()
        Returns:
        true when zlib wire compression is supported
      • getWeight

        int getWeight()
        Returns:
        Preference weight
      • createService

        FbWireService createService​(WireServiceConnection connection)
        Create FbWireService implementation for this protocol.
        Parameters:
        connection - WireServiceConnection to this service
        Returns:
        FbWireService implementation
      • createStatement

        FbWireStatement createStatement​(FbWireDatabase database)
        Create FbStatement implementation for this protocol.
        Parameters:
        database - FbWireDatabase of the current database
        Returns:
        FbStatement implementation
      • createDatabaseParameterBuffer

        DatabaseParameterBuffer createDatabaseParameterBuffer​(WireDatabaseConnection connection)
                                                       throws java.sql.SQLException
        Create DatabaseParameterBuffer implementation and populate it with supported properties for this protocol version.
        Parameters:
        connection - Connection
        Returns:
        DatabaseParameterBuffer implementation
        Throws:
        java.sql.SQLException
      • createAttachServiceParameterBuffer

        ServiceParameterBuffer createAttachServiceParameterBuffer​(WireServiceConnection connection)
                                                           throws java.sql.SQLException
        Create an attach ServiceParameterBuffer implementation and populate it with supported properties for this protocol version.
        Parameters:
        connection - Connection
        Returns:
        ServiceParameterBuffer implementation for attach
        Throws:
        java.sql.SQLException
      • createBlrCalculator

        BlrCalculator createBlrCalculator​(FbWireDatabase database)
        Create BlrCalculator implementation for this protocol version.
        Parameters:
        database - FbWireDatabase of the current database
        Returns:
        BlrCalculator implementation
      • createOutputBlob

        FbWireBlob createOutputBlob​(FbWireDatabase database,
                                    FbWireTransaction transaction,
                                    BlobParameterBuffer blobParameterBuffer)
        Create an output FbWireBlob implementation for this protocol version.
        Parameters:
        database - FbWireDatabase of the current database
        transaction - FbWireTransaction to associate with the blob
        blobParameterBuffer - Blob Parameter Buffer
        Returns:
        FbWireBlob implementation
      • createInputBlob

        FbWireBlob createInputBlob​(FbWireDatabase database,
                                   FbWireTransaction transaction,
                                   BlobParameterBuffer blobParameterBuffer,
                                   long blobId)
        Create an input FbWireBlob implementation for this protocol version.
        Parameters:
        database - FbWireDatabase of the current database
        transaction - FbWireTransaction to associate with the blob
        blobParameterBuffer - Blob Parameter Buffer
        blobId - Blob Id (must be non-zero for input blob)
        Returns:
        FbWireBlob implementation
      • createAsynchronousChannel

        FbWireAsynchronousChannel createAsynchronousChannel​(FbWireDatabase database)
        Create a disconnected asynchronous channel.
        Parameters:
        database - The parent database handle.
        Returns:
        Asynchronous channel implementation
      • createWireOperations

        FbWireOperations createWireOperations​(WireConnection<?,​?> connection,
                                              WarningMessageCallback defaultWarningMessageCallback)
        Create an FbWireOperations implementation for this protocol version.
        Parameters:
        connection - WireConnection instance (non-null)
        defaultWarningMessageCallback - default warning message callback (non-null)
        Returns:
        Wire operations implementation