Package ome.services.blitz.fire
Class Ring
- java.lang.Object
-
- Ice.ObjectImpl
-
- omero.grid._ClusterNodeDisp
-
- ome.services.blitz.fire.Ring
-
- All Implemented Interfaces:
Ice.Object
,java.io.Serializable
,java.lang.Cloneable
,Redirector.Context
,_ClusterNodeOperations
,_ClusterNodeOperationsNC
,ClusterNode
public class Ring extends _ClusterNodeDisp implements Redirector.Context
Distributed ring ofBlitzConfiguration
objects which manages lookups of sessions and other resources from all the blitzes which take part in the cluster. Membership in theRing
is based on a single token -- "omero.instance" -- retrieved from the current context, or if missing, a calculated value which will prevent this instance from taking part in clustering. TheRing
also listens for- Since:
- Beta4
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description ome.system.Principal
principal
java.lang.String
uuid
UUID for this cluster node.-
Fields inherited from class omero.grid._ClusterNodeDisp
__ids, serialVersionUID
-
Fields inherited from interface omero.grid.ClusterNode
ice_staticId
-
-
Constructor Summary
Constructors Constructor Description Ring(java.lang.String uuid, ome.services.util.Executor executor)
Ring(java.lang.String uuid, ome.services.util.Executor executor, Redirector redirector, ome.services.scripts.ScriptRepoHelper scriptRepoHelper, ome.security.NodeProvider nodeProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertNodes(java.util.Set<java.lang.String> nodeUuids)
java.util.Set<java.lang.String>
checkCluster()
Method called during initialization to get all the active uuids within the cluster, and remove any dead nodes.boolean
checkPassword(java.lang.String userId)
Currently only returns false since if the regular password check performed bySessionManager
cannot find the session, then the cluster has no extra information.void
destroy()
void
down(java.lang.String downUuid, Ice.Current __current)
Called when any node goes down.Ice.Communicator
getCommunicator()
Active communicator for use by theRedirector
instance.java.lang.String
getDirectProxy()
Returns the proxy information for the localSessionManager
.java.util.Set<java.lang.String>
getManagerList(boolean onlyActive)
Return all known managers in the current cluster context, possibly filtering out the inactive ones.java.lang.String
getNodeUuid(Ice.Current __current)
Each node acquires the uuids of all other active nodes on start up.Glacier2.SessionPrx
getProxyOrNull(java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current)
Delegates to theredirector
strategy configured for this instance.void
init(Ice.ObjectAdapter adapter, java.lang.String directProxy)
Typically called from withinBlitzConfiguration
after the communicator and adapter have been properly setup.java.util.Set<java.lang.String>
knownManagers()
ome.system.Principal
principal()
Principal
instance which can be used for internal calls the Executor.protected void
purgeNode(java.lang.String manager)
void
setRegistry(Registry registry)
Sets theRegistry
for this instance.java.lang.String
uuid()
The UUID for the local node which will be used as the redirect lookup string for thisRedirector.Context
.-
Methods inherited from class omero.grid._ClusterNodeDisp
___down, ___getNodeUuid, __dispatch, __readImpl, __writeImpl, down, getNodeUuid, ice_copyStateFrom, ice_id, ice_id, ice_ids, ice_ids, ice_isA, ice_isA, ice_staticId
-
Methods inherited from class Ice.ObjectImpl
___ice_id, ___ice_ids, ___ice_isA, ___ice_ping, __checkMode, __read, __read, __readImpl, __write, __write, __writeImpl, clone, ice_dispatch, ice_dispatch, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
-
-
-
-
Constructor Detail
-
Ring
public Ring(java.lang.String uuid, ome.services.util.Executor executor)
-
Ring
public Ring(java.lang.String uuid, ome.services.util.Executor executor, Redirector redirector, ome.services.scripts.ScriptRepoHelper scriptRepoHelper, ome.security.NodeProvider nodeProvider)
-
-
Method Detail
-
setRegistry
public void setRegistry(Registry registry)
Sets theRegistry
for this instance. This is currently done inBlitzConfiguration
-
uuid
public java.lang.String uuid()
Description copied from interface:Redirector.Context
The UUID for the local node which will be used as the redirect lookup string for thisRedirector.Context
.- Specified by:
uuid
in interfaceRedirector.Context
-
principal
public ome.system.Principal principal()
Description copied from interface:Redirector.Context
Principal
instance which can be used for internal calls the Executor.- Specified by:
principal
in interfaceRedirector.Context
-
getManagerList
public java.util.Set<java.lang.String> getManagerList(boolean onlyActive)
Description copied from interface:Redirector.Context
Return all known managers in the current cluster context, possibly filtering out the inactive ones.- Specified by:
getManagerList
in interfaceRedirector.Context
-
getDirectProxy
public java.lang.String getDirectProxy()
Returns the proxy information for the localSessionManager
.- Specified by:
getDirectProxy
in interfaceRedirector.Context
- Returns:
- See above.
-
getCommunicator
public Ice.Communicator getCommunicator()
Description copied from interface:Redirector.Context
Active communicator for use by theRedirector
instance.- Specified by:
getCommunicator
in interfaceRedirector.Context
-
init
public void init(Ice.ObjectAdapter adapter, java.lang.String directProxy)
Typically called from withinBlitzConfiguration
after the communicator and adapter have been properly setup.
-
checkCluster
public java.util.Set<java.lang.String> checkCluster()
Method called during initialization to get all the active uuids within the cluster, and remove any dead nodes. May return null if lookup fails.
-
destroy
public void destroy()
-
getNodeUuid
public java.lang.String getNodeUuid(Ice.Current __current)
Description copied from interface:_ClusterNodeOperations
Each node acquires the uuids of all other active nodes on start up. The uuid is an internal value and does not correspond to a session.- Specified by:
getNodeUuid
in interface_ClusterNodeOperations
- Parameters:
__current
- The Current object for the invocation.
-
down
public void down(java.lang.String downUuid, Ice.Current __current)
Called when any node goes down. First we try to remove any redirect for that instance. Then we try to install ourselves.- Specified by:
down
in interface_ClusterNodeOperations
__current
- The Current object for the invocation.
-
checkPassword
public boolean checkPassword(java.lang.String userId)
Currently only returns false since if the regular password check performed bySessionManager
cannot find the session, then the cluster has no extra information.
-
getProxyOrNull
public Glacier2.SessionPrx getProxyOrNull(java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current) throws Glacier2.CannotCreateSessionException
Delegates to theredirector
strategy configured for this instance.- Throws:
Glacier2.CannotCreateSessionException
-
knownManagers
public java.util.Set<java.lang.String> knownManagers()
-
assertNodes
public void assertNodes(java.util.Set<java.lang.String> nodeUuids)
-
purgeNode
protected void purgeNode(java.lang.String manager)
-
-