Class ConnectionConfigManager
- All Implemented Interfaces:
Iterable<ConnectionConfig>,BeanInterface,PropertyChangeFirer,PropertyChangeProvider,JmriServiceProviderInterface,PreferencesManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class jmri.beans.Bean
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd aConnectionConfigfollowing the rules specified inCollection.add(java.lang.Object).getConnectionManufacturer(String connectionType) Get the manufacturer that is supported by a connection type.String[]Get the list of known manufacturers.String[]getConnectionManufacturers(String connectionType) Get the list of all known manufacturers that a single connection type supports.Get an Array ofConnectionConfigobjects.getConnections(int index) Get theConnectionConfigat index following the rules specified inCollection.add(java.lang.Object).String[]getConnectionTypes(String manufacturer) Get the class names for classes supporting layout connections for the given manufacturer.Set<Class<? extends PreferencesManager>>Get the set of PreferencesManagers that must be initialized prior to initializing this PreferencesManager.voidinitialize(Profile profile) Initialize the PreferencesManager with preferences associated with the provided Profile.iterator()booleanRemove aConnectionConfigfollowing the rules specified inCollection.add(java.lang.Object).voidsavePreferences(Profile profile) Save the preferences that this provider manages for the provided Profile.Methods inherited from class jmri.util.prefs.AbstractPreferencesManager
addInitializationException, getInitializationExceptions, getProvides, isInitialized, isInitializedWithExceptions, isInitializing, requireAllOther, requiresNoInitializedWithExceptions, requiresNoInitializedWithExceptions, setInitialized, setInitializingMethods 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 java.lang.Iterable
forEach, spliterator
-
Field Details
-
CONNECTIONS
- See Also:
-
CONNECTION
- See Also:
-
CLASS
- See Also:
-
USER_NAME
- See Also:
-
SYSTEM_NAME
- See Also:
-
MANUFACTURER
- See Also:
-
-
Constructor Details
-
ConnectionConfigManager
public ConnectionConfigManager()
-
-
Method Details
-
initialize
Description copied from interface:PreferencesManagerInitialize the PreferencesManager with preferences associated with the provided Profile.Implementing classes should throw an InitializationException with a user readable localized message, since it most likely be displayed to the user. Implementing classes will still want to ensure that
PreferencesManager.isInitialized(jmri.profile.Profile)orPreferencesManager.isInitializedWithExceptions(jmri.profile.Profile)return true if throwing an InitializationException to ensure that the provider is not repeatedly initialized.- Specified by:
initializein interfacePreferencesManager- Parameters:
profile- the configuration profile used for this initialization; may be null to initialize for this user regardless of profile- Throws:
HasConnectionButUnableToConnectException
-
getRequires
Description copied from class:AbstractPreferencesManagerGet the set of PreferencesManagers that must be initialized prior to initializing this PreferencesManager. It is generally preferable to require an Interface or an abstract Class instead of a concrete Class, since that allows all (or any) concrete implementations of the required class to be initialized to provide required services for the requiring PreferencesManager instance.Note that for any set of PreferencesManagers with the same requirements, or with a circular dependency between each other, the order in which the PreferencesManagers in that set are initialized should be considered non-deterministic.
This implementation includes a default dependency on the
ConnectionConfigManager.- Specified by:
getRequiresin interfacePreferencesManager- Overrides:
getRequiresin classAbstractPreferencesManager- Returns:
- An set of classes; if there are no dependencies, return an empty set instead of null; overriding implementations may add to this set directly
-
savePreferences
Description copied from interface:PreferencesManagerSave the preferences that this provider manages for the provided Profile.- Specified by:
savePreferencesin interfacePreferencesManager- Parameters:
profile- the profile associated with the preferences to save; may be null to save preferences that apply to the current user regardless of profile
-
add
Add aConnectionConfigfollowing the rules specified inCollection.add(java.lang.Object).- Parameters:
c- an existing ConnectionConfig- Returns:
- true if c was added, false otherwise
- Throws:
NullPointerException- if c is null
-
remove
Remove aConnectionConfigfollowing the rules specified inCollection.add(java.lang.Object).- Parameters:
c- an existing ConnectionConfig- Returns:
- true if c was removed, false otherwise
-
getConnections
Get an Array ofConnectionConfigobjects.- Returns:
- an Array, possibly empty if there are no ConnectionConfig objects.
-
getConnections
Get theConnectionConfigat index following the rules specified inCollection.add(java.lang.Object).- Parameters:
index- index of the ConnectionConfig to return- Returns:
- the ConnectionConfig at the specified location
-
iterator
- Specified by:
iteratorin interfaceIterable<ConnectionConfig>
-
getConnectionTypes
Get the class names for classes supporting layout connections for the given manufacturer.- Parameters:
manufacturer- the name of the manufacturer- Returns:
- An array of supporting class names; will return the list of internal connection classes if manufacturer is not a known manufacturer; the array may be empty if there are no supporting classes for the given manufacturer.
-
getConnectionManufacturers
Get the list of known manufacturers.- Returns:
- An array of known manufacturers.
-
getConnectionManufacturer
Get the manufacturer that is supported by a connection type. If there are multiple manufacturers supported by connectionType, returns only the first manufacturer.- Parameters:
connectionType- the class name of a connection type.- Returns:
- the supported manufacturer. Returns null if no manufacturer is associated with the connectionType.
-
getConnectionManufacturers
Get the list of all known manufacturers that a single connection type supports.- Parameters:
connectionType- the class name of a connection type.- Returns:
- an Array of supported manufacturers. Returns an empty Array if no manufacturer is associated with the connectionType.
-