Class AbstractRuntimeInstallationLookup

    • Constructor Detail

      • AbstractRuntimeInstallationLookup

        public AbstractRuntimeInstallationLookup()
    • Method Detail

      • lookup

        public Collection<RuntimeInstallation> lookup​(IRuntimeInstallationNameGenerator nameGenerator,
                                                      IRuntimeInstallationDiscriminator discriminator,
                                                      Collection<String> existingNames,
                                                      org.eclipse.core.runtime.IProgressMonitor monitor)
                                               throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IRuntimeInstallationLookup
        Searches for local installations of 1C:Enterprise runtime in default locations. Default locations depends on the current OS.

        The name generator can be used to generate unique name for found 1C:Enterprise runtime installations. The discriminator can be used to resolve version of found installation. Version resolving will be based on all registered resolver extensions.

        Note that long running lookup operations can be cancelled by the client, and implementation is intended to check cancellation status of the provided progress monitor.

        Specified by:
        lookup in interface IRuntimeInstallationLookup
        Parameters:
        nameGenerator - the name generator for found 1C:Enterprise runtime installations, cannot be null
        discriminator - the discriminator for found 1C:Enterprise runtime installations, cannot be null
        existingNames - a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot be null
        monitor - the progress monitor to report progress to and check cancellation status, cannot be null
        Returns:
        a list of 1C:Enterprise runtime installations, never null, can be empty, if none installations were found
        Throws:
        org.eclipse.core.runtime.CoreException - if installation lookup fails for some reason
        See Also:
        IRuntimeInstallationNameGenerator, IRuntimeInstallationDiscriminator
      • lookup

        public Collection<RuntimeInstallation> lookup​(Path directory,
                                                      IRuntimeInstallationNameGenerator nameGenerator,
                                                      IRuntimeInstallationDiscriminator discriminator,
                                                      Collection<String> existingNames,
                                                      org.eclipse.core.runtime.IProgressMonitor monitor)
                                               throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IRuntimeInstallationLookup
        Searches for local installations of 1C:Enterprise runtime in the target directory and all its sub-directories.

        The name generator can be used to generate unique name for found 1C:Enterprise runtime installations. The discriminator can be used to resolve version of found installation. Version resolving will be based on all registered resolver extensions.

        Note that long running lookup operations can be cancelled by the client, and implementation is intended to check cancellation status of the provided progress monitor.

        Specified by:
        lookup in interface IRuntimeInstallationLookup
        Parameters:
        directory - the target directory to search 1C:Enterprise runtime installations in, cannot be null
        nameGenerator - the name generator for found 1C:Enterprise runtime installations, cannot be null
        discriminator - the discriminator for found 1C:Enterprise runtime installations, cannot be null
        existingNames - a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot be null
        monitor - the progress monitor to report progress to and check cancellation status, cannot be null
        Returns:
        a list of 1C:Enterprise runtime installations, never null, can be empty, if none installations were found
        Throws:
        org.eclipse.core.runtime.CoreException - if installation lookup fails for some reason
        See Also:
        IRuntimeInstallationNameGenerator, IRuntimeInstallationDiscriminator
      • lookup

        protected Collection<RuntimeInstallation> lookup​(Collection<Path> directories,
                                                         IRuntimeInstallationNameGenerator nameGenerator,
                                                         IRuntimeInstallationDiscriminator discriminator,
                                                         Collection<String> existingNames,
                                                         org.eclipse.core.runtime.IProgressMonitor monitor)
                                                  throws org.eclipse.core.runtime.CoreException
        Searches for local installations of 1C:Enterprise runtime in a plain collection of directories.
        Parameters:
        directories - a plain collection of directories to search in, cannot be null
        nameGenerator - the name generator for found 1C:Enterprise runtime installations, cannot be null
        discriminator - the discriminator for found 1C:Enterprise runtime installations, cannot be null
        existingNames - a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot be null
        monitor - the progress monitor to report progress to and check cancellation status, cannot be null
        Returns:
        a list of 1C:Enterprise runtime installations, never null, can be empty, if none installations were found
        Throws:
        org.eclipse.core.runtime.CoreException - if lookup fails for some reason
      • resolveInstallation

        protected Optional<RuntimeInstallation> resolveInstallation​(Path location,
                                                                    IRuntimeInstallationNameGenerator nameGenerator,
                                                                    IRuntimeInstallationDiscriminator discriminator,
                                                                    Collection<String> existingNames)
                                                             throws org.eclipse.core.runtime.CoreException
        Resolves the candidate location to the 1C:Enterprise runtime installation.
        Parameters:
        location - the candidate to resolve 1C:Enterprise runtime installation in, cannot be null
        nameGenerator - the name generator for found 1C:Enterprise runtime installations, cannot be null
        discriminator - the discriminator for found 1C:Enterprise runtime installations, cannot be null
        existingNames - a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot be null
        Returns:
        the optional resolved 1C:Enterpriser runtime installation
        Throws:
        org.eclipse.core.runtime.CoreException - if resolving fails
      • isTraining

        protected boolean isTraining​(RuntimeInstallation installation)
        Returns whether the provided 1C:Enterprise runtime installation represents training runtime platform.
        Parameters:
        installation - the 1C:Enterprise runtime installation to check, cannot be null
        Returns:
        whether the provided 1C:Enterprise runtime installation represents training runtime platform
      • getNestedLocations

        protected Collection<Path> getNestedLocations​(IRuntimeInstallationDiscriminator discriminator,
                                                      Path directory)
                                               throws org.eclipse.core.runtime.CoreException
        Returns all nested locations of the target folder. Method will collect all subdirectories of the target folder.
        Parameters:
        discriminator - the discriminator for found 1C:Enterprise runtime installations, cannot be null
        directory - the parent folder to search all subdirectories in, cannot be null
        Returns:
        all subdirectories, of the target folder, never null, can be empty
        Throws:
        org.eclipse.core.runtime.CoreException - if get fails
      • getDefaultLocations

        protected abstract Collection<Path> getDefaultLocations​(IRuntimeInstallationDiscriminator discriminator)
                                                         throws org.eclipse.core.runtime.CoreException
        Returns a collection of the default locations for the 1C:Enterprise runtime installations.
        Parameters:
        discriminator - the discriminator for found 1C:Enterprise runtime installations, cannot be null
        Returns:
        a collection of the default locations for the 1C:Enterprise runtime installations, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if default locations get fails