de.zib.scalaris
Class PeerNode

java.lang.Object
  extended by de.zib.scalaris.PeerNode

public class PeerNode
extends Object

Wrapper class to the OtpPeer class, adding some additional information.

Author:
Nico Kruber, kruber@zib.de

Constructor Summary
PeerNode(OtpPeer node)
          Creates a new object using the given node.
PeerNode(String node)
          Creates a new object using the given node.
 
Method Summary
 int getFailureCount()
          Gets the number of failed connections.
 Date getLastConnectSuccess()
          Gets the date of the last successful connection.
 Date getLastFailedConnect()
          Gets the date of the last failed connection.
 OtpPeer getNode()
          Gets the OTP node that is being wrapped.
 String toString()
          Returns a string representation of this node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeerNode

public PeerNode(OtpPeer node)
Creates a new object using the given node.

Parameters:
node - the node to wrap

PeerNode

public PeerNode(String node)
Creates a new object using the given node. Provided for convenience.

Parameters:
node - the name of the node to wrap
Method Detail

getNode

public OtpPeer getNode()
Gets the OTP node that is being wrapped.

Returns:
the node

getLastFailedConnect

public Date getLastFailedConnect()
Gets the date of the last failed connection.

Returns:
the date of the last connection failure (or null)

getFailureCount

public int getFailureCount()
Gets the number of failed connections. This is faster than getting a list of failed connections and calling List.size() since this does not require a conversion.

Returns:
the number of failed connections (dates and times)

getLastConnectSuccess

public Date getLastConnectSuccess()
Gets the date of the last successful connection.

Returns:
the last connection success

toString

public String toString()
Returns a string representation of this node.

Overrides:
toString in class Object
Returns:
the name of the node