public abstract class AbstractStrategy extends Object implements DistributionStrategy
| Constructor and Description |
|---|
AbstractStrategy(Maestro maestro) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract PeerEndpoint |
assign(String id,
PeerInfo peerInfo)
Assign a role to the node identified by the id and peer information
|
PeerSet |
distribute(PeerSet peers)
Given a set of peers distribute them
|
Set<PeerEndpoint> |
endpoints()
Get the endpoint for lastly distributed peer set.
|
protected Maestro |
getMaestro() |
void |
reset()
Reset the distribution of peers
|
public AbstractStrategy(Maestro maestro)
protected abstract PeerEndpoint assign(String id, PeerInfo peerInfo)
id - peer IDpeerInfo - peer informationpublic PeerSet distribute(PeerSet peers)
DistributionStrategydistribute in interface DistributionStrategypeers - the set of peers to distributeMaestro.getPeers()public void reset()
DistributionStrategyreset in interface DistributionStrategypublic Set<PeerEndpoint> endpoints()
DistributionStrategyendpoints in interface DistributionStrategyprotected Maestro getMaestro()
This documentation was released into the public domain.