Interface LogixNG_Manager

    • Method Detail

      • createLogixNG

        LogixNG createLogixNG​(java.lang.String systemName,
                              java.lang.String userName)
                       throws java.lang.IllegalArgumentException
        Create a new LogixNG if the LogixNG does not exist.
        Parameters:
        systemName - the system name
        userName - the user name
        Returns:
        a new LogixNG or null if unable to create
        Throws:
        java.lang.IllegalArgumentException
      • createLogixNG

        LogixNG createLogixNG​(java.lang.String systemName,
                              java.lang.String userName,
                              boolean inline)
                       throws java.lang.IllegalArgumentException
        Create a new LogixNG if the LogixNG does not exist.
        Parameters:
        systemName - the system name
        userName - the user name
        inline - true if this LogixNG is an inline LogixNG
        Returns:
        a new LogixNG or null if unable to create
        Throws:
        java.lang.IllegalArgumentException
      • createLogixNG

        LogixNG createLogixNG​(java.lang.String userName)
                       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
        Returns:
        a new LogixNG or null if unable to create
        Throws:
        java.lang.IllegalArgumentException
      • createLogixNG

        LogixNG createLogixNG​(java.lang.String userName,
                              boolean inline)
                       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
        inline - true if this LogixNG is an inline LogixNG
        Returns:
        a new LogixNG or null if unable to create
        Throws:
        java.lang.IllegalArgumentException
      • getLogixNG

        LogixNG getLogixNG​(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

        LogixNG getByUserName​(java.lang.String name)
        Locate an existing instance based on a user name.
        Specified by:
        getByUserName in interface Manager<LogixNG>
        Parameters:
        name - System Name of the required NamedBean
        Returns:
        requested NamedBean object or null if none exists
      • getBySystemName

        LogixNG getBySystemName​(java.lang.String name)
        Locate an existing instance based on a system name.
        Specified by:
        getBySystemName in interface Manager<LogixNG>
        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 LogixNG.
        Returns:
        a new system name
      • setLoadDisabled

        void setLoadDisabled​(boolean value)
        Should the LogixNGs be disabled when the configuration file is loaded?
        Parameters:
        value - true if they should be disabled, false otherwise.
      • startLogixNGsOnLoad

        void startLogixNGsOnLoad​(boolean value)
        Should the LogixNGs be started when the configuration file is loaded?
        Parameters:
        value - true if they should be started, false otherwise.
      • isStartLogixNGsOnLoad

        boolean isStartLogixNGsOnLoad()
        Should the LogixNGs not be started when the configuration file is loaded?
        Returns:
        true if they should be started, false otherwise.
      • setupAllLogixNGs

        void setupAllLogixNGs()
        Setup all LogixNGs. This method is called after a configuration file is loaded.
      • activateAllLogixNGs

        void activateAllLogixNGs()
        Activate all LogixNGs, starts LogixNG processing by connecting all inputs that are included the ConditionalNGs in this LogixNG.

        A LogixNG must be activated before it will calculate any of its ConditionalNGs.

      • activateAllLogixNGs

        void activateAllLogixNGs​(boolean runDelayed,
                                 boolean runOnSeparateThread)
        Activate all LogixNGs, starts LogixNG processing by connecting all inputs that are included the ConditionalNGs in this LogixNG.

        A LogixNG must be activated before it will calculate any of its ConditionalNGs.

        Parameters:
        runDelayed - true if execute() should run on LogixNG thread delayed, false otherwise.
        runOnSeparateThread - true if the activation should run on a separate thread, false otherwise
      • deActivateAllLogixNGs

        void deActivateAllLogixNGs()
        DeActivate all LogixNGs, stops LogixNG processing by disconnecting all inputs that are included the ConditionalNGs in this LogixNG.

        A LogixNG must be activated before it will calculate any of its ConditionalNGs.

      • isActive

        boolean isActive()
        Is LogixNGs active?
        Returns:
        true if LogixNGs are active, false otherwise
      • deleteLogixNG

        void deleteLogixNG​(LogixNG x)
        Delete LogixNG by removing it from the manager. The LogixNG must first be deactivated so it stops processing.
        Parameters:
        x - the LogixNG to delete
      • printTree

        default void printTree​(java.io.PrintWriter writer,
                               java.lang.String indent,
                               MutableInt lineNumber)
        Print the tree to a stream.
        Parameters:
        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.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

        default void printTree​(java.util.Locale locale,
                               java.io.PrintWriter writer,
                               java.lang.String indent,
                               MutableInt lineNumber)
        Print the tree to a stream.
        Parameters:
        locale - The locale to be used
        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 LogixNG system.

        Parameters:
        subSystemNamePrefix - the sub system prefix
        systemName - the system name
        Returns:
        enum indicating current validity, which might be just as a prefix
      • registerManager

        void registerManager​(Manager<? extends MaleSocket> manager)
        Register a manager for later retrieval by getManager()
        Parameters:
        manager - the manager
      • getManager

        Manager<? extends MaleSocketgetManager​(java.lang.String className)
        Get manager by class name
        Parameters:
        className - the class name of the manager
        Returns:
        the manager
      • registerSetupTask

        void registerSetupTask​(java.lang.Runnable task)
        Register a task to be run when setup LogixNGs
        Parameters:
        task - the task
      • executeModule

        void executeModule​(Module module,
                           java.lang.Object parameter)
                    throws java.lang.IllegalArgumentException
        Executes a LogixNG Module. Note that the module must be a Digital Action Module.
        Parameters:
        module - The module to be executed
        parameter - The parameter. The module must have exactly one parameter.
        Throws:
        java.lang.IllegalArgumentException - If module is null or if module is not a DigitalActionModule.
      • executeModule

        void executeModule​(Module module,
                           java.util.Map<java.lang.String,​java.lang.Object> parameters)
                    throws java.lang.IllegalArgumentException
        Executes a LogixNG Module. Note that the module must be a Digital Action Module.
        Parameters:
        module - The module to be executed
        parameters - The parameters
        Throws:
        java.lang.IllegalArgumentException - If module or parameters is null or if module is not a DigitalActionModule.