Class AbstractRuntimeInstallationLookup
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.runtimes.AbstractRuntimeInstallationLookup
-
- All Implemented Interfaces:
IRuntimeInstallationLookup
- Direct Known Subclasses:
StandardLinuxLocationsRuntimeLookup
,StandardWin32LocationsRuntimeLookup
public abstract class AbstractRuntimeInstallationLookup extends Object implements IRuntimeInstallationLookup
Abstract implementation ofIRuntimeInstallationLookup
.
-
-
Constructor Summary
Constructors Constructor Description AbstractRuntimeInstallationLookup()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection<Path>
getDefaultLocations(IRuntimeInstallationDiscriminator discriminator)
Returns a collection of the default locations for the 1C:Enterprise runtime installations.protected Collection<Path>
getNestedLocations(IRuntimeInstallationDiscriminator discriminator, Path directory)
Returns all nested locations of the target folder.protected boolean
isTraining(RuntimeInstallation installation)
Returns whether the provided 1C:Enterprise runtime installation represents training runtime platform.Collection<RuntimeInstallation>
lookup(IRuntimeInstallationNameGenerator nameGenerator, IRuntimeInstallationDiscriminator discriminator, Collection<String> existingNames, org.eclipse.core.runtime.IProgressMonitor monitor)
Searches for local installations of 1C:Enterprise runtime in default locations.Collection<RuntimeInstallation>
lookup(Path directory, IRuntimeInstallationNameGenerator nameGenerator, IRuntimeInstallationDiscriminator discriminator, Collection<String> existingNames, org.eclipse.core.runtime.IProgressMonitor monitor)
Searches for local installations of 1C:Enterprise runtime in the target directory and all its sub-directories.protected Collection<RuntimeInstallation>
lookup(Collection<Path> directories, IRuntimeInstallationNameGenerator nameGenerator, IRuntimeInstallationDiscriminator discriminator, Collection<String> existingNames, org.eclipse.core.runtime.IProgressMonitor monitor)
Searches for local installations of 1C:Enterprise runtime in a plain collection of directories.protected Optional<RuntimeInstallation>
resolveInstallation(Path location, IRuntimeInstallationNameGenerator nameGenerator, IRuntimeInstallationDiscriminator discriminator, Collection<String> existingNames)
Resolves the candidate location to the 1C:Enterprise runtime installation.
-
-
-
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 interfaceIRuntimeInstallationLookup
- Parameters:
nameGenerator
- the name generator for found 1C:Enterprise runtime installations, cannot benull
discriminator
- the discriminator for found 1C:Enterprise runtime installations, cannot benull
existingNames
- a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot benull
monitor
- the progress monitor to report progress to and check cancellation status, cannot benull
- 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 interfaceIRuntimeInstallationLookup
- Parameters:
directory
- the target directory to search 1C:Enterprise runtime installations in, cannot benull
nameGenerator
- the name generator for found 1C:Enterprise runtime installations, cannot benull
discriminator
- the discriminator for found 1C:Enterprise runtime installations, cannot benull
existingNames
- a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot benull
monitor
- the progress monitor to report progress to and check cancellation status, cannot benull
- 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 benull
nameGenerator
- the name generator for found 1C:Enterprise runtime installations, cannot benull
discriminator
- the discriminator for found 1C:Enterprise runtime installations, cannot benull
existingNames
- a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot benull
monitor
- the progress monitor to report progress to and check cancellation status, cannot benull
- 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 benull
nameGenerator
- the name generator for found 1C:Enterprise runtime installations, cannot benull
discriminator
- the discriminator for found 1C:Enterprise runtime installations, cannot benull
existingNames
- a collection of already existing 1C:Enterprise runtime installations names, delegate cannot create 1C:Enterprise runtime installation with any of these names, cannot benull
- 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 benull
- 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 benull
directory
- the parent folder to search all subdirectories in, cannot benull
- 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 benull
- 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
-
-