Interface MessageReceiver

All Known Implementing Classes:
AgentImpl, AnonymousAgentImpl, BotAgent, EthereumAgent, EthereumGroupAgent, GroupAgentImpl, Mediator, MonitoringAgent, PassphraseAgentImpl, ServiceAgentImpl, TestAgent, UserAgentImpl

public interface MessageReceiver
An interface for receiving messages in the p2p network. Used by AgentImpls and Mediators.
  • Method Details

    • receiveMessage

      void receiveMessage(Message message, AgentContext c) throws MessageException
      Receives a message. Will be called by a Node implementation on reception of messages that this receiver is responsible for.
      Parameters:
      message -
      c -
      Throws:
      MessageException
    • getResponsibleForAgentSafeId

      String getResponsibleForAgentSafeId()
      In case a Mediator implements this interface, this method will return the id of the agent, this mediator is responsible for. Otherwise it will just return the AgentImpls id.
      Returns:
      id of the agent, this receiver is responsible for
    • notifyRegistrationTo

      void notifyRegistrationTo(Node node) throws AgentException
      Called by a Node on registering a MessageReceiver to the network.
      Parameters:
      node - the node this receiver has been registered to
      Throws:
      AgentException
    • notifyUnregister

      void notifyUnregister()
      Called by a Node on unregistering a MessageReceiver from the network.