edu.internet2.middleware.grouperClient.failover
Class FailoverClient

java.lang.Object
  extended by edu.internet2.middleware.grouperClient.failover.FailoverClient
All Implemented Interfaces:
Serializable

public class FailoverClient
extends Object
implements Serializable

logic for hitting multiple resources checking for errors and timeouts for always availability.

See Also:
Serialized Form

Method Summary
static
<T> T
failoverLogic(String connectionType, boolean useThreads, FailoverLogic<T> failoverLogic)
          run failover logic, return the result from the logic
static
<T> T
failoverLogic(String connectionType, FailoverLogic<T> failoverLogic)
          run failover logic, return the result from the logic
 FailoverConfig getFailoverConfig()
          cache the config as a field
static void initFailoverClient(FailoverConfig failoverConfig)
          get a failover client from memory or disk or make a new one
static void main(String[] args)
          test serialize and unserialize
 void setFailoverConfig(FailoverConfig failoverConfig1)
          cache the config as a field
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFailoverConfig

public FailoverConfig getFailoverConfig()
cache the config as a field

Returns:
config

setFailoverConfig

public void setFailoverConfig(FailoverConfig failoverConfig1)
cache the config as a field

Parameters:
failoverConfig1 -

main

public static void main(String[] args)
test serialize and unserialize

Parameters:
args -

initFailoverClient

public static void initFailoverClient(FailoverConfig failoverConfig)
get a failover client from memory or disk or make a new one

Parameters:
failoverConfig - config with the type we are talking about

failoverLogic

public static <T> T failoverLogic(String connectionType,
                                  FailoverLogic<T> failoverLogic)
run failover logic, return the result from the logic

Type Parameters:
T -
Parameters:
connectionType - is the type of connection
failoverLogic -
Returns:
the result from the logic

failoverLogic

public static <T> T failoverLogic(String connectionType,
                                  boolean useThreads,
                                  FailoverLogic<T> failoverLogic)
run failover logic, return the result from the logic

Type Parameters:
T -
Parameters:
connectionType - is the type of connection
useThreads - is true if we should use threads, maybe pass false e.g. if the system is not initted and it relies on something to get configuration. generally true though
failoverLogic -
Returns:
the result from the logic