Package jmri.jmrix

Class ConnectionConfigManager

    • Method Detail

      • getRequires

        @Nonnull
        public java.util.Set<java.lang.Class<? extends PreferencesManager>> getRequires()
        Description copied from class: AbstractPreferencesManager
        Get 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:
        getRequires in interface PreferencesManager
        Overrides:
        getRequires in class AbstractPreferencesManager
        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

        public void savePreferences​(Profile profile)
        Description copied from interface: PreferencesManager
        Save the preferences that this provider manages for the provided Profile.
        Specified by:
        savePreferences in interface PreferencesManager
        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

        public boolean add​(@Nonnull
                           ConnectionConfig c)
                    throws java.lang.NullPointerException
        Add a ConnectionConfig following the rules specified in Collection.add(java.lang.Object).
        Parameters:
        c - an existing ConnectionConfig
        Returns:
        true if c was added, false otherwise
        Throws:
        java.lang.NullPointerException - if c is null
      • remove

        public boolean remove​(@Nonnull
                              ConnectionConfig c)
        Remove a ConnectionConfig following the rules specified in Collection.add(java.lang.Object).
        Parameters:
        c - an existing ConnectionConfig
        Returns:
        true if c was removed, false otherwise
      • getConnections

        public ConnectionConfig getConnections​(int index)
        Get the ConnectionConfig at index following the rules specified in Collection.add(java.lang.Object).
        Parameters:
        index - index of the ConnectionConfig to return
        Returns:
        the ConnectionConfig at the specified location
      • getConnectionTypes

        @Nonnull
        public java.lang.String[] getConnectionTypes​(@Nonnull
                                                     java.lang.String manufacturer)
        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

        @Nonnull
        public java.lang.String[] getConnectionManufacturers()
        Get the list of known manufacturers.
        Returns:
        An array of known manufacturers.
      • getConnectionManufacturer

        @CheckForNull
        public java.lang.String getConnectionManufacturer​(@Nonnull
                                                          java.lang.String connectionType)
        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

        @Nonnull
        public java.lang.String[] getConnectionManufacturers​(@Nonnull
                                                             java.lang.String connectionType)
        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.