Package ome.services.blitz.redirect
Class AbstractRedirector
- java.lang.Object
-
- ome.services.blitz.redirect.AbstractRedirector
-
- All Implemented Interfaces:
Redirector
- Direct Known Subclasses:
ConfigRedirector,ScaleRedirector
public abstract class AbstractRedirector extends java.lang.Object implements Redirector
BaseRedirector- Since:
- Beta-4.0-RC2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ome.services.blitz.redirect.Redirector
Redirector.Context
-
-
Field Summary
Fields Modifier and Type Field Description protected ome.services.util.Executorexecutorprotected org.slf4j.Loggerlogprotected static java.lang.StringROUTED_FROM
-
Constructor Summary
Constructors Constructor Description AbstractRedirector(ome.services.util.Executor ex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanalreadyRouted(Ice.Current current)protected java.lang.StringfindProxy(Redirector.Context ctx, java.lang.String redirect)Glacier2.SessionPrxgetProxyOrNull(Redirector.Context ctx, java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current)Returns null early if theCurrenthas already once been routed by aRedirectorimplementation, returns an existing session if it can be found, or returns a null.protected java.lang.StringgetRedirect(Redirector.Context ctx)Returns the current redirect, to which all calls togetProxyOrNull(Context, String, Glacier2.SessionControlPrx, Ice.Current)will be pointed.protected booleaninitializeRedirect(Redirector.Context ctx, java.lang.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 java.lang.StringnodeProxyQuery(Redirector.Context ctx, java.lang.String uuid, java.lang.String query)protected Glacier2.SessionPrxobtainProxy(java.lang.String proxyString, Redirector.Context ctx, java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current)protected java.lang.StringproxyForSession(Redirector.Context ctx, java.lang.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 java.lang.String ROUTED_FROM
- See Also:
- Constant Field Values
-
log
protected final org.slf4j.Logger log
-
executor
protected final ome.services.util.Executor executor
-
-
Method Detail
-
getProxyOrNull
public Glacier2.SessionPrx getProxyOrNull(Redirector.Context ctx, java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current) throws Glacier2.CannotCreateSessionException
Returns null early if theCurrenthas already once been routed by aRedirectorimplementation, returns an existing session if it can be found, or returns a null.- Specified by:
getProxyOrNullin interfaceRedirectoruserId- Not null.- Returns:
- Possibly null.
- Throws:
Glacier2.CannotCreateSessionException- See Also:
ROUTED_FROM
-
alreadyRouted
protected boolean alreadyRouted(Ice.Current current)
-
obtainProxy
protected Glacier2.SessionPrx obtainProxy(java.lang.String proxyString, Redirector.Context ctx, java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current) throws Glacier2.CannotCreateSessionException- Throws:
Glacier2.CannotCreateSessionException
-
getRedirect
protected java.lang.String getRedirect(Redirector.Context ctx)
Returns the current redirect, to which all calls togetProxyOrNull(Context, String, Glacier2.SessionControlPrx, Ice.Current)will be pointed. May be null, but is typically set to a non-null value when the firstRingjoins the cluster.
-
initializeRedirect
protected boolean initializeRedirect(Redirector.Context ctx, java.lang.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 java.lang.String findProxy(Redirector.Context ctx, java.lang.String redirect)
-
proxyForSession
protected java.lang.String proxyForSession(Redirector.Context ctx, java.lang.String sessionUuid)
-
nodeProxyQuery
protected java.lang.String nodeProxyQuery(Redirector.Context ctx, java.lang.String uuid, java.lang.String query)
-
-