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
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsistListListener(ConsistListListener listener) Register a ConsistListListener object with this ConsistManagerbooleanDoes a command station consist require a separate consist address from locomotives in consist?decodeErrorCode(int errorCode) Translate Error Codes relieved by a consistListener into StringsvoiddelConsist(LocoAddress address) Remove an old Consist.getConsist(LocoAddress address) Find a Consist with this consist address, and return it.Get a list of known consist addresses.booleanDoes this implementation support Command Station Consists?booleanTest if a real ConsistManager is available.voidNotify the registered ConsistListListener objects that the ConsistList has changed.voidremoveConsistListListener(ConsistListListener listener) Remove a ConsistListListener object with this ConsistManagervoidRequest 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, removePropertyChangeListenerMethods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.ConsistManager
canBeDisabled, isAdvancedConsistPossible, isEnabled, isSingleFormConsistRequired, registerEnableListener, unregisterEnableListener
-
Constructor Details
-
JsonConsistManager
public JsonConsistManager()
-
-
Method Details
-
getConsist
Description copied from interface:ConsistManagerFind a Consist with this consist address, and return it. If the Consist doesn't exist, create it.- Specified by:
getConsistin interfaceConsistManager- Parameters:
address- the consist address- Returns:
- an existing or new consist
-
delConsist
Description copied from interface:ConsistManagerRemove an old Consist.- Specified by:
delConsistin interfaceConsistManager- Parameters:
address- the consist address
-
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
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
Description copied from interface:ConsistManagerGet a list of known consist addresses.- Specified by:
getConsistListin interfaceConsistManager- Returns:
- list of addresses
-
decodeErrorCode
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
Description copied from interface:ConsistManagerRequest an update from the layout, loading Consists from the command station.- Specified by:
requestUpdateFromLayoutin interfaceConsistManager
-
addConsistListListener
Description copied from interface:ConsistManagerRegister a ConsistListListener object with this ConsistManager- Specified by:
addConsistListListenerin interfaceConsistManager- Parameters:
listener- a Consist List Listener object.
-
removeConsistListListener
Description copied from interface:ConsistManagerRemove a ConsistListListener object with this ConsistManager- Specified by:
removeConsistListListenerin interfaceConsistManager- Parameters:
listener- a Consist List Listener object.
-
notifyConsistListChanged
Description copied from interface:ConsistManagerNotify the registered ConsistListListener objects that the ConsistList has changed.- Specified by:
notifyConsistListChangedin interfaceConsistManager
-
isConsistManager
Test if a real ConsistManager is available.- Returns:
- true if a real consist manager is available, false otherwise.
-