Interface ModuleManager

    • 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 name
        userName - the user name
        socketType - 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 name
        socketType - 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 interface Manager<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 interface Manager<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 print
        writer - the stream to print the tree to
        indent - the indentation of each level
        lineNumber - 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 print
        locale - The locale to be used
        writer - the stream to print the tree to
        indent - the indentation of each level
        lineNumber - 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 prefix
        systemName - the system name
        Returns:
        enum indicating current validity, which might be just as a prefix