|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.agent.AccessMethod edu.sdsc.inca.agent.access.Ssh
public class Ssh
A class that implements AccessMethod using the SSH protocol for transferring files and running processes on remote resources. Important note: stop() does not kill the remote process currently
Field Summary | |
---|---|
static int |
CHECK_PERIOD
|
static java.lang.String[] |
SSH_IDENTITY_FILENAMES
|
Constructor Summary | |
---|---|
Ssh(java.lang.String resource,
edu.sdsc.inca.util.ResourcesWrapper resources)
Create a new remote process controlling it via SSH. |
Method Summary | |
---|---|
void |
get(java.lang.String[] remoteFiles,
java.lang.String localDir)
Transfer a list of remote files to a directory on the local machine using SSH. |
boolean |
isActive()
Checks to see if the current ssh session is active. |
java.lang.String |
prependHome(java.lang.String path)
Given a path relative to the home directory, prepend the home directory to the path and return the new string. |
void |
put(java.lang.String[] localFiles,
java.lang.String remoteDir)
Transfer a list of local files to a directory on a remote machine using SSH. |
AccessMethodOutput |
run(java.lang.String executable,
java.lang.String[] arguments,
java.lang.String stdin,
java.lang.String directory)
Execute the specified process on the remote resource. |
void |
start(java.lang.String executable,
java.lang.String[] arguments,
java.lang.String stdin,
java.lang.String directory)
Start a process on a remote machine. |
void |
stop()
This call should kill the remote process that was started by the start() call. |
Methods inherited from class edu.sdsc.inca.agent.AccessMethod |
---|
create, get, put, run, run, start, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CHECK_PERIOD
public static final java.lang.String[] SSH_IDENTITY_FILENAMES
Constructor Detail |
---|
public Ssh(java.lang.String resource, edu.sdsc.inca.util.ResourcesWrapper resources) throws edu.sdsc.inca.ConfigurationException
resource
- The name of the resource to start the process onresources
- The resource configuration information.
edu.sdsc.inca.ConfigurationException
- if problem configuring ssh connectionMethod Detail |
---|
public void get(java.lang.String[] remoteFiles, java.lang.String localDir) throws AccessMethodException
get
in class AccessMethod
remoteFiles
- List of paths to remote files that will be transferedlocalDir
- Path to the directory on the local machine where
the remote files will be placed
AccessMethodException
public boolean isActive() throws AccessMethodException
isActive
in class AccessMethod
AccessMethodException
- if unable to determine if process is activepublic java.lang.String prependHome(java.lang.String path)
prependHome
in class AccessMethod
path
- A path relative to the user's home directory
public AccessMethodOutput run(java.lang.String executable, java.lang.String[] arguments, java.lang.String stdin, java.lang.String directory) throws AccessMethodException, java.lang.InterruptedException
run
in class AccessMethod
executable
- Path to the remote executable.arguments
- Contains the arguments that should be passed to the
executablestdin
- A string that will be passedd in as stdin to the process
when it is starteddirectory
- Path to the directory where the process will be executed
from
AccessMethodException
- if unable to execute remote process
java.lang.InterruptedException
- if interrupted while running remote processpublic void start(java.lang.String executable, java.lang.String[] arguments, java.lang.String stdin, java.lang.String directory) throws AccessMethodException
start
in class AccessMethod
executable
- Path to the remote executable.arguments
- Contains the arguments that should be passed to the
executabledirectory
- Path to the directory where the process will be executedstdin
- A string that will be passedd in as stdin to the process
when it is started
AccessMethodException
public void stop() throws AccessMethodException
stop
in class AccessMethod
AccessMethodException
public void put(java.lang.String[] localFiles, java.lang.String remoteDir) throws AccessMethodException
put
in class AccessMethod
localFiles
- List of paths to local files that will be transferedremoteDir
- Path to the directory on the remote machine where
the local files will be placed
AccessMethodException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |