org.jppf.comm.discovery
Class JPPFConnectionInformation

java.lang.Object
  extended by org.jppf.comm.discovery.JPPFConnectionInformation
All Implemented Interfaces:
Serializable, Cloneable, Comparable<JPPFConnectionInformation>

public class JPPFConnectionInformation
extends Object
implements Serializable, Comparable<JPPFConnectionInformation>, Cloneable

This class encapsulates the connection information for a JPPF driver. The information includes the host, class server, application and node server ports.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
 int[] applicationServerPorts
          The ports on which the application server is listening.
 int[] classServerPorts
          The ports on which the class server is listening.
 String host
          The host name.
 String managementHost
          Host address used for JMX management and monitoring.
 int managementPort
          Port number used for JMX management and monitoring.
 int[] nodeServerPorts
          The ports on which the node server is listening.
 int recoveryPort
          Port number for recovery from hardware failures.
 int subnetMaskLength
          The length of the subnet mask for the host address.
 String uuid
          Identifier for this object.
 
Constructor Summary
JPPFConnectionInformation()
          Default constructor.
 
Method Summary
 Object clone()
          
 int compareTo(JPPFConnectionInformation ci)
          Compare this connection information with another.
 boolean equals(Object obj)
          Determine whether this object is equal to another.
static JPPFConnectionInformation fromBytes(byte[] bytes)
          Deserialize a DriverConnectionInformation object from an array of bytes.
 int hashCode()
          Compute the hashcode of this object.
static byte[] toBytes(JPPFConnectionInformation info)
          Serialize a DriverConnectionInformation object to an array of bytes.
 String toString()
          Get a string representation of this connection information object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

host

public String host
The host name.


classServerPorts

public int[] classServerPorts
The ports on which the class server is listening.


nodeServerPorts

public int[] nodeServerPorts
The ports on which the node server is listening.


applicationServerPorts

public int[] applicationServerPorts
The ports on which the application server is listening.


managementPort

public int managementPort
Port number used for JMX management and monitoring.


recoveryPort

public int recoveryPort
Port number for recovery from hardware failures.


managementHost

public transient String managementHost
Host address used for JMX management and monitoring.


uuid

public String uuid
Identifier for this object.


subnetMaskLength

public int subnetMaskLength
The length of the subnet mask for the host address.

Constructor Detail

JPPFConnectionInformation

public JPPFConnectionInformation()
Default constructor.

Method Detail

compareTo

public int compareTo(JPPFConnectionInformation ci)
Compare this connection information with another.

Specified by:
compareTo in interface Comparable<JPPFConnectionInformation>
Parameters:
ci - the other object to compare to.
Returns:
-1 if this connection information is less than the other, 1 if it is greater, 0 if they are equal.
See Also:
Comparable.compareTo(java.lang.Object)

hashCode

public int hashCode()
Compute the hashcode of this object.

Overrides:
hashCode in class Object
Returns:
the hashcode as an int.
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Determine whether this object is equal to another.

Overrides:
equals in class Object
Parameters:
obj - the object to compare to.
Returns:
true if the 2 objects are equal, false otherwise.
See Also:
Object.equals(java.lang.Object)

clone

public Object clone()
             throws CloneNotSupportedException

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

toString

public String toString()
Get a string representation of this connection information object.

Overrides:
toString in class Object
Returns:
a string describing this object.
See Also:
Object.toString()

fromBytes

public static JPPFConnectionInformation fromBytes(byte[] bytes)
                                           throws Exception
Deserialize a DriverConnectionInformation object from an array of bytes.

Parameters:
bytes - the array of bytes to deserialize from.
Returns:
a DriverConnectionInformation instance.
Throws:
Exception - if an error is raised while deserializing.

toBytes

public static byte[] toBytes(JPPFConnectionInformation info)
                      throws Exception
Serialize a DriverConnectionInformation object to an array of bytes.

Parameters:
info - the DriverConnectionInformation object to serialize to.
Returns:
an array of bytes.
Throws:
Exception - if an error is raised while serializing.


Copyright © 2005-2010 JPPF Team.