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.Executor
executor
protected org.slf4j.Logger
log
protected static java.lang.String
ROUTED_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 boolean
alreadyRouted(Ice.Current current)
protected java.lang.String
findProxy(Redirector.Context ctx, java.lang.String redirect)
Glacier2.SessionPrx
getProxyOrNull(Redirector.Context ctx, java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current)
Returns null early if theCurrent
has already once been routed by aRedirector
implementation, returns an existing session if it can be found, or returns a null.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.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.protected java.lang.String
nodeProxyQuery(Redirector.Context ctx, java.lang.String uuid, java.lang.String query)
protected Glacier2.SessionPrx
obtainProxy(java.lang.String proxyString, Redirector.Context ctx, java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current)
protected java.lang.String
proxyForSession(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 theCurrent
has already once been routed by aRedirector
implementation, returns an existing session if it can be found, or returns a null.- Specified by:
getProxyOrNull
in interfaceRedirector
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(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 firstRing
joins 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)
-
-