Package jmri.jmrit.logixng
Interface ModuleManager
-
- All Superinterfaces:
Manager<Module>
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeProvider
- All Known Implementing Classes:
DefaultModuleManager
public interface ModuleManager extends Manager<Module>
Manager for LogixNG modules
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity
-
-
Field Summary
-
Fields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Module
createModule(java.lang.String systemName, java.lang.String userName, FemaleSocketManager.SocketType socketType)
Create a new Module if the Module does not exist.Module
createModule(java.lang.String userName, FemaleSocketManager.SocketType socketType)
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.void
deleteModule(Module x)
Delete Module by removing it from the manager.java.lang.String
getAutoSystemName()
Create a new system name for a Module.Module
getBySystemName(java.lang.String name)
Locate an existing instance based on a system name.Module
getByUserName(java.lang.String name)
Locate an existing instance based on a user name.Module
getModule(java.lang.String name)
Locate via user name, then system name if needed.default java.lang.String
getSubSystemNamePrefix()
Get the sub system prefix of this manager.void
printTree(Base.PrintTreeSettings settings, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.void
printTree(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.boolean
resolveAllTrees(java.util.List<java.lang.String> errors)
Resolve all the Module trees.void
setupAllModules()
Setup all Modules.static Manager.NameValidity
validSystemNameFormat(java.lang.String subSystemNamePrefix, java.lang.String systemName)
Test if parameter is a properly formatted system name.-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, dispose, getBeanTypeHandled, getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanClass, getNamedBeanSet, getObjectCount, getSystemNamePrefix, getSystemPrefix, getXMLOrder, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, typeLetter, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormat
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilenced
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Method Detail
-
createModule
Module createModule(java.lang.String systemName, java.lang.String userName, FemaleSocketManager.SocketType socketType) throws java.lang.IllegalArgumentException
Create a new Module if the Module does not exist.- Parameters:
systemName
- the system nameuserName
- the user namesocketType
- the socket type- Returns:
- a new Module or null if unable to create
- Throws:
java.lang.IllegalArgumentException
-
createModule
Module createModule(java.lang.String userName, FemaleSocketManager.SocketType socketType) throws java.lang.IllegalArgumentException
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.- Parameters:
userName
- the user namesocketType
- the socket type- Returns:
- a new Module or null if unable to create
- Throws:
java.lang.IllegalArgumentException
-
getModule
Module getModule(java.lang.String name)
Locate via user name, then system name if needed. Does not create a new one if nothing found- Parameters:
name
- User name or system name to match- Returns:
- null if no match found
-
getByUserName
Module getByUserName(java.lang.String name)
Locate an existing instance based on a user name.- Specified by:
getByUserName
in interfaceManager<Module>
- Parameters:
name
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getBySystemName
Module getBySystemName(java.lang.String name)
Locate an existing instance based on a system name.- Specified by:
getBySystemName
in interfaceManager<Module>
- Parameters:
name
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getAutoSystemName
java.lang.String getAutoSystemName()
Create a new system name for a Module.- Returns:
- a new system name
-
resolveAllTrees
boolean resolveAllTrees(java.util.List<java.lang.String> errors)
Resolve all the Module trees.This method ensures that everything in the Module tree has a pointer to its parent.
- Parameters:
errors
- a list of potential errors- Returns:
- true if success, false otherwise
-
setupAllModules
void setupAllModules()
Setup all Modules. This method is called after a configuration file is loaded.
-
deleteModule
void deleteModule(Module x)
Delete Module by removing it from the manager. The Module must first be deactivated so it stops processing.- Parameters:
x
- the Module to delete
-
printTree
void printTree(Base.PrintTreeSettings settings, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.- Parameters:
settings
- settings for what to printwriter
- the stream to print the tree toindent
- the indentation of each levellineNumber
- the line number
-
printTree
void printTree(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.- Parameters:
settings
- settings for what to printlocale
- The locale to be usedwriter
- the stream to print the tree toindent
- the indentation of each levellineNumber
- the line number
-
validSystemNameFormat
static Manager.NameValidity validSystemNameFormat(java.lang.String subSystemNamePrefix, java.lang.String systemName)
Test if parameter is a properly formatted system name.This method should only be used by the managers of the Module system.
- Parameters:
subSystemNamePrefix
- the sub system prefixsystemName
- the system name- Returns:
- enum indicating current validity, which might be just as a prefix
-
getSubSystemNamePrefix
default java.lang.String getSubSystemNamePrefix()
Get the sub system prefix of this manager. The sub system prefix is the system name prefix and possibly some extra characters of the NamedBeans handled by this manager.For most managers, this is the same as
Manager.getSystemNamePrefix()
, but for some like the managers in LogixNG, it differs. The sub system prefix for the DigitalActionManager isManager.getSystemNamePrefix()
and "DA";- Specified by:
getSubSystemNamePrefix
in interfaceManager<Module>
- Returns:
- the sub system prefix
-
-