uk.ac.soton.itinnovation.grid.client.engine.impl
Class DefaultFederationSelector

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.client.engine.impl.DefaultFederationSelector
All Implemented Interfaces:
FederationSelector<DefaultInvocationEngine>

public class DefaultFederationSelector
extends Object
implements FederationSelector<DefaultInvocationEngine>

DefaultFederationSelector.java


Constructor Summary
DefaultFederationSelector()
           
 
Method Summary
protected  org.apache.axis.message.addressing.EndpointReferenceType findInSelectedRegistries(org.apache.axis.message.addressing.EndpointReferenceType searchEPR, DefaultInvocationEngine engine)
          Search through the engine's selected registries list until a usable federation resource (e.g.
 Set<String> getBadStates()
          Get the set of resource states that will be filtered out and not chosen by the selector.
 Set<String> getBadTypes()
          Get the set of resource types that will be filtered out and not chosen by the selector.
 SOAPHeaderElement[] getFederationHeaders(org.apache.axis.message.addressing.EndpointReferenceType target, RemoteMethod method, DefaultInvocationEngine engine)
          Get any extra headers needed to invoke a service.
 List<String> getGoodStates()
          Get the list of resource states that are prefered by the selector.
 FederationSelector getLegacyFederationSelector()
           
 void setBadStates(Set<String> badStates)
          Set the set of resource states that will be filtered out and not chosen by the selector.
 void setBadTypes(Set<String> badTypes)
          Set the set of resource types that will be filtered out and not chosen by the selector.
 void setGoodStates(List<String> goodStates)
          Set the list of resource states that are prefered by the selector.
 void setLegacyFederationSelector(FederationSelector legacyFederationSelector)
          If the selector fails to find a suitable federation context in the selected registies then it can use a GRIA 5.2 federation selector (remote registry or private account service).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFederationSelector

public DefaultFederationSelector()
Method Detail

getGoodStates

public List<String> getGoodStates()
Get the list of resource states that are prefered by the selector.


setGoodStates

public void setGoodStates(List<String> goodStates)
Set the list of resource states that are prefered by the selector. The order of preference is determined by the order of the list with the first state on the list being the most prefered.


getBadStates

public Set<String> getBadStates()
Get the set of resource states that will be filtered out and not chosen by the selector.


setBadStates

public void setBadStates(Set<String> badStates)
Set the set of resource states that will be filtered out and not chosen by the selector.


getBadTypes

public Set<String> getBadTypes()
Get the set of resource types that will be filtered out and not chosen by the selector.


setBadTypes

public void setBadTypes(Set<String> badTypes)
Set the set of resource types that will be filtered out and not chosen by the selector.


setLegacyFederationSelector

public void setLegacyFederationSelector(FederationSelector legacyFederationSelector)
If the selector fails to find a suitable federation context in the selected registies then it can use a GRIA 5.2 federation selector (remote registry or private account service).


getLegacyFederationSelector

public FederationSelector getLegacyFederationSelector()

getFederationHeaders

public SOAPHeaderElement[] getFederationHeaders(org.apache.axis.message.addressing.EndpointReferenceType target,
                                                RemoteMethod method,
                                                DefaultInvocationEngine engine)
                                         throws RemoteException
Description copied from interface: FederationSelector
Get any extra headers needed to invoke a service.

Specified by:
getFederationHeaders in interface FederationSelector<DefaultInvocationEngine>
Parameters:
target - the resource being invoked
method - the method on the resource
engine - the engine invoking the SOAP operation
Returns:
an array of extra SOAP headers to include in the message
Throws:
RemoteException

findInSelectedRegistries

protected org.apache.axis.message.addressing.EndpointReferenceType findInSelectedRegistries(org.apache.axis.message.addressing.EndpointReferenceType searchEPR,
                                                                                            DefaultInvocationEngine engine)
                                                                                     throws RemoteException
Search through the engine's selected registries list until a usable federation resource (e.g. SLA or account) is found at the given address. For each registry the code queries for everything at the address we are looking for. It then removes any resource that has a state in the badStates set or a type in the badTypes set. For the remaining resources it filters out just the ones with the first state on the goodStates list. If there are none then it tries the second good state etc until it finds some resources with a 'good' state. If none are found in a 'good' state then it continues with the results of the bad state/type filter. For the remaining resources, it checks to see if there are any marked as 'default' using the uk.ac.soton.itinnovation.grid.types.FederationSelector.DEFAULT_FEDERATION_SELECTOR meta data and returns the first one so marked. Otherwise it returns the first one.

Throws:
RemoteException


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.