public class JsonHttpCommandCodec extends java.lang.Object implements CommandCodec<HttpRequest>
Constructor and Description |
---|
JsonHttpCommandCodec() |
Modifier and Type | Method and Description |
---|---|
Command |
decode(HttpRequest encodedCommand)
Decodes a command.
|
void |
defineCommand(java.lang.String name,
HttpMethod method,
java.lang.String pathPattern)
Defines a new command mapping.
|
HttpRequest |
encode(Command command)
Encodes a command.
|
public HttpRequest encode(Command command)
CommandCodec
encode
in interface CommandCodec<HttpRequest>
command
- the command to encode.public Command decode(HttpRequest encodedCommand)
CommandCodec
decode
in interface CommandCodec<HttpRequest>
encodedCommand
- the command to decode.public void defineCommand(java.lang.String name, HttpMethod method, java.lang.String pathPattern)
name
- The command name.method
- The HTTP method to use for the command.pathPattern
- The URI path pattern for the command. When encoding a command, each
path segment prefixed with a ":" will be replaced with the corresponding parameter
from the encoded command.