Class RuntimeExecutionCommandBuilder


  • public class RuntimeExecutionCommandBuilder
    extends AbstractExecutionCommandBuilder<RuntimeExecutionCommandBuilder>
    1C:Enterprise runtime execution command builder. Clients may start process after building.

    Instances of RuntimeExecutionCommandBuilder are stateful and are not safe for use by multiple threads.

    Example of usage:

     Process process = new RuntimeCommandBuilder(launchFile, Mode.DESIGNER)
          .forInfobase(infobase).dumpConfigurationToXml(ConfigurationFilesFormat.PLAIN, destinationFolder)
          .userName(userName).userPassword(userPassword).logTo(logFile).start();
    
     int returnCode = process.waitFor();
     
    See Also:
    ProcessBuilder
    • Method Detail

      • forInfobase

        public RuntimeExecutionCommandBuilder forInfobase​(InfobaseReference infobase,
                                                          boolean split)
        Add an infobase connection option to the constructing command. The infobase additional parameters will also be added to the constructing command.
        Parameters:
        infobase - the infobase to use, cannot be null
        split - whether need to split infobase name from infobase command option
        Returns:
        a reference to this command builder, never null
      • forInfobase

        public RuntimeExecutionCommandBuilder forInfobase​(IConnectionString infobaseConnection,
                                                          boolean split)
        Add an infobase connection option to the constructing command.
        Parameters:
        infobase - the infobase connection to use, cannot be null
        split - whether need to split infobase name from infobase command option
        Returns:
        a reference to this command builder, never null
      • dumpConfigurationToXml

        public RuntimeExecutionCommandBuilder dumpConfigurationToXml​(Path destinationFolder)
        Add dumping infobase configuration to the destination folder option to constructing command. Configuration objects scope to load may be specified with files or fileList options.
        Parameters:
        destinationFolder - the destination folder to dump to, cannot be null
        Returns:
        a reference to this command builder, never null
      • dumpConfigurationToMobileXml

        public RuntimeExecutionCommandBuilder dumpConfigurationToMobileXml​(Path destinationFile)
        Add dumping infobase configuration to the destination file as mobile XML option to constructing command.
        Parameters:
        destinationFile - the destination file to dump to, cannot be null
        Returns:
        a reference to this command builder, never null
      • loadConfigurationFromXml

        public RuntimeExecutionCommandBuilder loadConfigurationFromXml​(Path sourceFolder)
        Add loading infobase configuration as XML files from the source folder option to the constructing command. Configuration objects scope to load may be specified with files or fileList options.
        Parameters:
        sourceFolder - the source folder to restore from, cannot be null
        Returns:
        a reference to this command builder, never null
      • archive

        public RuntimeExecutionCommandBuilder archive​(String archiveName)
        Add loading infobase configuration as XML files from the source parameter that forces command to assume source as archive zip-file.
        Parameters:
        archiveName - the archive name in the source folder to load from, cannot be null
        Returns:
        a reference to this command builder, never null
      • disableLoadValidation

        public RuntimeExecutionCommandBuilder disableLoadValidation()
        Add loading infobase configuration as XML files from the source parameter that forces load command skip load files validation.
        Returns:
        a reference to this command builder, never null
      • files

        public RuntimeExecutionCommandBuilder files​(File... files)
        Add infobase configuration object files scope command option tthe o constructing command.
        Parameters:
        files - a list of exporting files for incremental XML load or dump, cannot be null or empty
        Returns:
        a reference to this command builder, never null
      • fileList

        public RuntimeExecutionCommandBuilder fileList​(Path fileList)
        Add infobase configuration object file list scope command option tthe o constructing command.
        Parameters:
        fileList - a file, that contains list of exporting files for incremental XML load or dump, cannot be null
        Returns:
        a reference to this command builder, never null
      • withFormat

        public RuntimeExecutionCommandBuilder withFormat​(ConfigurationFilesFormat format)
        Add XML format option parameter to the constructing command.
        Parameters:
        format - the formal of XML files - plain or hierarchical, never null
        Returns:
        a reference to this command builder, never null
      • getChanges

        public RuntimeExecutionCommandBuilder getChanges​(Path destinationFile)
        Add exporting configuration object changes to the provided file option to constructing command.
        Parameters:
        destinationFile - the destination file to dump to, cannot be null
        Returns:
        a reference to this command builder, never null
      • withConfigDumpInfo

        public RuntimeExecutionCommandBuilder withConfigDumpInfo​(Path dumpInfoFile)
        Add configuration dump info option to the constructing command.
        Parameters:
        dumpInfoFile - the dump info file, cannot be null
        Returns:
        a reference to this command builder, never null
      • updateConfigDumpInfo

        public RuntimeExecutionCommandBuilder updateConfigDumpInfo()
        Add update configuration dump info option to the constructing command.
        Returns:
        a reference to this command builder, never null
      • update

        public RuntimeExecutionCommandBuilder update()
        Add update option to the constructing command.
        Returns:
        a reference to this command builder, never null
      • checkConfigurationExtensionsApplicability

        public RuntimeExecutionCommandBuilder checkConfigurationExtensionsApplicability​(String extensionsName)
        Add checking configuration extensions applicability option to constructing command.
        Parameters:
        an - extension name to check or null to check all extensions
        Returns:
        a reference to this command builder, never null
      • listConfigurationExtensions

        public RuntimeExecutionCommandBuilder listConfigurationExtensions()
        Add listing all configuration extensions option to constructing command.
        Returns:
        a reference to this command builder, never null
      • deleteConfigurationExtension

        public RuntimeExecutionCommandBuilder deleteConfigurationExtension​(String extensionsName)
        Add deleting the given configuration extension option to constructing command.
        Parameters:
        an - extension name to delete, cannot be null
        Returns:
        a reference to this command builder, never null
      • deleteConfigurationExtensions

        public RuntimeExecutionCommandBuilder deleteConfigurationExtensions()
        Add deleting all configuration extensions option to constructing command.
        Returns:
        a reference to this command builder, never null
      • forExtension

        public RuntimeExecutionCommandBuilder forExtension​(String extensionName)
        Add customization for the configuring command that command will be used for the provided extension.
        Parameters:
        extensionName - the name of the configuration extension, cannot be null
        Returns:
        a reference to this command builder, never null
      • forAllExtensions

        public RuntimeExecutionCommandBuilder forAllExtensions()
        Add customization for the configuring command that command will be used for all configuration extensions.
        Returns:
        a reference to this command builder, never null
      • updateInfobase

        public RuntimeExecutionCommandBuilder updateInfobase()
        Add updating Infobase option to constructing command.
        Returns:
        a reference to this command builder, never null
      • dumpInfobase

        public RuntimeExecutionCommandBuilder dumpInfobase​(String destinationFile)
        Add dumping Infobase to given destination file option to constructing command.
        Parameters:
        destinationFile - destination file to dump to, cannot be null
        Returns:
        a reference to this command builder, never null
      • restoreInfobase

        public RuntimeExecutionCommandBuilder restoreInfobase​(String sourceFile)
        Add restoring Infobase from given source file option to constructing command.
        Parameters:
        sourceFile - source file to restore from, cannot be null
        Returns:
        a reference to this command builder, never null
      • dumpConfigurationToCf

        public RuntimeExecutionCommandBuilder dumpConfigurationToCf​(String destinationFile)
        Add exporting Configuration to given destination *.cf file option to constructing command.
        Parameters:
        destinationFile - destination file to dump to, cannot be null
        Returns:
        a reference to this command builder, never null
      • loadConfigurationFromCf

        public RuntimeExecutionCommandBuilder loadConfigurationFromCf​(String sourceFile)
        Add importing Configuration from given *.cf file option to constructing command.
        Parameters:
        sourceFile - *.cf file to restore from, cannot be null
        Returns:
        a reference to this command builder, never null
      • dumpExternalDataToFiles

        public RuntimeExecutionCommandBuilder dumpExternalDataToFiles​(ConfigurationFilesFormat format,
                                                                      String rootSourceFile,
                                                                      String extarnalDataFile)
        Add dumping an external report or data processor to a set of files option to constructing command.
        Parameters:
        format - formal of XML files - plain or hierarchical, or null if not needed
        rootSourceFile - the root file of platform XML etxernal data presentation, cannot be null
        extarnalDataFile - the external data dump file, cannot be null
        Returns:
        a reference to this command builder, never null
      • loadExternalDataFromFiles

        public RuntimeExecutionCommandBuilder loadExternalDataFromFiles​(String rootSourceFile,
                                                                        String extarnalDataFile)
        Add loading of an external report or data processor from a set of files option to constructing command.
        Parameters:
        rootSourceFile - the root file of platform XML etxernal data presentation, cannot be null
        extarnalDataFile - the external data dump file, cannot be null
        Returns:
        a reference to this command builder, never null
      • createInfobase

        public RuntimeExecutionCommandBuilder createInfobase​(InfobaseReference infobase,
                                                             CreateInfobaseArguments arguments,
                                                             boolean addReference)
        Add Infobase creation option to constructing command.

        This command option is only supported in "create infobase" mode of 1C:Enterprise runtime execution.

        Parameters:
        infobase - infobase instance to create, cannot be null
        arguments - create Infobase arguments, cannot be null
        addReference - add reference to created infobase to infobases configuration file
        Returns:
        a reference to this command builder, never null
      • usingTemplate

        public RuntimeExecutionCommandBuilder usingTemplate​(Path templateLocation)
        Add Infobase template usage option to constructing command.

        This command option is only supported in "create infobase" mode of 1C:Enterprise runtime execution.

        Parameters:
        templateLocation - the locaton of the infobase template, must have extension *.cf, *.cfu or *.dt, cannot be null
        Returns:
        a reference to this command builder, never null
      • emulateDeplay

        public RuntimeExecutionCommandBuilder emulateDeplay​(Double callDelay,
                                                            Double dataSendingDelay,
                                                            Double dataReceivingDelay)
        Add server delay emulation option to launched 1C:Enterprise client.
        Parameters:
        callDelay - the server call delay in seconds, can be null then will not be appended as option parameter
        dataSendingDelay - the data sending delay in KB per seconds, can be null then will not be appended as option parameter
        dataReceivingDelay - the data receiving delay in KB per seconds, can be null then will not be appended as option parameter
        Returns:
        a reference to this command builder, never null
      • clientType

        public RuntimeExecutionCommandBuilder clientType​(ClientType clientType)
        Set running 1C:Enterprise runtime client type.
        Parameters:
        clientType - the launching client type, cannot be null
        Returns:
        a reference to this command builder, never null
      • autoCheckVersion

        public RuntimeExecutionCommandBuilder autoCheckVersion()
        Add running 1C:Enterprise runtime auto version selection option.
        Returns:
        a reference to this command builder, never null
      • disableDistributionSupport

        public RuntimeExecutionCommandBuilder disableDistributionSupport​(boolean force)
        Add disable distribution configuration support option.
        Parameters:
        force - whether need to disable configuration support even if changing the configuration is not allowed
        Returns:
        a reference to this command builder, never null
      • agentMode

        public RuntimeExecutionCommandBuilder agentMode​(Path baseLocation)
        Add SSH agent start mode option.
        Parameters:
        baseLocation - the base directory for the SFTP server and for the dump and restore configuration commands, cannot be null
        Returns:
        a reference to this command builder, never null
      • agentPort

        public RuntimeExecutionCommandBuilder agentPort​(int port)
        Add SSH agent port option.
        Parameters:
        port - the port to run agent on
        Returns:
        a reference to this command builder, never null
      • logTo

        public RuntimeExecutionCommandBuilder logTo​(File logFile,
                                                    boolean clear)
        Add logging 1C:Enterprise runtime process execution to given file option to constructing command.
        Parameters:
        logFile - log file to write log to, cannot be null
        clear - whether need to clear log file before startup
        Returns:
        a reference to this command builder, never null
      • start

        public Process start()
                      throws IOException
        Starts runtime process, based on constructed commands.

        Shortcut to commandBuilder.toProcessBuilder().start();

        Returns:
        started process instance, never null
        Throws:
        IOException - if an I/O error occurs during process start
      • toProcessBuilder

        public ProcessBuilder toProcessBuilder()
        Returns process builder, based on constructed commands.
        Returns:
        process builder, based on constructed commands, never null