org.ourgrid.common.gum
Interface GumClient

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FakeGumClient, SleeperFakeUserAgentClient, UserAgentClient

public interface GumClient
extends java.io.Serializable

GumClient is an abstraction that represents all entities that will consume Gums being the one who will effectively use the Gum. Doing that, it will have a reference to the last and will execute remote tasks on it after making special treatments useful to the client and providing callback methods.


Field Summary
static long serialVersionUID
          Serial identification of the class.
 
Method Summary
 java.lang.String createPlaypen(int size)
           
 java.lang.String createStorageDirectory()
           
 boolean fileExists(java.io.File file)
           
 void getFile(java.lang.String remoteFilePath, 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()
           
 void putFile(java.lang.String filePath, 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 localFile, java.lang.String remoteFile)
          This method stores a local file into the remote storage location.
 

Field Detail

serialVersionUID

static final long serialVersionUID
Serial identification of the class. It need to be changed only if the class interface is changed.

See Also:
Constant Field Values
Method Detail

remoteExecute

ExecutorHandle remoteExecute(java.lang.String remoteDir,
                             java.lang.String command,
                             java.util.Map<java.lang.String,java.lang.String> environmentVars)
                             throws FailCauseException
Throws:
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.
FailCauseException
See Also:
Gum.remoteExecute(String, String, Map)

putFile

void putFile(java.lang.String filePath,
             java.lang.String remoteFile)
             throws FailCauseException
Throws:
FileTransferException - Throws if can not transfer the file.
FailCauseException
See Also:
Gum.putFile(String, byte[], boolean)

getFile

void getFile(java.lang.String remoteFilePath,
             java.lang.String localFile)
             throws FailCauseException
Throws:
FileTransferException - if the file cannot be transfered.
FailCauseException
See Also:
Gum.getFile(String, long, int)

getResult

ExecutorResult getResult(ExecutorHandle handle)
                         throws FailCauseException
Throws:
FailCauseException
See Also:
Gum.getResult(ExecutorHandle)

storeFile

void storeFile(java.lang.String localFile,
               java.lang.String remoteFile)
               throws FailCauseException
This method stores a local file into the remote storage location. In general that location is the ".mgstorage" directory in a shared file system at the remote site.

Parameters:
localFile - A string representing the local file path.
remoteFile - A string representing the remote file path.
Throws:
UnavailableGumException - if the requested GM is not available.
FileTransferException - if some transfer problems happen.
FailCauseException

fileExists

boolean fileExists(java.io.File file)
                   throws FailCauseException
Throws:
UnavailableGumException - Occurs if the requested processor is not available.
UnableToExecuteException - Occurs if some operation could not be performed in order to verify if the file exists.
FileTransferException - if any file that must be transfered for the execution (in case of transfer a script) fails.
FailCauseException
See Also:
*

getRemoteFileLength

long getRemoteFileLength(java.io.File file)
                         throws FailCauseException
Throws:
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.
FileTransferException - if some transfer problems happen.
FailCauseException
See Also:
Gum.getRemoteFileLength(File)

getRemoteFileLastModification

long getRemoteFileLastModification(java.io.File remoteFile,
                                   boolean normalized)
                                   throws FailCauseException
Throws:
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.
FailCauseException
See Also:
Gum.getRemoteFileLastModification(File, boolean)

createPlaypen

java.lang.String createPlaypen(int size)
                               throws FailCauseException
Throws:
UnavailableGumException - if the requested GM is not available.
UnableToExecuteException - Occurs if some operation could not be performed in order to create playpen directory.
FileTransferException - if some transfer problems happen.
FailCauseException
See Also:
Gum.createPlaypen(int)

createStorageDirectory

java.lang.String createStorageDirectory()
                                        throws FailCauseException
Throws:
UnavailableGumException - if the requested GM is not available.
UnableToExecuteException - Occurs if some operation could not be performed in order to create the storage directory.
UnableToCreateStorageException - if the creation of the directory was not possible due to permission denied, disk space is full, etc.
FileTransferException - if some transfer problems happen.
FailCauseException
See Also:
Gum.createStorageDirectory()

getStorageDirectory

java.lang.String getStorageDirectory()
                                     throws FailCauseException
Throws:
UnavailableGumException - if the requested GM is not available.
UnableToExecuteException - Occurs if some operation could not be performed in order to get the remote storage directory path.
FileTransferException - if some transfer problems happen.
FailCauseException
See Also:
Gum.getStorageDirectory()

getGumSpec

GumSpec getGumSpec()
Retrieves the gum specification cached on the client side


getStatus

GumStatus getStatus()
See Also:
Gum.getStatus()

startReplica

void startReplica()
                  throws FailCauseException
Throws:
UnavailableGumException - If the contact with grid machine is lost.
FailCauseException
See Also:
Gum.startReplica()

stopReplica

void stopReplica()
                 throws FailCauseException
Throws:
UnavailableGumException - If the contact with grid machine is lost.
FailCauseException
See Also:
Gum.stopReplica()