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 | Description |
|---|---|
RoundRobinConnectionPolicy(PeerNode remoteNode) |
Creates a new connection policy working with the given remote node.
|
RoundRobinConnectionPolicy(java.util.List<PeerNode> availableRemoteNodes) |
Creates a new connection policy with the given remote nodes.
|
selectNodeavailableNodeAdded, availableNodeRemoved, availableNodesReset, getBadNodes, getGoodNodes, getMaxRetries, nodeConnectSuccess, nodeFailed, nodeFailReset, selectNode, setMaxRetriespublic RoundRobinConnectionPolicy(PeerNode remoteNode)
remoteNode - the (only) available remote nodepublic RoundRobinConnectionPolicy(java.util.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