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

## Class OdbcRequestHandler

- java.lang.Object
- - org.apache.ignite.internal.processors.odbc.odbc.OdbcRequestHandler

All Implemented Interfaces:
  ClientListenerRequestHandler

    public class OdbcRequestHandler
    extends Object
    implements ClientListenerRequestHandler

SQL query handler.

### Constructor Summary

Constructors
Constructor and Description
`OdbcRequestHandler(GridKernalContext ctx, GridSpinBusyLock busyLock, ClientListenerResponseSender sender, int maxCursors, boolean distributedJoins, boolean enforceJoinOrder, boolean replicatedOnly, boolean collocated, boolean lazy, boolean skipReducerOnUpdate, NestedTxMode nestedTxMode, ClientListenerProtocolVersion ver, OdbcConnectionContext connCtx)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`ClientListenerResponse` `doHandle(OdbcRequest req)` Handle ODBC request.
`ClientListenerResponse` `handle(ClientListenerRequest req0)` Handle request.
`ClientListenerResponse` `handleException(Throwable 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 within given version of protocol.
`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

#### OdbcRequestHandler

    public OdbcRequestHandler(GridKernalContext ctx,
                              GridSpinBusyLock busyLock,
                              ClientListenerResponseSender sender,
                              int maxCursors,
                              boolean distributedJoins,
                              boolean enforceJoinOrder,
                              boolean replicatedOnly,
                              boolean collocated,
                              boolean lazy,
                              boolean skipReducerOnUpdate,
                              NestedTxMode nestedTxMode,
                              ClientListenerProtocolVersion ver,
                              OdbcConnectionContext connCtx)

Constructor.

Parameters:
  `ctx` - Context.
  `busyLock` - Shutdown latch.
  `sender` - Results sender.
  `maxCursors` - Maximum allowed cursors.
  `distributedJoins` - Distributed joins flag.
  `enforceJoinOrder` - Enforce join order flag.
  `replicatedOnly` - Replicated only flag.
  `collocated` - Collocated flag.
  `lazy` - Lazy flag.
  `skipReducerOnUpdate` - Skip reducer on update flag.
  `nestedTxMode` - Nested transaction mode.
  `ver` - Client protocol version.

### Method Detail

#### handle

    public ClientListenerResponse handle(ClientListenerRequest req0)

Handle request.

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

#### doHandle

    public ClientListenerResponse doHandle(OdbcRequest req)

Handle ODBC request.

Parameters:
  `req` - ODBC request.
Returns:
  Response.

#### handleException

    public ClientListenerResponse handleException(Throwable 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.

#### 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;

#### isCancellationSupported

    public boolean isCancellationSupported()

Checks whether query cancellation is supported within given version of protocol.

Specified by:
  `isCancellationSupported` in interface `ClientListenerRequestHandler`
Returns:
  `true` if supported, `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.

#### 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.12.0
Release Date | : January 10 2022