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 ofBlitzConfigurationobjects which manages lookups of sessions and other resources from all the blitzes which take part in the cluster. Membership in theRingis 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. TheRingalso listens for- Since:
- Beta4
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description ome.system.Principalprincipaljava.lang.StringuuidUUID 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 voidassertNodes(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.booleancheckPassword(java.lang.String userId)Currently only returns false since if the regular password check performed bySessionManagercannot find the session, then the cluster has no extra information.voiddestroy()voiddown(java.lang.String downUuid, Ice.Current __current)Called when any node goes down.Ice.CommunicatorgetCommunicator()Active communicator for use by theRedirectorinstance.java.lang.StringgetDirectProxy()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.StringgetNodeUuid(Ice.Current __current)Each node acquires the uuids of all other active nodes on start up.Glacier2.SessionPrxgetProxyOrNull(java.lang.String userId, Glacier2.SessionControlPrx control, Ice.Current current)Delegates to theredirectorstrategy configured for this instance.voidinit(Ice.ObjectAdapter adapter, java.lang.String directProxy)Typically called from withinBlitzConfigurationafter the communicator and adapter have been properly setup.java.util.Set<java.lang.String>knownManagers()ome.system.Principalprincipal()Principalinstance which can be used for internal calls the Executor.protected voidpurgeNode(java.lang.String manager)voidsetRegistry(Registry registry)Sets theRegistryfor this instance.java.lang.Stringuuid()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 theRegistryfor this instance. This is currently done inBlitzConfiguration
-
uuid
public java.lang.String uuid()
Description copied from interface:Redirector.ContextThe UUID for the local node which will be used as the redirect lookup string for thisRedirector.Context.- Specified by:
uuidin interfaceRedirector.Context
-
principal
public ome.system.Principal principal()
Description copied from interface:Redirector.ContextPrincipalinstance which can be used for internal calls the Executor.- Specified by:
principalin interfaceRedirector.Context
-
getManagerList
public java.util.Set<java.lang.String> getManagerList(boolean onlyActive)
Description copied from interface:Redirector.ContextReturn all known managers in the current cluster context, possibly filtering out the inactive ones.- Specified by:
getManagerListin interfaceRedirector.Context
-
getDirectProxy
public java.lang.String getDirectProxy()
Returns the proxy information for the localSessionManager.- Specified by:
getDirectProxyin interfaceRedirector.Context- Returns:
- See above.
-
getCommunicator
public Ice.Communicator getCommunicator()
Description copied from interface:Redirector.ContextActive communicator for use by theRedirectorinstance.- Specified by:
getCommunicatorin interfaceRedirector.Context
-
init
public void init(Ice.ObjectAdapter adapter, java.lang.String directProxy)Typically called from withinBlitzConfigurationafter 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:_ClusterNodeOperationsEach 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:
getNodeUuidin 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:
downin 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 bySessionManagercannot 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.CannotCreateSessionExceptionDelegates to theredirectorstrategy 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)
-
-