ome.services.blitz.fire
Class Ring

java.lang.Object
  extended by Ice.ObjectImpl
      extended by omero.grid._ClusterNodeDisp
          extended by ome.services.blitz.fire.Ring
All Implemented Interfaces:
Ice.Object, Serializable, Cloneable, Redirector.Context, omero.grid._ClusterNodeOperations, omero.grid._ClusterNodeOperationsNC, omero.grid.ClusterNode

public class Ring
extends omero.grid._ClusterNodeDisp
implements Redirector.Context

Distributed ring of BlitzConfiguration objects which manages lookups of sessions and other resources from all the blitzes which take part in the cluster. Membership in the Ring 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. The Ring also listens for

Since:
Beta4
See Also:
Serialized Form

Field Summary
 Principal principal
           
 String uuid
          UUID for this cluster node.
 
Fields inherited from class omero.grid._ClusterNodeDisp
__ids
 
Constructor Summary
Ring(String uuid, Executor executor)
           
Ring(String uuid, Executor executor, Redirector redirector)
           
 
Method Summary
 void assertNodes(Set<String> nodeUuids)
           
 Set<String> checkCluster()
          Method called during initialization to get all the active uuids within the cluster, and remove any dead nodes.
 boolean checkPassword(String userId)
          Currently only returns false since if the regular password check performed by SessionManager cannot find the session, then the cluster has no extra information.
 void destroy()
           
 void down(String downUuid, Ice.Current __current)
          Called when any node goes down.
 Ice.Communicator getCommunicator()
          Active communicator for use by the Redirector instance.
 String getDirectProxy()
          Returns the proxy information for the local SessionManager.
 Set<String> getManagerList(boolean onlyActive)
          Return all known managers in the current cluster context, possibly filtering out the inactive ones.
 String getNodeUuid(Ice.Current __current)
           
 Glacier2.SessionPrx getProxyOrNull(String userId, Glacier2.SessionControlPrx control, Ice.Current current)
          Delegates to the redirector strategy configured for this instance.
 void init(Ice.ObjectAdapter adapter, String directProxy)
          Typically called from within BlitzConfiguration after the communicator and adapter have been properly setup.
 Set<String> knownManagers()
           
 Principal principal()
          Principal instance which can be used for internal calls the Executor.
protected  void purgeNode(String manager)
           
 void setRegistry(Registry registry)
          Sets the Registry for this instance.
 String uuid()
          The UUID for the local node which will be used as the redirect lookup string for this Redirector.Context.
 
Methods inherited from class omero.grid._ClusterNodeDisp
___down, ___getNodeUuid, __dispatch, __read, __read, __write, __write, 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, __collocDispatch, clone, ice_dispatch, ice_hash, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Ice.Object
__collocDispatch, clone, equals, ice_dispatch, ice_hash, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
 

Field Detail

uuid

public final String uuid
UUID for this cluster node. Used to uniquely identify the session manager in this blitz instance. Most likely used in common with internal server components. Must specify a valid session id.


principal

public final Principal principal
Constructor Detail

Ring

public Ring(String uuid,
            Executor executor)

Ring

public Ring(String uuid,
            Executor executor,
            Redirector redirector)
Method Detail

setRegistry

public void setRegistry(Registry registry)
Sets the Registry for this instance. This is currently done in BlitzConfiguration


uuid

public String uuid()
Description copied from interface: Redirector.Context
The UUID for the local node which will be used as the redirect lookup string for this Redirector.Context.

Specified by:
uuid in interface Redirector.Context

principal

public Principal principal()
Description copied from interface: Redirector.Context
Principal instance which can be used for internal calls the Executor.

Specified by:
principal in interface Redirector.Context

getDirectProxy

public String getDirectProxy()
Returns the proxy information for the local SessionManager.

Specified by:
getDirectProxy in interface Redirector.Context
Returns:

getCommunicator

public Ice.Communicator getCommunicator()
Description copied from interface: Redirector.Context
Active communicator for use by the Redirector instance.

Specified by:
getCommunicator in interface Redirector.Context

init

public void init(Ice.ObjectAdapter adapter,
                 String directProxy)
Typically called from within BlitzConfiguration after the communicator and adapter have been properly setup.


checkCluster

public Set<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 String getNodeUuid(Ice.Current __current)
Specified by:
getNodeUuid in interface omero.grid._ClusterNodeOperations

down

public void down(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 omero.grid._ClusterNodeOperations

checkPassword

public boolean checkPassword(String userId)
Currently only returns false since if the regular password check performed by SessionManager cannot find the session, then the cluster has no extra information.


getProxyOrNull

public Glacier2.SessionPrx getProxyOrNull(String userId,
                                          Glacier2.SessionControlPrx control,
                                          Ice.Current current)
                                   throws Glacier2.CannotCreateSessionException
Delegates to the redirector strategy configured for this instance.

Throws:
Glacier2.CannotCreateSessionException

knownManagers

public Set<String> knownManagers()

assertNodes

public void assertNodes(Set<String> nodeUuids)

purgeNode

protected void purgeNode(String manager)

getManagerList

public Set<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 interface Redirector.Context


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

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