org.licas.meta

## Class LicasConfig

- java.lang.Object
- - org.licas.meta.LicasConfig

-     public class LicasConfig
      extends java.lang.Object

  This stores all licas configuration information, including service types with their related GUI class name.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LicasConfig()` Create a new instance of LicasConfig

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addInfo(java.lang.String serviceFunction, org.ai_heuristic.model.FactoryInfo factoryInfo)` Add a new class name for the specified service type and function.
    `void` | `addModuleInfo(ModuleInfo moduleInfo)` Add a new module reference to the modules list.
    `void` | `addServiceInfo(ServiceModuleInfo serviceInfo)` Add a new service info object for the specified service type.
    `static java.lang.String` | `checkClassName(java.lang.String className)` For backwards compatibility, need to convert some service class names.
    `boolean` | `containsServiceType(java.lang.String serviceFunction, java.lang.String serviceType)` Return true if the service type is included.
    `java.util.HashMap<java.lang.String,org.ai_heuristic.model.FactoryInfo>` | `getAllInfo(java.lang.String serviceFunction)` Get the list of interface info objects for the stored service types and the specified function.
    `java.util.ArrayList<java.lang.String>` | `getAllInfoFunctions()` Get the list of interface functions that classes are saved for.
    `java.util.ArrayList<java.lang.String>` | `getAllJarFiles()` Get all jar files, either listed with a service or function, or stored in either the services or the modules folders.
    `java.util.HashMap<java.lang.String,ServiceModuleInfo>` | `getAllServiceInfo()` Get the list of all default services that can be loaded from this module.
    `JarFactoryInfo` | `getDefaultJarFactory()` Get the default jar factory info.
    `ServiceFactoryInfo` | `getDefaultServiceFactory()` Get the default service factory info.
    `boolean` | `getExternalJars()` Get the value indicating if allow external class-loaders.
    `int` | `getHorizGapFactor()` Get the horizontal gap factor for the network graphic.
    `org.ai_heuristic.model.FactoryInfo` | `getInfo(java.lang.String serviceFunction, java.lang.String serviceType)` Get the info for the specified service type.
    `int` | `getMaxNetworkDepth()` Get the maximum depth that nodes are drawn to.
    `int` | `getMaxNodes()` Get the maximum number of nodes to draw on the graphic.
    `ModuleInfo` | `getModuleInfo(java.lang.String moduleName)` Get the full details to the referenced module jar file and dependencies.
    `java.util.ArrayList<java.lang.String>` | `getModuleKeys()` Get the list of all module keys.
    `int` | `getRedrawDelay()` Get the delay time before automatically re-drawing the network graphic.
    `boolean` | `getScientific()` Get the value indicating to show the scientific panels.
    `ServerConfig` | `getServerConfig()` Get the server config details.
    `ServiceModuleInfo` | `getServiceInfo(java.lang.String serviceType)` Get the info for the specified service type.
    `int` | `getTimeout()` Get the time allowed for remote method calls, in milliseconds.
    `int` | `getVertGapFactor()` Get the vertical gap factor for the network graphic.
    `boolean` | `moduleReferenced(java.lang.String moduleName)` Return if the module name with jar postfix is already referenced.
    `void` | `removeInfo(java.lang.String serviceFunction, org.ai_heuristic.model.FactoryInfo factoryInfo)` Remove class info for the specified service type and function.
    `java.util.ArrayList<java.lang.String>` | `removeModuleInfo(java.lang.String moduleName)` Remove the module from the list.
    `void` | `removeServiceInfo(java.lang.String serviceType)` Get the info for the specified service type.
    `boolean` | `serviceHasGui(java.lang.String serviceFunction, java.lang.String serviceType)` Return if the service type already has an associated class for the specified function.
    `void` | `setExternalJars(boolean theExtJars)` Set the allow external class-loaders option.
    `void` | `setHorizGapFactor(int theHorizGapFactor)` Set the horizontal gap factor for the graphic.
    `void` | `setMaxNetworkDepth(int theMaxNetworkDepth)` Set the maximum depth that nodes are drawn to.
    `void` | `setMaxNodes(int theMaxNodes)` Set the maximum number of nodes to draw on the graphic.
    `void` | `setRedrawDelay(int theRedrawDelay)` Set the delay time before automatically re-drawing the graphic.
    `void` | `setScientific(boolean theScientific)` Set the show scientific panels option.
    `void` | `setServerConfig(ServerConfig theServerConfig)` Set the server config details.
    `void` | `setTimeout(int theTimeout)` Set the time allowed for remote method calls in milliseconds.
    `void` | `setVertGapFactor(int theVertGapFactor)` Set the vertical gap factor for the graphic.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LicasConfig

          public LicasConfig()

      Create a new instance of LicasConfig

  - ### Method Detail

    - #### containsServiceType

          public boolean containsServiceType(java.lang.String serviceFunction,
                                             java.lang.String serviceType)

      Return true if the service type is included.
      Parameters:
        `serviceFunction` - the function of the class.
        `serviceType` - the service type to check.
      Returns:
        true if the service type is saved with a related function class.

    - #### serviceHasGui

          public boolean serviceHasGui(java.lang.String serviceFunction,
                                       java.lang.String serviceType)

      Return if the service type already has an associated class for the specified function.
      Parameters:
        `serviceFunction` - the function to check for.
        `serviceType` - the type of service to check for.
      Returns:
        true if a GUI interface already exists, false otherwise.

    - #### setExternalJars

          public void setExternalJars(boolean theExtJars)

      Set the allow external class-loaders option.
      Parameters:
        `theExtJars` - true if allow external jar loaders.

    - #### getExternalJars

          public boolean getExternalJars()

      Get the value indicating if allow external class-loaders.
      Returns:
        the value of extJars.

    - #### setScientific

          public void setScientific(boolean theScientific)

      Set the show scientific panels option.
      Parameters:
        `theScientific` - true if show scientific panels.

    - #### getScientific

          public boolean getScientific()

      Get the value indicating to show the scientific panels.
      Returns:
        the value of scientific.

    - #### setTimeout

          public void setTimeout(int theTimeout)

      Set the time allowed for remote method calls in milliseconds.
      Parameters:
        `theTimeout` - the timeout value.

    - #### getTimeout

          public int getTimeout()

      Get the time allowed for remote method calls, in milliseconds.
      Returns:
        the value of timeout.

    - #### setHorizGapFactor

          public void setHorizGapFactor(int theHorizGapFactor)

      Set the horizontal gap factor for the graphic.
      Parameters:
        `theHorizGapFactor` - the horizontal gap factor.

    - #### getHorizGapFactor

          public int getHorizGapFactor()

      Get the horizontal gap factor for the network graphic.
      Returns:
        the value of hGapFactor.

    - #### setVertGapFactor

          public void setVertGapFactor(int theVertGapFactor)

      Set the vertical gap factor for the graphic.
      Parameters:
        `theVertGapFactor` - the vertical gap factor.

    - #### getVertGapFactor

          public int getVertGapFactor()

      Get the vertical gap factor for the network graphic.
      Returns:
        the value of vGapFactor.

    - #### setMaxNetworkDepth

          public void setMaxNetworkDepth(int theMaxNetworkDepth)

      Set the maximum depth that nodes are drawn to.
      Parameters:
        `theMaxNetworkDepth` - the maximum network depth.

    - #### getMaxNetworkDepth

          public int getMaxNetworkDepth()

      Get the maximum depth that nodes are drawn to.
      Returns:
        the value of maxNetworkDepth.

    - #### setMaxNodes

          public void setMaxNodes(int theMaxNodes)

      Set the maximum number of nodes to draw on the graphic.
      Parameters:
        `theMaxNodes` - the maximum number of nodes to draw.

    - #### getMaxNodes

          public int getMaxNodes()

      Get the maximum number of nodes to draw on the graphic.
      Returns:
        the value of maxNodes.

    - #### setRedrawDelay

          public void setRedrawDelay(int theRedrawDelay)

      Set the delay time before automatically re-drawing the graphic.
      Parameters:
        `theRedrawDelay` - the re-draw delay time, in seconds.

    - #### getRedrawDelay

          public int getRedrawDelay()

      Get the delay time before automatically re-drawing the network graphic.
      Returns:
        the value of redrawDelay.

    - #### setServerConfig

          public void setServerConfig(ServerConfig theServerConfig)

      Set the server config details.
      Parameters:
        `theServerConfig` - the server config details.

    - #### getServerConfig

          public ServerConfig getServerConfig()

      Get the server config details.
      Returns:
        the value of serverConfig.

    - #### getDefaultServiceFactory

          public ServiceFactoryInfo getDefaultServiceFactory()

      Get the default service factory info.
      Returns:
        the value of defaultServiceFactory.

    - #### getDefaultJarFactory

          public JarFactoryInfo getDefaultJarFactory()

      Get the default jar factory info.
      Returns:
        the value of defaultJarFactory.

    - #### moduleReferenced

          public boolean moduleReferenced(java.lang.String moduleName)

      Return if the module name with jar postfix is already referenced.
      Parameters:
        `moduleName` - the module name only, not the full jar file path.
      Returns:
        true if the module is already references, false otherwise.

    - #### getAllJarFiles

          public java.util.ArrayList<java.lang.String> getAllJarFiles()
                                                               throws java.lang.Exception

      Get all jar files, either listed with a service or function, or stored in either the services or the modules folders.
      Returns:
        a list of jar file paths.
      Throws:
        `java.lang.Exception` - any error.

    - #### getModuleKeys

          public java.util.ArrayList<java.lang.String> getModuleKeys()

      Get the list of all module keys. If default services are included under a different module name, then add that to the list.
      Returns:
        the value of the module key names.

    - #### addModuleInfo

          public void addModuleInfo(ModuleInfo moduleInfo)

      Add a new module reference to the modules list.
      Parameters:
        `moduleInfo` - the module info object.

    - #### getModuleInfo

          public ModuleInfo getModuleInfo(java.lang.String moduleName)

      Get the full details to the referenced module jar file and dependencies. If default services are included under a different module name, then check that as well. They will be stored in the default `Services` folder location and a temporary `ModuleInfo` can be created to return the information.
      Parameters:
        `moduleName` - the module name only, not the full jar file path.
      Returns:
        the object the contains the module information.

    - #### removeModuleInfo

          public java.util.ArrayList<java.lang.String> removeModuleInfo(java.lang.String moduleName)

      Remove the module from the list. Also remove any service or interface types associated with it.
      Parameters:
        `moduleName` - the module name only, not the full jar file path.
      Returns:
        a list of related service definitions to remove from the main gui.

    - #### addServiceInfo

          public void addServiceInfo(ServiceModuleInfo serviceInfo)

      Add a new service info object for the specified service type. Try to add the full module jar file path first if it is missing. Overwrite any existing entry.
      Parameters:
        `serviceInfo` - the service module info.

    - #### removeServiceInfo

          public void removeServiceInfo(java.lang.String serviceType)

      Get the info for the specified service type.
      Parameters:
        `serviceType` - the service type.

    - #### getServiceInfo

          public ServiceModuleInfo getServiceInfo(java.lang.String serviceType)

      Get the info for the specified service type.
      Parameters:
        `serviceType` - the service type.
      Returns:
        the full service info object for the service type.

    - #### getAllServiceInfo

          public java.util.HashMap<java.lang.String,ServiceModuleInfo> getAllServiceInfo()

      Get the list of all default services that can be loaded from this module.
      Returns:
        the value of defaultServices.

    - #### addInfo

          public void addInfo(java.lang.String serviceFunction,
                              org.ai_heuristic.model.FactoryInfo factoryInfo)

      Add a new class name for the specified service type and function. Overwrite any existing entry.
      Parameters:
        `serviceFunction` - the function of the service.
        `factoryInfo` - the interface info.

    - #### removeInfo

          public void removeInfo(java.lang.String serviceFunction,
                                 org.ai_heuristic.model.FactoryInfo factoryInfo)

      Remove class info for the specified service type and function.
      Parameters:
        `serviceFunction` - the function of the service.
        `factoryInfo` - the interface info.

    - #### getInfo

          public org.ai_heuristic.model.FactoryInfo getInfo(java.lang.String serviceFunction,
                                                            java.lang.String serviceType)

      Get the info for the specified service type.
      Parameters:
        `serviceFunction` - the function of the service.
        `serviceType` - the service type.
      Returns:
        the full info object for the interface to load.

    - #### getAllInfoFunctions

          public java.util.ArrayList<java.lang.String> getAllInfoFunctions()

      Get the list of interface functions that classes are saved for.
      Returns:
        the key set to the service classes lists.

    - #### getAllInfo

          public java.util.HashMap<java.lang.String,org.ai_heuristic.model.FactoryInfo> getAllInfo(java.lang.String serviceFunction)

      Get the list of interface info objects for the stored service types and the specified function.
      Parameters:
        `serviceFunction` - the function of the service.
      Returns:
        a list of FactorInfo objects from serviceClasses.

    - #### checkClassName

          public static java.lang.String checkClassName(java.lang.String className)

      For backwards compatibility, need to convert some service class names.
      Parameters:
        `className` - the class name to check.
      Returns:
        the appropriate version.