gr.uoa.di.madgik.commons.infra.nodeselection.cost
Class BestNodeSelector

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

public class BestNodeSelector
extends Object
implements NodeSelector


Constructor Summary
BestNodeSelector()
           
BestNodeSelector(NodeSelector tieBreaker)
           
 
Method Summary
 List<HostingNodeInfo> assessNodes(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(List<HostingNode> candidates)
          Selects the most suitable node and marks the selection internally, if necessary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BestNodeSelector

public BestNodeSelector()
                 throws Exception
Throws:
Exception

BestNodeSelector

public BestNodeSelector(NodeSelector tieBreaker)
                 throws Exception
Throws:
Exception
Method Detail

selectNode

public HostingNode selectNode(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 List<HostingNodeInfo> assessNodes(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


Copyright © 2012. All Rights Reserved.