public interface IEnvManager
All contributions to the "org.eclipse.ptp.ems.core.envmanager" extension point must implement this interface.
Modifier and Type | Field and Description |
---|---|
static String |
ENV_MANAGER_EXTENSION_POINT_ID
ID for the envmanager extension point
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkForCompatibleInstallation(IProgressMonitor pm)
Returns true iff the remote machine is running an environment management system supported by this
IEnvManager . |
void |
configure(IRemoteConnection remoteConnection)
Sets the
IRemoteConnection which will be used to run commands on a remote machine. |
String |
createBashScript(IProgressMonitor pm,
boolean echo,
IEnvManagerConfig config,
String commandToExecuteAfterward)
Creates a temporary file on the remote machine and writes a Bash shell script into that file which will configure the remote
environment with the given elements, execute the given command, and then delete the temporary file (shell script).
|
List<String> |
determineAvailableElements(IProgressMonitor pm)
Returns the set of all environment configuration elements available on the remote machine (e.g., the result of
module -t avail).
|
List<String> |
determineDefaultElements(IProgressMonitor pm)
Returns the set of all environment configuration elements loaded by default upon login (e.g., the result of
module -t list in a login shell).
|
String |
getBashConcatenation(String separator,
boolean echo,
IEnvManagerConfig config,
String commandToExecuteAfterward)
Returns a single Bash shell command which will configure the remote environment with the given elements and then execute the
given command.
|
Comparator<String> |
getComparator()
Returns a
Comparator used to sort the strings returned by determineAvailableElements(IProgressMonitor) and
determineDefaultElements(IProgressMonitor) when displaying them to the user. |
String |
getDescription(IProgressMonitor pm)
If the remote machine is running an environment management system supported by this
IEnvManager , returns a short
description of the environment management system (e.g., "Modules 3.2.7"); otherwise, returns null . |
String |
getInstructions()
Returns a short sentence that will be displayed to the user to request that items be selected from a checklist.
|
String |
getName()
Returns a human-readable name for this environment management system.
|
static final String ENV_MANAGER_EXTENSION_POINT_ID
String getName()
null
)Comparator<String> getComparator()
Comparator
used to sort the strings returned by determineAvailableElements(IProgressMonitor)
and
determineDefaultElements(IProgressMonitor)
when displaying them to the user.Comparator
(non-null
)String getInstructions()
For example, "Select modules to be loaded."
null
)void configure(IRemoteConnection remoteConnection)
IRemoteConnection
which will be used to run commands on a remote machine.
This method must be invoked before checkForCompatibleInstallation(IProgressMonitor)
,
getDescription(IProgressMonitor)
, determineAvailableElements(IProgressMonitor)
,
determineDefaultElements(IProgressMonitor)
, or
createBashScript(IProgressMonitor, boolean, IEnvManagerConfig, String)
.
remoteConnection
- IRemoteConnection
(non-null
)boolean checkForCompatibleInstallation(IProgressMonitor pm) throws RemoteConnectionException, IOException
IEnvManager
.pm
- progress monitor used to report the status of potentially long-running operations to the user (non-
null
)IEnvManager
NullPointerException
- if configure(IRemoteConnection)
has not been calledRemoteConnectionException
- if an remote connection error occursIOException
- if an input/output error occursString getDescription(IProgressMonitor pm) throws RemoteConnectionException, IOException
IEnvManager
, returns a short
description of the environment management system (e.g., "Modules 3.2.7"); otherwise, returns null
.pm
- progress monitor used to report the status of potentially long-running operations to the user (non-
null
)null
if a compatible environment configuration system is not present on the remote machineNullPointerException
- if configure(IRemoteConnection)
has not been calledRemoteConnectionException
- if an remote connection error occursIOException
- if an input/output error occursList<String> determineAvailableElements(IProgressMonitor pm) throws RemoteConnectionException, IOException
pm
- progress monitor used to report the status of potentially long-running operations to the user (non-
null
)null
)NullPointerException
- if configure(IRemoteConnection)
has not been calledRemoteConnectionException
- if an remote connection error occursIOException
- if an input/output error occursList<String> determineDefaultElements(IProgressMonitor pm) throws RemoteConnectionException, IOException
pm
- progress monitor used to report the status of potentially long-running operations to the user (non-
null
)null
)NullPointerException
- if configure(IRemoteConnection)
has not been calledRemoteConnectionException
- if an remote connection error occursIOException
- if an input/output error occursString getBashConcatenation(String separator, boolean echo, IEnvManagerConfig config, String commandToExecuteAfterward)
The returned command may include sequencing, piping, I/O redirection, etc.; however, it must be possible to concatenate additional Bash commands by appending a semicolon.
separator
- string that will be inserted between consecutive Bash commands: typically, either a semicolon or a newlineecho
- true iff the script should "echo" each command prior to executionconfig
- environment manager configuration (non-null
)commandToExecuteAfterward
- a Bash shell command to execute after the environment has been configurednull
)String createBashScript(IProgressMonitor pm, boolean echo, IEnvManagerConfig config, String commandToExecuteAfterward) throws RemoteConnectionException, IOException
pm
- progress monitor used to report the status of potentially long-running operations to the user (non-
null
)echo
- true iff the script should "echo" each command prior to executionconfig
- environment manager configuration (non-null
)commandToExecuteAfterward
- a Bash shell command to execute after the environment has been configurednull
)RemoteConnectionException
- if an remote connection error occursIOException
- if an input/output error occursCopyright (c) 2011 IBM Corporation and others. All Rights Reserved.