gr.uoa.di.madgik.commons.infra.nodeselection.random
Class RandomNodeSelector

java.lang.Object
  extended by gr.uoa.di.madgik.commons.infra.nodeselection.random.RandomNodeSelector
All Implemented Interfaces:
NodeSelector

public class RandomNodeSelector
extends java.lang.Object
implements NodeSelector


Constructor Summary
RandomNodeSelector()
           
 
Method Summary
 java.util.List<HostingNodeInfo> assessNodes(java.util.List<HostingNode> candidates)
          Assesses the suitability of the candidate set of nodes without keeping internal memory of node selection.
 void markSelected(HostingNode node)
           
 HostingNode selectNode(java.util.List<HostingNode> candidates)
          Selects the most suitable node and marks the selection internally, if necessary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomNodeSelector

public RandomNodeSelector()
Method Detail

selectNode

public HostingNode selectNode(java.util.List<HostingNode> candidates)
Description copied from interface: NodeSelector
Selects the most suitable node and marks the selection internally, if necessary

Specified by:
selectNode in interface NodeSelector
Parameters:
candidates - The candidate set of nodes
Returns:
The most suitable node

assessNodes

public java.util.List<HostingNodeInfo> assessNodes(java.util.List<HostingNode> candidates)
Description copied from interface: NodeSelector
Assesses the suitability of the candidate set of nodes without keeping internal memory of node selection.

Specified by:
assessNodes in interface NodeSelector
Parameters:
candidates - The candidate set of nodes
Returns:
A sorted list of the candidate set ordered by the most to the least suitable.

markSelected

public void markSelected(HostingNode node)
Specified by:
markSelected in interface NodeSelector