PeerNode
Date: 2016-02-29

de.zib.scalaris

## Class PeerNode

- java.lang.Object
- - 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

    Constructors
    Constructor and Description
    `PeerNode(OtpPeer node)` Creates a new object using the given node.
    `PeerNode(String node)` Creates a new object using the given node.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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