RoundRobinConnectionPolicy
Date: 2016-02-29

de.zib.scalaris

## Class RoundRobinConnectionPolicy

- java.lang.Object
- - de.zib.scalaris.ConnectionPolicy
  - - de.zib.scalaris.DefaultConnectionPolicy
    - - de.zib.scalaris.RoundRobinConnectionPolicy

-     public class RoundRobinConnectionPolicy
      extends DefaultConnectionPolicy

  Implements a `ConnectionPolicy` by choosing nodes round-robin. This implementation is based on `DefaultConnectionPolicy` and thus also differentiates good and bad nodes.
  Since:
    3.5
  Version:
    3.5
  Author:
    Nico Kruber, kruber@zib.de
  See Also:
    `DefaultConnectionPolicy`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoundRobinConnectionPolicy(List<PeerNode> availableRemoteNodes)` Creates a new connection policy with the given remote nodes.
    `RoundRobinConnectionPolicy(PeerNode remoteNode)` Creates a new connection policy working with the given remote node.

  - ### Method Summary

    - ### Methods inherited from class de.zib.scalaris.DefaultConnectionPolicy

      `availableNodeAdded, availableNodeRemoved, availableNodesReset, getBadNodes, getGoodNodes, getMaxRetries, nodeConnectSuccess, nodeFailed, nodeFailReset, selectNode, setMaxRetries`

    - ### Methods inherited from class de.zib.scalaris.ConnectionPolicy

      `selectNode`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RoundRobinConnectionPolicy

          public RoundRobinConnectionPolicy(PeerNode remoteNode)

      Creates a new connection policy working with the given remote node. Provided for convenience. Attention: This method also synchronises on the node.
      Parameters:
        `remoteNode` - the (only) available remote node

    - #### RoundRobinConnectionPolicy

          public RoundRobinConnectionPolicy(List<PeerNode> availableRemoteNodes)

      Creates a new connection policy with the given remote nodes. Attention: This method synchronises on `availableRemoteNodes`. Any time this list is changed, the according methods in this class should be called, i.e. `DefaultConnectionPolicy.availableNodeAdded(PeerNode)`, `DefaultConnectionPolicy.availableNodeRemoved(PeerNode)`, `DefaultConnectionPolicy.availableNodesReset()` to update the good and bad nodes lists.
      Parameters:
        `availableRemoteNodes` - the remote nodes available for connections