Class SimonPublication

java.lang.Object
host.anzo.simon.SimonPublication

public final class SimonPublication extends Object
This class holds a 3-tupel of data needed to identify a remote object on a registry. The tupel consists of:
  1. address to which the registry of the remote object is bind to
  2. the port on which the registry listens
  3. the remote object name bind to the registry
  • Constructor Details

    • SimonPublication

      protected SimonPublication(InetAddress address, int port, String remoteObjectName)
      Creates a new object instance according to the given address, port and remote object name
      Parameters:
      address - the address of a SIMON registry
      port - the port on which the registry listens
      remoteObjectName - the bind remote object name
    • SimonPublication

      protected SimonPublication(String rawString) throws IllegalArgumentException, UnknownHostException, NumberFormatException
      Creates an object instance according to a raw string with the format:
      [SIMON|192.168.0.123:1234|myServer]
      Parameters:
      rawString - the string that delivers the needed data to create an instance of SimonPublication
      Throws:
      IllegalArgumentException - if raw string has the wrong format
      UnknownHostException - if the host in the raw string is unknown
      NumberFormatException - if the port in the raw string has the wrong format (e.g. non numeric)
  • Method Details

    • getRemoteObjectName

      public String getRemoteObjectName()
      Returns the name of the remote object which is bind to the registry
      Returns:
      name of the remote object
    • getPort

      public int getPort()
      Returns the port on which the registry listens for connections
      Returns:
      port on which the registry listens
    • getAddress

      public InetAddress getAddress()
      Returns the network address to which the registry is bind
      Returns:
      an address of the registry
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object