Package com.thecoderscorner.menu.remote
Interface MenuCommandProtocol
- All Known Implementing Classes:
ConfigurableProtocolConverter
public interface MenuCommandProtocol
This is a low level part of the API that most people don't need to deal, implementations will translate
commands to and from a given protocol. If you want to add custom messages then see the configurable protocol
converter
ConfigurableProtocolConverter implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionfromChannel(ByteBuffer buffer) Retrieves a message from the channel, or throws an exception if the message is not fully formed.getProtocolForCmd(MenuCommand command) Checks the message and sees which protocol it will be processed with.voidtoChannel(ByteBuffer buffer, MenuCommand cmd) Puts the command specified into the byte buffer, it is assumed that the callee will flip the channel once complete.
-
Field Details
-
PROTO_START_OF_MSG
static final byte PROTO_START_OF_MSG- See Also:
-
PROTO_END_OF_MSG
static final byte PROTO_END_OF_MSG- See Also:
-
-
Method Details
-
fromChannel
Retrieves a message from the channel, or throws an exception if the message is not fully formed. It is assumed that the buffer has been suitably flipped ready for reading- Throws:
IOException
-