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

## Class OdbcMessageParser

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

All Implemented Interfaces:
  ClientListenerMessageParser

    public class OdbcMessageParser
    extends Object
    implements ClientListenerMessageParser

JDBC message parser.

### Field Summary

Fields
`protected GridKernalContext` `ctx` Kernal context.
`protected static int` `INIT_CAP` Initial output stream capacity.

### Constructor Summary

Constructors
Constructor and Description
`OdbcMessageParser(GridKernalContext ctx, ClientListenerProtocolVersion ver)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ClientListenerRequest` `decode(byte[] msg)` Decode request from byte array.
`int` `decodeCommandType(byte[] msg)` Decode command type.
`long` `decodeRequestId(byte[] msg)` Decode request Id.
`byte[]` `encode(ClientListenerResponse msg0)` Encode response to byte array.

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

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

### Field Detail

#### INIT_CAP

    protected static final int INIT_CAP

Initial output stream capacity.

See Also:
  Constant Field Values

#### ctx

    protected final GridKernalContext ctx

Kernal context.

### Constructor Detail

#### OdbcMessageParser

    public OdbcMessageParser(GridKernalContext ctx,
                             ClientListenerProtocolVersion ver)

Parameters:
  `ctx` - Context.
  `ver` - Protocol version.

### Method Detail

#### decode

    public ClientListenerRequest decode(byte[] msg)

Decode request from byte array.

Specified by:
  `decode` in interface `ClientListenerMessageParser`
Parameters:
  `msg` - Message.
Returns:
  Request.

#### encode

    public byte[] encode(ClientListenerResponse msg0)

Encode response to byte array.

Specified by:
  `encode` in interface `ClientListenerMessageParser`
Parameters:
  `msg0` - Response.
Returns:
  Message.

#### decodeCommandType

    public int decodeCommandType(byte[] msg)

Decode command type. Allows to recognize the command (message type) without decoding the entire message.

Specified by:
  `decodeCommandType` in interface `ClientListenerMessageParser`
Parameters:
  `msg` - Message.
Returns:
  Command type.

#### decodeRequestId

    public long decodeRequestId(byte[] msg)

Decode request Id. Allows to recognize the request Id, if any, without decoding the entire message.

Specified by:
  `decodeRequestId` in interface `ClientListenerMessageParser`
Parameters:
  `msg` - Message.
Returns:
  Request Id.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020