|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.agent.AccessMethod
public abstract class AccessMethod
An abstract class used to represent methods for transferring files and running processes on resources. Supported methods include Globus, Local (exec), Manual, and SSH currently. The classes that implement each of these methods exist in the 'access' directory.
Constructor Summary | |
---|---|
AccessMethod()
|
Method Summary | |
---|---|
static AccessMethod |
create(java.lang.String resource,
edu.sdsc.inca.util.ResourcesWrapper resources,
java.lang.String temp)
Scan the resource configuration specified in resources and use the remoteInvocationMethod value for the resource to create the appropriate subclass of AccessMethod. |
void |
get(java.lang.String[] remoteFiles,
java.lang.String localDirPath)
Transfer a list of remote files to a directory on the local machine. |
void |
get(java.lang.String remoteFile,
java.lang.String localDirPath)
Transfer a file from a remote machine to a local directory. |
abstract boolean |
isActive()
Checks to see if the process started by start() is active. |
java.lang.String |
prependHome(java.lang.String path)
Given a path relative to the home directory, prepend the home signifier for the given access method to the path and return the new string. |
void |
put(java.lang.String[] localFiles,
java.lang.String remoteDirPath)
Transfer a list of files to a directory on a remote machine. |
void |
put(java.lang.String localFile,
java.lang.String remoteDirPath)
Transfer a file to a directory on a remote machine. |
AccessMethodOutput |
run(java.lang.String executable,
java.lang.String[] arguments)
Run a process on a remote machine. |
AccessMethodOutput |
run(java.lang.String executable,
java.lang.String[] arguments,
java.lang.String stdin)
Run a process on a remote machine. |
abstract 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)
Start a process on a remote machine. |
void |
start(java.lang.String executable,
java.lang.String[] arguments,
java.lang.String stdin)
Start a process on a remote machine. |
abstract void |
start(java.lang.String executable,
java.lang.String[] arguments,
java.lang.String in,
java.lang.String directory)
Start a process on a remote machine. |
abstract void |
stop()
Stop the currently running process started by start(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccessMethod()
Method Detail |
---|
public static AccessMethod create(java.lang.String resource, edu.sdsc.inca.util.ResourcesWrapper resources, java.lang.String temp) throws edu.sdsc.inca.ConfigurationException
resource
- The name of the resource to start the process onresources
- The resource configuration informationtemp
- Path to a directory for temporary files to be stored
edu.sdsc.inca.ConfigurationException
- unknown access method specifiedpublic void get(java.lang.String remoteFile, java.lang.String localDirPath) throws AccessMethodException
remoteFile
- contains a path to the file on the remote file systemlocalDirPath
- contains a path to a directory/file on the local
machine
AccessMethodException
- if unable to fetch remote filepublic void get(java.lang.String[] remoteFiles, java.lang.String localDirPath) throws AccessMethodException
remoteFiles
- list of paths to files on the remote file systemlocalDirPath
- contains a path to a directory/file on the local
machine
AccessMethodException
- if unable to fetch remote filepublic abstract boolean isActive() throws AccessMethodException
AccessMethodException
- if unable to determine if process is activepublic java.lang.String prependHome(java.lang.String path)
path
- A path relative to the user's home directory
public void put(java.lang.String localFile, java.lang.String remoteDirPath) throws AccessMethodException
localFile
- contains a path to the file on the local file systemremoteDirPath
- contains a path to a directory/file on a remote
machine
AccessMethodException
- if unable to transfer remote filepublic void put(java.lang.String[] localFiles, java.lang.String remoteDirPath) throws AccessMethodException
localFiles
- list of paths to files on the local file systemremoteDirPath
- contains a path to a directory/file on a remote
machine
AccessMethodException
- if unable to transfer remote filepublic AccessMethodOutput run(java.lang.String executable, java.lang.String[] arguments) throws AccessMethodException, java.lang.InterruptedException
executable
- Path to the remote executable.arguments
- Contains the arguments that should be passed to the
executable
AccessMethodException
- if unable to execute remote process
java.lang.InterruptedException
- if interrupted while running remote processpublic AccessMethodOutput run(java.lang.String executable, java.lang.String[] arguments, java.lang.String stdin) throws AccessMethodException, java.lang.InterruptedException
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 started
AccessMethodException
- if unable to execute remote process
java.lang.InterruptedException
- if interrupted while running remote processpublic abstract AccessMethodOutput run(java.lang.String executable, java.lang.String[] arguments, java.lang.String stdin, java.lang.String directory) throws AccessMethodException, java.lang.InterruptedException
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) throws AccessMethodException
executable
- Path to the remote executable.arguments
- Contains the arguments that should be passed to the
executable
AccessMethodException
- if unable to start remote processpublic void start(java.lang.String executable, java.lang.String[] arguments, java.lang.String stdin) throws AccessMethodException
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 started
AccessMethodException
- if unable to start remote processpublic abstract void start(java.lang.String executable, java.lang.String[] arguments, java.lang.String in, java.lang.String directory) throws AccessMethodException
executable
- Path to the remote executable.arguments
- Contains the arguments that should be passed to the
executablein
- 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 start remote processpublic abstract void stop() throws AccessMethodException
AccessMethodException
- if unable to stop remote process
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |