|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.gridmachine.useragent.UserAgentClient
public class UserAgentClient
Concrete implementation of the GumClient
interface that
provides methods for remote execution, file transfer and information
retrieval like remote file information.
It is the representation of a Gum
in the broker side. It will
use the methods of Gum
to provide services to the broker users
Field Summary | |
---|---|
protected java.nio.channels.FileChannel |
channel
Lock-related objects. |
protected java.util.Map<ExecutorHandle,ExecutorHandle> |
executorHandles
Map containing all the executor handles of the remote executions on this UserAgent. |
static java.lang.String |
FLAG_COMMAND
This constant is the flag used in the REM_EXEC spec field to indicate the command must be executed at the Gum. |
static java.lang.String |
FLAG_MACHINE
This constant is the flag used in the REM_EXEC spec field to indicate which Gum must execute the command. |
java.nio.channels.FileLock |
localFileLock
This object represents the lock for a given file. |
java.io.FileInputStream |
localFileStream
The FileInputStream used to read a local file that will be transfered to the grid machine. |
protected java.lang.String |
playpenPath
The string representation for the playpen used in a given execution. |
java.io.RandomAccessFile |
randomFile
This abstract representation for a Random Access file is used to obtain a exclusive lock during file transfer operations. |
protected Gum |
ua
A reference to the grid machine. |
Constructor Summary | |
---|---|
UserAgentClient(Gum gum,
GumSpec gumSpec)
Default constructor. |
Method Summary | |
---|---|
java.lang.String |
createPlaypen(int size)
|
java.lang.String |
createStorageDirectory()
|
boolean |
equals(java.lang.Object o)
|
boolean |
fileExists(java.io.File file)
|
void |
getFile(java.lang.String remoteFile,
java.lang.String localFile)
|
GumSpec |
getGumSpec()
Retrieves the gum specification cached on the client side |
long |
getRemoteFileLastModification(java.io.File remoteFile,
boolean normalized)
|
long |
getRemoteFileLength(java.io.File file)
|
ExecutorResult |
getResult(ExecutorHandle handle)
|
GumStatus |
getStatus()
|
java.lang.String |
getStorageDirectory()
|
Gum |
getUAServer()
|
void |
putFile(java.lang.String localFile,
java.lang.String remoteFile)
|
ExecutorHandle |
remoteExecute(java.lang.String remoteDir,
java.lang.String command,
java.util.Map<java.lang.String,java.lang.String> environmentVars)
|
void |
startReplica()
|
void |
stopReplica()
|
void |
storeFile(java.lang.String localFilePath,
java.lang.String remoteFilePath)
This method stores a local file into the remote storage location. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FLAG_COMMAND
public static final java.lang.String FLAG_MACHINE
public transient java.io.FileInputStream localFileStream
protected transient java.nio.channels.FileChannel channel
protected Gum ua
protected java.util.Map<ExecutorHandle,ExecutorHandle> executorHandles
public transient java.io.RandomAccessFile randomFile
public transient java.nio.channels.FileLock localFileLock
protected java.lang.String playpenPath
Constructor Detail |
---|
public UserAgentClient(Gum gum, GumSpec gumSpec)
gum
- a remote reference the the grid machinegumSpec
- information about the gum featuresMethod Detail |
---|
public void storeFile(java.lang.String localFilePath, java.lang.String remoteFilePath) throws UnableToExecuteException, UnavailableGumException, FileTransferException
GumClient
storeFile
in interface GumClient
localFilePath
- A string representing the local file path.remoteFilePath
- A string representing the remote file path.
UnavailableGumException
- if the requested GM is not available.
FileTransferException
- if some transfer problems happen.
UnableToExecuteException
public boolean fileExists(java.io.File file) throws UnavailableGumException
fileExists
in interface GumClient
UnavailableGumException
- Occurs if the requested processor is not
available.Gum.fileExists(java.io.File)
public long getRemoteFileLength(java.io.File file) throws UnavailableGumException, UnableToExecuteException
getRemoteFileLength
in interface GumClient
UnavailableGumException
- if the requested GM is not available.
UnableToExecuteException
- Occurs if some operation could not be
performed in order to get the remote file length.Gum.getRemoteFileLength(java.io.File)
public long getRemoteFileLastModification(java.io.File remoteFile, boolean normalized) throws UnavailableGumException, UnableToExecuteException
getRemoteFileLastModification
in interface GumClient
UnavailableGumException
- if the requested GM is not available.
UnableToExecuteException
- Occurs if some operation could not be
performed in order to get the remote file length.(java.io.File, boolean)
public java.lang.String createPlaypen(int size) throws UnavailableGumException, UnableToCreatePlaypenException
createPlaypen
in interface GumClient
UnavailableGumException
- if the requested GM is not available.
UnableToCreatePlaypenException
Gum.createPlaypen(int)
public Gum getUAServer() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String createStorageDirectory() throws UnavailableGumException, UnableToCreateStorageException
createStorageDirectory
in interface GumClient
UnavailableGumException
- if the requested GM is not available.
UnableToCreateStorageException
- if the creation of the directory
was not possible due to permission denied, disk space is full,
etc.Gum.createStorageDirectory()
public java.lang.String getStorageDirectory() throws UnavailableGumException
getStorageDirectory
in interface GumClient
UnavailableGumException
- if the requested GM is not available.Gum.getStorageDirectory()
public ExecutorHandle remoteExecute(java.lang.String remoteDir, java.lang.String command, java.util.Map<java.lang.String,java.lang.String> environmentVars) throws UnavailableGumException, UnableToExecuteException
remoteExecute
in interface GumClient
UnavailableGumException
- Throws if the contact with the remote
machine is lost.
UnableToExecuteException
- Throws if cannot execute the command on
the machine. For example, if the command does not exist or the
machine already is executing a remote task command.Gum.remoteExecute(java.lang.String,
java.lang.String, java.util.Map)
public void putFile(java.lang.String localFile, java.lang.String remoteFile) throws UnavailableGumException, FileTransferException
putFile
in interface GumClient
FileTransferException
- Throws if can not transfer the file.
UnavailableGumException
Gum.putFile(String, byte[], boolean)
public void getFile(java.lang.String remoteFile, java.lang.String localFile) throws UnavailableGumException, FileTransferException
getFile
in interface GumClient
FileTransferException
- if the file cannot be transfered.
UnavailableGumException
Gum.getFile(String, long, int)
public ExecutorResult getResult(ExecutorHandle handle) throws UnavailableGumException, UnableToExecuteException
getResult
in interface GumClient
UnavailableGumException
UnableToExecuteException
Gum.getResult(org.ourgrid.common.executor.ExecutorHandle)
public GumStatus getStatus()
getStatus
in interface GumClient
Gum.getStatus()
public void startReplica() throws UnavailableGumException
startReplica
in interface GumClient
UnavailableGumException
- If the contact with grid machine is lost.Gum.startReplica()
public void stopReplica() throws UnavailableGumException
stopReplica
in interface GumClient
UnavailableGumException
- If the contact with grid machine is lost.Gum.stopReplica()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public GumSpec getGumSpec()
GumClient
getGumSpec
in interface GumClient
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |