public interface Protocol
Protocol is effectively a Message factory. Implementations of this interface
provides Message objects that read and write according to a specific Redis protocol
specification.
Implementations may use this interface to address issues regarding buffer management. [TODO: document me!]
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Protocol.Factory |
| Modifier and Type | Method and Description |
|---|---|
Request |
createRequest(Command cmd,
byte[]... args) |
byte[] |
createRequestBuffer(Command cmd,
byte[]... args)
EXPERIMENTAL
|
Response |
createResponse(Command cmd)
Creates a response object for the
Command specified. |
boolean |
isCompatibleWithVersion(String version) |
boolean isCompatibleWithVersion(String version)
version - Request createRequest(Command cmd, byte[]... args) throws ProviderException, IllegalArgumentException
cmd - args - ProviderExceptionIllegalArgumentExceptionResponse createResponse(Command cmd) throws ProviderException, ClientRuntimeException
Command specified.
Note that this Response object has not yet been read.
cmd - the Command that will be responded to.ClientRuntimeException - if the command is invalid for this version of the protocolProviderException - if the command is not implementedResponsebyte[] createRequestBuffer(Command cmd, byte[]... args) throws ProviderException, IllegalArgumentException
cmd - args - ProviderExceptionIllegalArgumentExceptionCopyright © 2009–2021. All rights reserved.