public class RoundRobinConnectionPolicy extends DefaultConnectionPolicy
ConnectionPolicy
by choosing nodes round-robin.
This implementation is based on DefaultConnectionPolicy
and thus
also differentiates good and bad nodes.DefaultConnectionPolicy
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.
|
availableNodeAdded, availableNodeRemoved, availableNodesReset, getBadNodes, getGoodNodes, getMaxRetries, nodeConnectSuccess, nodeFailed, nodeFailReset, selectNode, setMaxRetries
selectNode
public RoundRobinConnectionPolicy(PeerNode remoteNode)
remoteNode
- the (only) available remote nodepublic RoundRobinConnectionPolicy(List<PeerNode> availableRemoteNodes)
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.availableRemoteNodes
- the remote nodes available for connections