Interface ProtocolHandler


public interface ProtocolHandler
A handler for processing protocol messages.
  • Method Details

    • handle

      ProtocolMessage handle(ProtocolMessage msg, Set<String> nodeIdentities) throws ProtocolException
      Handles the given protocol message or throws an exception if it cannot handle the message. If no response is needed by the protocol, then null should be returned.
      Parameters:
      msg - a message
      nodeIdentities - the set of identities for this node
      Returns:
      a response or null, if no response is necessary
      Throws:
      ProtocolException - if the message could not be processed
    • canHandle

      boolean canHandle(ProtocolMessage msg)
      Parameters:
      msg - a message
      Returns:
      true if the handler can process the given message; false otherwise