de.root1.simon
Class SimonPublication

java.lang.Object
  extended by de.root1.simon.SimonPublication

public final class SimonPublication
extends java.lang.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

Author:
achristian

Constructor Summary
protected SimonPublication(java.net.InetAddress address, int port, java.lang.String remoteObjectName)
          Creates a new object instance according to the given address, port and remote object name
protected SimonPublication(java.lang.String rawString)
          Creates an object instance according to a raw string with the format:
[SIMON|192.168.0.123:1234|myServer]
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.net.InetAddress getAddress()
          Returns the network address to which the registry is bind
 int getPort()
          Returns the port on which the registry listens for connections
 java.lang.String getRemoteObjectName()
          Returns the name of the remote object which is bind to the registry
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimonPublication

protected SimonPublication(java.net.InetAddress address,
                           int port,
                           java.lang.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(java.lang.String rawString)
                    throws java.lang.IllegalArgumentException,
                           java.net.UnknownHostException,
                           java.lang.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:
java.lang.IllegalArgumentException - if raw string has the wrong format
java.net.UnknownHostException - if the host in the raw string is unknown
java.lang.NumberFormatException - if the port in the raw string has the wrong format (e.g. non numeric)
Method Detail

getRemoteObjectName

public java.lang.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 java.net.InetAddress getAddress()
Returns the network address to which the registry is bind

Returns:
an address of the registry

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2011. All Rights Reserved.