Package jmri
Interface RouteManager
-
- All Superinterfaces:
Manager<Route>
,PropertyChangeProvider
,ProvidingManager<Route>
,SilenceablePropertyChangeProvider
,VetoableChangeProvider
- All Known Implementing Classes:
DefaultRouteManager
public interface RouteManager extends ProvidingManager<Route>
Interface for obtaining Routes.This doesn't have a "new" method, since Routes are separately implemented, instead of being system-specific.
This file is part of JMRI.JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-
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 Instance Methods Abstract Methods Modifier and Type Method Description void
deleteRoute(Route r)
Delete Route by removing it from the manager.void
dispose()
Free resources when no longer used.Route
getBySystemName(java.lang.String s)
Locate an existing instance based on a system name.Route
getByUserName(java.lang.String s)
Locate an existing instance based on a user name.Route
getRoute(java.lang.String name)
Locate via user name, then system name if needed.Route
newRoute(java.lang.String userName)
Create a new Route if the route does not exist.Route
provideRoute(java.lang.String systemName, java.lang.String userName)
Provides existing Route by UserName then SystemName if one exists.-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, getBeanTypeHandled, getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanClass, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, 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.ProvidingManager
provide
-
Methods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilenced
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Method Detail
-
dispose
void dispose()
Description copied from interface:Manager
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.
-
provideRoute
@Nonnull Route provideRoute(@Nonnull java.lang.String systemName, @CheckForNull java.lang.String userName) throws java.lang.IllegalArgumentException
Provides existing Route by UserName then SystemName if one exists. Create a new Route if the route does not exist.- Parameters:
systemName
- the system name for the routeuserName
- the user name for the route- Returns:
- New or existing Route.
- Throws:
java.lang.IllegalArgumentException
- if there is trouble creating a new Route
-
newRoute
@Nonnull Route newRoute(@Nonnull java.lang.String userName) throws java.lang.IllegalArgumentException
Create a new Route if the route does not exist. Intended for use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.- Parameters:
userName
- user name for the new route- Returns:
- New Route.
- Throws:
java.lang.IllegalArgumentException
- if there is trouble creating a new Route
-
getRoute
@CheckForNull Route getRoute(@Nonnull 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
@CheckForNull Route getByUserName(@Nonnull java.lang.String s)
Description copied from interface:Manager
Locate an existing instance based on a user name.- Specified by:
getByUserName
in interfaceManager<Route>
- Parameters:
s
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getBySystemName
@CheckForNull Route getBySystemName(@Nonnull java.lang.String s)
Description copied from interface:Manager
Locate an existing instance based on a system name.- Specified by:
getBySystemName
in interfaceManager<Route>
- Parameters:
s
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
deleteRoute
void deleteRoute(@Nonnull Route r)
Delete Route by removing it from the manager. The Route must first be deactivated so it stops processing.- Parameters:
r
- the route to remove
-
-