org.firebirdsql.gds.ng.wire.version10

## Class V10Service

- java.lang.Object
- - org.firebirdsql.gds.ng.AbstractFbAttachment<T>
  - - org.firebirdsql.gds.ng.AbstractFbService<WireServiceConnection>
    - - org.firebirdsql.gds.ng.wire.AbstractFbWireService
      - - org.firebirdsql.gds.ng.wire.version10.V10Service

- All Implemented Interfaces:
    java.lang.AutoCloseable, FbAttachment, FbService, ExceptionListenable, FbWireAttachment, FbWireService

      public class V10Service
      extends AbstractFbWireService
      implements FbWireService

  `FbWireService` implementation for the V10 wire protocol
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.wire.FbWireAttachment

      `FbWireAttachment.AcceptPacket`

  - ### Field Summary

    - ### Fields inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireService

      `protocolDescriptor, wireOperations`

    - ### Fields inherited from class org.firebirdsql.gds.ng.AbstractFbAttachment

      `connection, exceptionListenerDispatcher`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `V10Service(WireServiceConnection connection, ProtocolDescriptor descriptor)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `afterAttachActions()`
    `void` | `attach()` Attach to the attachment type.
    `void` | `authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket)` Receive authentication response from the server.
    `protected void` | `closeConnection()` Closes the WireConnection associated with this connection.
    `protected void` | `finalize()`
    `int` | `getHandle()`
    `byte[]` | `getServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int maxBufferLength)` Performs a service info request (service query.
    `protected void` | `internalDetach()` Actual implementation of service detach.
    `protected void` | `processAttachResponse(GenericResponse genericResponse)` Processes the response from the server to the attach or create operation.
    `protected void` | `sendAttachToBuffer(ServiceParameterBuffer spb)` Sends the buffer for op_service_attach
    `void` | `startServiceAction(ServiceRequestBuffer serviceRequestBuffer)` Starts a service action.

    - ### Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireService

      `checkAttached, checkConnected, createServiceParameterBuffer, createServiceRequestBuffer, getXdrIn, getXdrOut, getXdrStreamAccess, isAttached, readGenericResponse`

    - ### Methods inherited from class org.firebirdsql.gds.ng.AbstractFbService

      `addServiceListener, close, getDescribeServiceRequestBuffer, getServiceInfo, getServiceInformationProcessor, getServiceWarningCallback, removeServiceListener`

    - ### Methods inherited from class org.firebirdsql.gds.ng.AbstractFbAttachment

      `addExceptionListener, createDbCryptCallback, getDatatypeCoder, getEncoding, getEncodingFactory, getServerVersion, getServerVersionInformation, getSynchronizationObject, removeExceptionListener, safelyDetach, setAttached, setDetached, setServerVersion`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.FbService

      `addServiceListener, createServiceParameterBuffer, createServiceRequestBuffer, getServiceInfo, removeServiceListener`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.wire.FbWireAttachment

      `getXdrStreamAccess, readGenericResponse`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.FbAttachment

      `close, getDatatypeCoder, getEncoding, getEncodingFactory, getServerVersion, getSynchronizationObject, isAttached`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable

      `addExceptionListener, removeExceptionListener`

- - ### Constructor Detail

    - #### V10Service

          public V10Service(WireServiceConnection connection,
                    ProtocolDescriptor descriptor)

  - ### Method Detail

    - #### getHandle

          public int getHandle()

      Specified by:
        `getHandle` in interface `FbAttachment`
      Specified by:
        `getHandle` in interface `FbService`
      Returns:
        The service handle value

    - #### attach

          public void attach()
                      throws java.sql.SQLException

      Description copied from interface: `FbAttachment`
      Attach to the attachment type.
      Specified by:
        `attach` in interface `FbAttachment`
      Throws:
        `java.sql.SQLException`

    - #### processAttachResponse

          protected void processAttachResponse(GenericResponse genericResponse)

      Processes the response from the server to the attach or create operation.
      Parameters:
        `genericResponse` - GenericResponse received from the server.

    - #### afterAttachActions

          protected void afterAttachActions()
                                     throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### sendAttachToBuffer

          protected void sendAttachToBuffer(ServiceParameterBuffer spb)
                                     throws java.sql.SQLException,
                                            java.io.IOException

      Sends the buffer for op_service_attach
      Parameters:
        `spb` - Service parameter buffer
      Throws:
        `java.sql.SQLException` - If the connection is not open
        `java.io.IOException` - For errors writing to the connection

    - #### internalDetach

          protected void internalDetach()
                                 throws java.sql.SQLException

      Description copied from class: `AbstractFbService`
      Actual implementation of service detach.

      Implementations of this method should only be called from `AbstractFbService.close()`, and should not notify service listeners of the service `ServiceListener.detaching(FbService)` and `ServiceListener.detached(FbService)` events.

      Specified by:
        `internalDetach` in class `AbstractFbService<WireServiceConnection>`
      Throws:
        `java.sql.SQLException`

    - #### getServiceInfo

          public byte[] getServiceInfo(ServiceParameterBuffer serviceParameterBuffer,
                              ServiceRequestBuffer serviceRequestBuffer,
                              int maxBufferLength)
                                throws java.sql.SQLException

      Description copied from interface: `FbService`
      Performs a service info request (service query.
      Specified by:
        `getServiceInfo` in interface `FbService`
      Parameters:
        `serviceParameterBuffer` - Service parameters (can be null)
        `serviceRequestBuffer` - Service request info
        `maxBufferLength` - Maximum response buffer length to use
      Returns:
        The response buffer (note: length is the actual length of the response, not `maxBufferLength`
      Throws:
        `java.sql.SQLException` - For errors retrieving the information.

    - #### startServiceAction

          public void startServiceAction(ServiceRequestBuffer serviceRequestBuffer)
                                  throws java.sql.SQLException

      Description copied from interface: `FbService`
      Starts a service action.
      Specified by:
        `startServiceAction` in interface `FbService`
      Parameters:
        `serviceRequestBuffer` - Service action request details
      Throws:
        `java.sql.SQLException` - For errors starting the service action.

    - #### closeConnection

          protected final void closeConnection()
                                        throws java.io.IOException

      Closes the WireConnection associated with this connection.
      Throws:
        `java.io.IOException` - For errors closing the connection.

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `java.lang.Throwable`

    - #### authReceiveResponse

          public final void authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket)
                                         throws java.io.IOException,
                                                java.sql.SQLException

      Description copied from interface: `FbWireAttachment`
      Receive authentication response from the server.

      This method is only relevant for protocol V13 or higher.

      Specified by:
        `authReceiveResponse` in interface `FbWireAttachment`
      Parameters:
        `acceptPacket` - Packet with `op_cond_accept` data, or `null` when the data should be read from the connection.
      Throws:
        `java.io.IOException` - For errors reading the response from the connection.
        `java.sql.SQLException` - For errors returned from the server, or when attempting to read.

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.