Class ClientRequestHandler
- java.lang.Object
-
- org.apache.ignite.internal.processors.platform.client.ClientRequestHandler
-
- All Implemented Interfaces:
ClientListenerRequestHandler
public class ClientRequestHandler extends Object implements ClientListenerRequestHandler
Thin client request handler.
-
-
Field Summary
Fields Modifier and Type Field Description static longDFLT_ASYNC_REQUEST_WAIT_TIMEOUT_MILLISTimeout to wait for async requests completion, to handle them as regular sync requests.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientListenerResponsehandle(ClientListenerRequest req)Handle request.ClientListenerResponsehandleException(Throwable e, ClientListenerRequest req)Handle exception.booleanisCancellationCommand(int cmdId)Detect whether given command is a cancellation command.booleanisCancellationSupported()Checks whether query cancellation is supported within given version of protocol.ClientListenerProtocolVersionprotocolVersion()voidregisterRequest(long reqId, int cmdType)Registers request for futher cancellation if any.voidunregisterRequest(long reqId)Try to unregister request.voidwriteHandshake(BinaryWriterExImpl writer)Write successful handshake response.
-
-
-
Field Detail
-
DFLT_ASYNC_REQUEST_WAIT_TIMEOUT_MILLIS
public static final long DFLT_ASYNC_REQUEST_WAIT_TIMEOUT_MILLIS
Timeout to wait for async requests completion, to handle them as regular sync requests.- See Also:
- Constant Field Values
-
-
Method Detail
-
handle
public ClientListenerResponse handle(ClientListenerRequest req)
Handle request.- Specified by:
handlein interfaceClientListenerRequestHandler- Parameters:
req- Request.- Returns:
- Response.
-
handleException
public ClientListenerResponse handleException(Throwable e, ClientListenerRequest req)
Handle exception.- Specified by:
handleExceptionin interfaceClientListenerRequestHandler- Parameters:
e- Exception.req- Request.- Returns:
- Error response.
-
writeHandshake
public void writeHandshake(BinaryWriterExImpl writer)
Write successful handshake response.- Specified by:
writeHandshakein interfaceClientListenerRequestHandler- Parameters:
writer- Binary writer.
-
isCancellationCommand
public boolean isCancellationCommand(int cmdId)
Detect whether given command is a cancellation command.- Specified by:
isCancellationCommandin interfaceClientListenerRequestHandler- 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:
isCancellationSupportedin interfaceClientListenerRequestHandler- Returns:
trueif supported,falseotherwise.
-
registerRequest
public void registerRequest(long reqId, int cmdType)Registers request for futher cancellation if any.- Specified by:
registerRequestin interfaceClientListenerRequestHandler- Parameters:
reqId- Request Id.cmdType- Command Type.
-
unregisterRequest
public void unregisterRequest(long reqId)
Try to unregister request.- Specified by:
unregisterRequestin interfaceClientListenerRequestHandler- Parameters:
reqId- Request Id.
-
protocolVersion
public ClientListenerProtocolVersion protocolVersion()
- Specified by:
protocolVersionin interfaceClientListenerRequestHandler- Returns:
- Protocol version.
-
-