Package jmri.server.json.consist
Class JsonConsistManager
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.server.json.consist.JsonConsistManager
-
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider,ConsistManager
public class JsonConsistManager extends Bean implements ConsistManager
ConsistManager for the JSON services. This consist manager passes requests for CS consisting to the
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.ConsistManager
ConsistManager.EnableListener
-
-
Field Summary
-
Fields inherited from class jmri.beans.Bean
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description JsonConsistManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConsistListListener(ConsistListListener listener)Register a ConsistListListener object with this ConsistManagerbooleancsConsistNeedsSeperateAddress()Does a command station consist require a separate consist address from locomotives in consist?java.lang.StringdecodeErrorCode(int errorCode)Translate Error Codes relieved by a consistListener into StringsvoiddelConsist(LocoAddress address)Remove an old Consist.ConsistgetConsist(LocoAddress address)Find a Consist with this consist address, and return it.java.util.ArrayList<LocoAddress>getConsistList()Get a list of known consist addresses.booleanisCommandStationConsistPossible()Does this implementation support Command Station Consists?booleanisConsistManager()Test if a real ConsistManager is available.voidnotifyConsistListChanged()Notify the registered ConsistListListener objects that the ConsistList has changed.voidremoveConsistListListener(ConsistListListener listener)Remove a ConsistListListener object with this ConsistManagervoidrequestUpdateFromLayout()Request an update from the layout, loading Consists from the command station.-
Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.ConsistManager
canBeDisabled, isEnabled, registerEnableListener, unregisterEnableListener
-
-
-
-
Constructor Detail
-
JsonConsistManager
public JsonConsistManager()
-
-
Method Detail
-
getConsist
public Consist getConsist(LocoAddress address)
Description copied from interface:ConsistManagerFind a Consist with this consist address, and return it. If the Consist doesn't exit, create it.- Specified by:
getConsistin interfaceConsistManager- Parameters:
address- the consist address- Returns:
- an existing or new consist
-
delConsist
public void delConsist(LocoAddress address)
Description copied from interface:ConsistManagerRemove an old Consist.- Specified by:
delConsistin interfaceConsistManager- Parameters:
address- the consist address
-
isCommandStationConsistPossible
public boolean isCommandStationConsistPossible()
Description copied from interface:ConsistManagerDoes this implementation support Command Station Consists?- Specified by:
isCommandStationConsistPossiblein interfaceConsistManager- Returns:
- true if command station consists are supported; false otherwise
-
csConsistNeedsSeperateAddress
public boolean csConsistNeedsSeperateAddress()
Description copied from interface:ConsistManagerDoes a command station consist require a separate consist address from locomotives in consist?- Specified by:
csConsistNeedsSeperateAddressin interfaceConsistManager- Returns:
- true is command station consist requires separate address; false otherwise
-
getConsistList
public java.util.ArrayList<LocoAddress> getConsistList()
Description copied from interface:ConsistManagerGet a list of known consist addresses.- Specified by:
getConsistListin interfaceConsistManager- Returns:
- list of addresses
-
decodeErrorCode
public java.lang.String decodeErrorCode(int errorCode)
Description copied from interface:ConsistManagerTranslate Error Codes relieved by a consistListener into Strings- Specified by:
decodeErrorCodein interfaceConsistManager- Parameters:
errorCode- the code- Returns:
- the description
-
requestUpdateFromLayout
public void requestUpdateFromLayout()
Description copied from interface:ConsistManagerRequest an update from the layout, loading Consists from the command station.- Specified by:
requestUpdateFromLayoutin interfaceConsistManager
-
addConsistListListener
public void addConsistListListener(ConsistListListener listener)
Description copied from interface:ConsistManagerRegister a ConsistListListener object with this ConsistManager- Specified by:
addConsistListListenerin interfaceConsistManager- Parameters:
listener- a Consist List Listener object.
-
removeConsistListListener
public void removeConsistListListener(ConsistListListener listener)
Description copied from interface:ConsistManagerRemove a ConsistListListener object with this ConsistManager- Specified by:
removeConsistListListenerin interfaceConsistManager- Parameters:
listener- a Consist List Listener object.
-
notifyConsistListChanged
public void notifyConsistListChanged()
Description copied from interface:ConsistManagerNotify the registered ConsistListListener objects that the ConsistList has changed.- Specified by:
notifyConsistListChangedin interfaceConsistManager
-
isConsistManager
public boolean isConsistManager()
Test if a real ConsistManager is available.- Returns:
- true if a real consist manager is available, false otherwise.
-
-