org.apache.ignite.internal.processors.odbc.jdbc

## Class JdbcRequestHandler

- java.lang.Object
- - org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler

All Implemented Interfaces:
  ClientListenerRequestHandler

    public class JdbcRequestHandler
    extends Object
    implements ClientListenerRequestHandler

JDBC request handler.

### Constructor Summary

Constructors
Constructor and Description

`JdbcRequestHandler(GridSpinBusyLock busyLock, ClientListenerResponseSender sender, int maxCursors, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, boolean replicatedOnly, boolean autoCloseCursors, boolean lazy, boolean skipReducerOnUpdate, NestedTxMode nestedTxMode, @Nullable Boolean dataPageScanEnabled, @Nullable Integer updateBatchSize, AuthorizationContext actx, ClientListenerProtocolVersion protocolVer, JdbcConnectionContext connCtx)`
Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`ClientListenerResponse` `handle(ClientListenerRequest req0)` Handle request.
`ClientListenerResponse` `handleException(Exception e, ClientListenerRequest req)` Handle exception.
`boolean` `isCancellationCommand(int cmdId)` Detect whether given command is a cancellation command.
`boolean` `isCancellationSupported()` Checks whether query cancellation is supported whithin given version of protocal.
`void` `onDisconnect()` Called whenever client is disconnected due to correct connection close or due to `IOException` during network operations.
`ClientListenerProtocolVersion` `protocolVersion()`
`void` `registerRequest(long reqId, int cmdType)` Registers request for futher cancellation if any.
`void` `unregisterRequest(long reqId)` Try to unregister request.
`void` `writeHandshake(BinaryWriterExImpl writer)` Write successful handshake response.

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

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

### Constructor Detail

#### JdbcRequestHandler

    public JdbcRequestHandler(GridSpinBusyLock busyLock,
                              ClientListenerResponseSender sender,
                              int maxCursors,
                              boolean distributedJoins,
                              boolean enforceJoinOrder,
                              boolean collocated,
                              boolean replicatedOnly,
                              boolean autoCloseCursors,
                              boolean lazy,
                              boolean skipReducerOnUpdate,
                              NestedTxMode nestedTxMode,
                              @Nullable
                              @Nullable Boolean dataPageScanEnabled,
                              @Nullable
                              @Nullable Integer updateBatchSize,
                              AuthorizationContext actx,
                              ClientListenerProtocolVersion protocolVer,
                              JdbcConnectionContext connCtx)

Constructor.

Parameters:
  `busyLock` - Shutdown latch.
  `sender` - Results sender.
  `maxCursors` - Maximum allowed cursors.
  `distributedJoins` - Distributed joins flag.
  `enforceJoinOrder` - Enforce join order flag.
  `collocated` - Collocated flag.
  `replicatedOnly` - Replicated only flag.
  `autoCloseCursors` - Flag to automatically close server cursors.
  `lazy` - Lazy query execution flag.
  `skipReducerOnUpdate` - Skip reducer on update flag.
  `dataPageScanEnabled` - Enable scan data page mode.
  `updateBatchSize` - Size of internal batch for DML queries.
  `actx` - Authentication context.
  `protocolVer` - Protocol version.
  `connCtx` - Jdbc connection context.

### Method Detail

#### handle

    public ClientListenerResponse handle(ClientListenerRequest req0)

Handle request.

Specified by:
  `handle` in interface `ClientListenerRequestHandler`
Parameters:
  `req0` - Request.
Returns:
  Response.

#### isCancellationCommand

    public boolean isCancellationCommand(int cmdId)

Detect whether given command is a cancellation command.

Specified by:
  `isCancellationCommand` in interface `ClientListenerRequestHandler`
Parameters:
  `cmdId` - Command Id
Returns:
  true if given command is cancellation one, false otherwise;

#### registerRequest

    public void registerRequest(long reqId,
                                int cmdType)

Registers request for futher cancellation if any.

Specified by:
  `registerRequest` in interface `ClientListenerRequestHandler`
Parameters:
  `reqId` - Request Id.
  `cmdType` - Command Type.

#### unregisterRequest

    public void unregisterRequest(long reqId)

Try to unregister request.

Specified by:
  `unregisterRequest` in interface `ClientListenerRequestHandler`
Parameters:
  `reqId` - Request Id.

#### handleException

    public ClientListenerResponse handleException(Exception e,
                                                  ClientListenerRequest req)

Handle exception.

Specified by:
  `handleException` in interface `ClientListenerRequestHandler`
Parameters:
  `e` - Exception.
  `req` - Request.
Returns:
  Error response.

#### writeHandshake

    public void writeHandshake(BinaryWriterExImpl writer)

Write successful handshake response.

Specified by:
  `writeHandshake` in interface `ClientListenerRequestHandler`
Parameters:
  `writer` - Binary writer.

#### onDisconnect

    public void onDisconnect()

Called whenever client is disconnected due to correct connection close or due to `IOException` during network operations.

#### isCancellationSupported

    public boolean isCancellationSupported()

Checks whether query cancellation is supported whithin given version of protocal.

Specified by:
  `isCancellationSupported` in interface `ClientListenerRequestHandler`
Returns:
  True if supported, false otherwise.

#### protocolVersion

    public ClientListenerProtocolVersion protocolVersion()

Specified by:
  `protocolVersion` in interface `ClientListenerRequestHandler`
Returns:
  Protocol version.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020