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 Details

  • 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) throws TcProtocolException
      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
      Throws:
      TcProtocolException
    • getProtocolForCmd

      CommandProtocol getProtocolForCmd(MenuCommand command)
      Checks the message and sees which protocol it will be processed with. For example the JOIN message would be processed using TagVal.
      Parameters:
      command - the command to check the protocol of
      Returns:
      the protocol that will be used.