gov.sns.xal.model.sync
Class SynchronizationManager

java.lang.Object
  |
  +--gov.sns.xal.model.sync.SynchronizationManager

public class SynchronizationManager
extends java.lang.Object

Manages synchronization mappings between accelerator node proxies and lattice elements.


Field Summary
static java.lang.String DEFAULT_SYNC_MODE
           
 
Constructor Summary
SynchronizationManager()
           
 
Method Summary
 java.util.List allElementsMappedTo(AcceleratorNode aNode)
           
 boolean checkSynchronization(AcceleratorNode aNode, java.util.Map values)
           
protected  void debugPrint()
           
 ModelInput getModelInput(AcceleratorNode aNode, java.lang.String propName)
          Returns the ModelInput for the specified node's property.
 java.util.Map propertiesForNode(AcceleratorNode aNode)
           
 void removeModelInput(AcceleratorNode aNode, java.lang.String property)
           
 void resync()
           
static void resync(IElement anElem, java.util.Map valueMap)
          Synchronizes anElem to the property values contained in valueMap.
 ModelInput setModelInput(AcceleratorNode aNode, java.lang.String property, double value)
          Sets the specified node's property to the specified value.
 void setSynchronizationMode(java.lang.String newMode)
           
 void synchronize(IElement anElem, AcceleratorNode aNode)
          Creates a synchronization between the specified element and accelerator node.
protected  java.util.List synchronizedElementsMappedTo(AcceleratorNode aNode)
           
static java.util.List syncModes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SYNC_MODE

public static final java.lang.String DEFAULT_SYNC_MODE
See Also:
Constant Field Values
Constructor Detail

SynchronizationManager

public SynchronizationManager()
Method Detail

syncModes

public static java.util.List syncModes()

setSynchronizationMode

public void setSynchronizationMode(java.lang.String newMode)

resync

public void resync()
            throws SynchronizationException
SynchronizationException

resync

public static void resync(IElement anElem,
                          java.util.Map valueMap)
                   throws SynchronizationException
Synchronizes anElem to the property values contained in valueMap.

Parameters:
anElem - element to synchronize
valueMap - a Map whose keys are property names and values are String property values
SynchronizationException

synchronize

public void synchronize(IElement anElem,
                        AcceleratorNode aNode)
Creates a synchronization between the specified element and accelerator node. Request is ignored if there is no synchronizer for the specified element type. Request is also ignored if there is no accessor for the specified node type, because the system doesn't know how to access data from that type of node.

Parameters:
anElem - the lattice element to create synchronization for
aNode - the accelerator node to synchronize the element with

propertiesForNode

public java.util.Map propertiesForNode(AcceleratorNode aNode)
                                throws ProxyException
ProxyException

allElementsMappedTo

public java.util.List allElementsMappedTo(AcceleratorNode aNode)

synchronizedElementsMappedTo

protected java.util.List synchronizedElementsMappedTo(AcceleratorNode aNode)

setModelInput

public ModelInput setModelInput(AcceleratorNode aNode,
                                java.lang.String property,
                                double value)
Sets the specified node's property to the specified value. Replaces the existing value if there is one.

Parameters:
aNode - node whose property to set
property - name of property to set
value - double value for property

getModelInput

public ModelInput getModelInput(AcceleratorNode aNode,
                                java.lang.String propName)
Returns the ModelInput for the specified node's property.

Parameters:
aNode - node whose property to get a ModelInput for
propName - name of property to get a ModelInput for

removeModelInput

public void removeModelInput(AcceleratorNode aNode,
                             java.lang.String property)

debugPrint

protected void debugPrint()

checkSynchronization

public boolean checkSynchronization(AcceleratorNode aNode,
                                    java.util.Map values)
                             throws SynchronizationException
SynchronizationException