Class ScriptConstants


  • public final class ScriptConstants
    extends java.lang.Object
    This class contains constants and functions specific for creating the scripts and other files for the different machines and applications.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String doubleBackslashes​(java.lang.String path)
      Changes a string into correct formatted style.
      static java.lang.String getLinuxPIDS​(java.lang.String totalName, java.lang.String path, java.lang.String id)
      Creates the script for extracting the processes of a specific application, depending on the name of the application and the settings file.
      static java.lang.String replaceWindowsDirSeparators​(java.lang.String path)
      Changes a string into correct formatted style.
      static java.lang.String writeDashLine()
      Function for creating dash lines in scripts.
      static java.lang.String writeInstallMachineHeader​(java.lang.String login)
      The header for the install all script for the machine.
      static java.lang.String writeKillMachineHeader​(java.lang.String login)
      The header for the kill all script for the machine.
      static java.lang.String writeSecurityPolicyDirPermission​(java.lang.String dir)
      For giving readonly permission to a directory in the security policy.
      static java.lang.String writeStartMachineHeader​(java.lang.String login)
      The header for the start all script for the machine.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • writeDashLine

        public static java.lang.String writeDashLine()
        Function for creating dash lines in scripts.
        Returns:
        A line of dashes.
      • writeKillMachineHeader

        public static java.lang.String writeKillMachineHeader​(java.lang.String login)
                                                       throws ArgumentNotValid
        The header for the kill all script for the machine.
        Parameters:
        login - The login to the machine (username@machinename)
        Returns:
        The echo header for killing a machine.
        Throws:
        ArgumentNotValid - If the login is null or the empty string.
      • writeStartMachineHeader

        public static java.lang.String writeStartMachineHeader​(java.lang.String login)
                                                        throws ArgumentNotValid
        The header for the start all script for the machine.
        Parameters:
        login - The login to the machine (username@machinename)
        Returns:
        The echo header for killing a machine.
        Throws:
        ArgumentNotValid - If the login is null or the empty string.
      • writeInstallMachineHeader

        public static java.lang.String writeInstallMachineHeader​(java.lang.String login)
                                                          throws ArgumentNotValid
        The header for the install all script for the machine.
        Parameters:
        login - The login to the machine (username@machinename)
        Returns:
        The echo header for killing a machine.
        Throws:
        ArgumentNotValid - If the login is null or the empty string.
      • doubleBackslashes

        public static java.lang.String doubleBackslashes​(java.lang.String path)
                                                  throws ArgumentNotValid
        Changes a string into correct formatted style. The '.vbs' script needs '\\' instead of '\', which is quite annoying when using regular expressions, since a final '\' in regular expressions is '\\\\', thus '\\' = '\\\\\\\\' (8).
        Parameters:
        path - The directory path to change to appropriate format.
        Returns:
        The formatted path.
        Throws:
        ArgumentNotValid - If the path is null or the empty string.
      • replaceWindowsDirSeparators

        public static java.lang.String replaceWindowsDirSeparators​(java.lang.String path)
                                                            throws ArgumentNotValid
        Changes a string into correct formatted style. The '.vbs' script needs '\\' instead of '\', which is quite annoying when using regular expressions, since a final '\' in regular expressions is '/', thus '\\' = '\\\\\\\\' (8).
        Parameters:
        path - The directory path to change to appropriate format.
        Returns:
        The formatted path.
        Throws:
        ArgumentNotValid - If the path is null or the empty string.
      • writeSecurityPolicyDirPermission

        public static java.lang.String writeSecurityPolicyDirPermission​(java.lang.String dir)
                                                                 throws ArgumentNotValid
        For giving readonly permission to a directory in the security policy.
        Parameters:
        dir - The path to the directory. This has to be formatted to have the correct directory separator: '${/}', instead of '/' or '\\' for Windows and Linux respectively.
        Returns:
        The permission string.
        Throws:
        ArgumentNotValid - If the dir is null or the empty string.
      • getLinuxPIDS

        public static java.lang.String getLinuxPIDS​(java.lang.String totalName,
                                                    java.lang.String path,
                                                    java.lang.String id)
                                             throws ArgumentNotValid
        Creates the script for extracting the processes of a specific application, depending on the name of the application and the settings file.
        Parameters:
        totalName - The total name of the application.
        path - The path to the directory of the settings file (conf-dir).
        id - The identification of the application (name + instanceId).
        Returns:
        The script for getting the list of running application.
        Throws:
        ArgumentNotValid - If the totalName, the path or the id is either null or the empty string.