Class JdbcMessageParser
- java.lang.Object
-
- org.apache.ignite.internal.processors.odbc.jdbc.JdbcMessageParser
-
- All Implemented Interfaces:
ClientListenerMessageParser
public class JdbcMessageParser extends Object implements ClientListenerMessageParser
JDBC message parser.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intINIT_CAPInitial output stream capacity.
-
Constructor Summary
Constructors Constructor Description JdbcMessageParser(GridKernalContext ctx, JdbcProtocolContext protoCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BinaryReaderExImplcreateReader(ClientMessage msg)protected BinaryWriterExImplcreateWriter(int cap)ClientListenerRequestdecode(ClientMessage msg)Decode request from byte array.intdecodeCommandType(ClientMessage msg)Decode command type.longdecodeRequestId(ClientMessage msg)Decode request Id.ClientMessageencode(ClientListenerResponse msg)Encode response to byte array.
-
-
-
Field Detail
-
INIT_CAP
protected static final int INIT_CAP
Initial output stream capacity.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JdbcMessageParser
public JdbcMessageParser(GridKernalContext ctx, JdbcProtocolContext protoCtx)
- Parameters:
ctx- Context.protoCtx- Protocol context.
-
-
Method Detail
-
createReader
protected BinaryReaderExImpl createReader(ClientMessage msg)
- Parameters:
msg- Message.- Returns:
- Reader.
-
createWriter
protected BinaryWriterExImpl createWriter(int cap)
- Parameters:
cap- Capacisty- Returns:
- Writer.
-
decode
public ClientListenerRequest decode(ClientMessage msg)
Decode request from byte array.- Specified by:
decodein interfaceClientListenerMessageParser- Parameters:
msg- Message.- Returns:
- Request.
-
encode
public ClientMessage encode(ClientListenerResponse msg)
Encode response to byte array.- Specified by:
encodein interfaceClientListenerMessageParser- Parameters:
msg- Response.- Returns:
- Message.
-
decodeCommandType
public int decodeCommandType(ClientMessage msg)
Decode command type. Allows to recognize the command (message type) without decoding the entire message.- Specified by:
decodeCommandTypein interfaceClientListenerMessageParser- Parameters:
msg- Message.- Returns:
- Command type.
-
decodeRequestId
public long decodeRequestId(ClientMessage msg)
Decode request Id. Allows to recognize the request Id, if any, without decoding the entire message.- Specified by:
decodeRequestIdin interfaceClientListenerMessageParser- Parameters:
msg- Message.- Returns:
- Request Id.
-
-