Interface MenuCommandProtocol

All Known Implementing Classes:
TagValMenuCommandProtocol

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.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves a message from the channel, or throws an exception if the message is not fully formed.
    byte
    returns the identifier for this protocol, when used in messages
    void
    toChannel​(ByteBuffer buffer, MenuCommand cmd)
    Puts the command specified into the byte buffer, it is assumed that the callee will flip the channel once complete.
  • Method Details

    • fromChannel

      MenuCommand fromChannel(ByteBuffer buffer) throws IOException
      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
    • toChannel

      void toChannel(ByteBuffer buffer, MenuCommand cmd)
      Puts the command specified into the byte buffer, it is assumed that the callee will flip the channel once complete.
      Parameters:
      buffer - to write the data to
      cmd - the command to write
    • getKeyIdentifier

      byte getKeyIdentifier()
      returns the identifier for this protocol, when used in messages
      Returns:
      the ID for this protocol