ome.services.blitz.redirect
Class AbstractRedirector

java.lang.Object
  extended by ome.services.blitz.redirect.AbstractRedirector
All Implemented Interfaces:
Redirector
Direct Known Subclasses:
ConfigRedirector, ScaleRedirector

public abstract class AbstractRedirector
extends Object
implements Redirector

Base Redirector

Since:
Beta-4.0-RC2

Nested Class Summary
 
Nested classes/interfaces inherited from interface ome.services.blitz.redirect.Redirector
Redirector.Context
 
Field Summary
protected  Executor executor
           
protected  org.apache.commons.logging.Log log
           
protected static String ROUTED_FROM
           
 
Constructor Summary
AbstractRedirector(Executor ex)
           
 
Method Summary
protected  boolean alreadyRouted(Ice.Current current)
           
protected  String findProxy(Redirector.Context ctx, String redirect)
           
 Glacier2.SessionPrx getProxyOrNull(Redirector.Context ctx, String userId, Glacier2.SessionControlPrx control, Ice.Current current)
          Returns null early if the Current has already once been routed by a Redirector implementation, returns an existing session if it can be found, or returns a null.
protected  String getRedirect(Redirector.Context ctx)
          Returns the current redirect, to which all calls to #getProxyOrNull(String, Glacier2.SessionControlPrx, Ice.Current) will be pointed.
protected  boolean initializeRedirect(Redirector.Context ctx, String managerUuid)
          Set the new redirect value if null, or if the uuid is null or empty, then the existing redirect will be removed.
protected  String nodeProxyQuery(Redirector.Context ctx, String uuid, String query)
           
protected  Glacier2.SessionPrx obtainProxy(String proxyString, Redirector.Context ctx, String userId, Glacier2.SessionControlPrx control, Ice.Current current)
           
protected  String proxyForSession(Redirector.Context ctx, String sessionUuid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ome.services.blitz.redirect.Redirector
chooseNextRedirect, handleRingShutdown
 

Field Detail

ROUTED_FROM

protected static final String ROUTED_FROM
See Also:
Constant Field Values

log

protected final org.apache.commons.logging.Log log

executor

protected final Executor executor
Constructor Detail

AbstractRedirector

public AbstractRedirector(Executor ex)
Method Detail

getProxyOrNull

public Glacier2.SessionPrx getProxyOrNull(Redirector.Context ctx,
                                          String userId,
                                          Glacier2.SessionControlPrx control,
                                          Ice.Current current)
                                   throws Glacier2.CannotCreateSessionException
Returns null early if the Current has already once been routed by a Redirector implementation, returns an existing session if it can be found, or returns a null.

Specified by:
getProxyOrNull in interface Redirector
userId - Not null.
Returns:
Possibly null.
Throws:
Glacier2.CannotCreateSessionException
See Also:
ROUTED_FROM

alreadyRouted

protected boolean alreadyRouted(Ice.Current current)

obtainProxy

protected Glacier2.SessionPrx obtainProxy(String proxyString,
                                          Redirector.Context ctx,
                                          String userId,
                                          Glacier2.SessionControlPrx control,
                                          Ice.Current current)
                                   throws Glacier2.CannotCreateSessionException
Throws:
Glacier2.CannotCreateSessionException

getRedirect

protected String getRedirect(Redirector.Context ctx)
Returns the current redirect, to which all calls to #getProxyOrNull(String, Glacier2.SessionControlPrx, Ice.Current) will be pointed. May be null, but is typically set to a non-null value when the first Ring joins the cluster.


initializeRedirect

protected boolean initializeRedirect(Redirector.Context ctx,
                                     String managerUuid)
Set the new redirect value if null, or if the uuid is null or empty, then the existing redirect will be removed. Otherwise the value is set if it is currently missing.


findProxy

protected String findProxy(Redirector.Context ctx,
                           String redirect)

proxyForSession

protected String proxyForSession(Redirector.Context ctx,
                                 String sessionUuid)

nodeProxyQuery

protected String nodeProxyQuery(Redirector.Context ctx,
                                String uuid,
                                String query)


OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.