org.ourgrid.peer.ebgum
Class FakeEBGum

java.lang.Object
  extended by org.ourgrid.peer.ebgum.FakeEBGum
All Implemented Interfaces:
EBGum

public class FakeEBGum
extends java.lang.Object
implements EBGum

A fake EBGridMachine used only for tests


Constructor Summary
FakeEBGum(GumSpec gumSpec)
           
 
Method Summary
 void changeFilePermissions(EventQueue<ResponseEvent> responseQueue, java.io.File file, int permissions)
           
 void createPlaypen(EventQueue<ResponseEvent> responseQueue, int size)
           
 void createStorageDirectory(EventQueue<ResponseEvent> responseQueue)
           
 boolean equals(java.lang.Object o)
           
 void fileExists(EventQueue<ResponseEvent> responseQueue, java.io.File file)
           
 void getFile(EventQueue<ResponseEvent> responseQueue, java.lang.String filePath, long filePos, int size)
           
 GumSpec getGumSpec()
          Retrieves the GumSpec cached in the peer
 GumID getID()
          Retrieves the gum identification cached in the peer
 void getRemoteFileDigest(EventQueue<ResponseEvent> responseQueue, java.io.File remoteFile)
           
 void getRemoteFileLastModification(EventQueue<ResponseEvent> responseQueue, java.io.File remoteFile, boolean normalized)
           
 void getRemoteFileLength(EventQueue<ResponseEvent> responseQueue, java.io.File file)
           
 void getResult(EventQueue<ResponseEvent> responseQueue, ExecutorHandle handle)
           
 void getStatus(EventQueue<ResponseEvent> responseQueue)
           
 void getStorageDirectory(EventQueue<ResponseEvent> responseQueue)
           
 void putFile(EventQueue<ResponseEvent> responseQueue, java.lang.String remoteFile, byte[] data, boolean firstSlice)
           
 void remoteExecute(EventQueue<ResponseEvent> responseQueue, java.lang.String remoteDir, java.lang.String command, java.util.Map<java.lang.String,java.lang.String> environmentVars)
           
 void start()
          Start the event processor
 void startReplica(EventQueue<ResponseEvent> responseQueue)
           
 EventQueue<ShutdownResponseEvent> stop()
          Must be implemented by the facade to stop event processing
 void stopReplica(EventQueue<ResponseEvent> responseQueue)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeEBGum

public FakeEBGum(GumSpec gumSpec)
Method Detail

getID

public GumID getID()
Description copied from interface: EBGum
Retrieves the gum identification cached in the peer

Specified by:
getID in interface EBGum
Returns:
the gum identification cached in the peer
See Also:
EBGum.getID()

getGumSpec

public GumSpec getGumSpec()
Description copied from interface: EBGum
Retrieves the GumSpec cached in the peer

Specified by:
getGumSpec in interface EBGum
Returns:
the GumSpec cached in the peer
See Also:
EBGum.getGumSpec()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

changeFilePermissions

public void changeFilePermissions(EventQueue<ResponseEvent> responseQueue,
                                  java.io.File file,
                                  int permissions)
Specified by:
changeFilePermissions in interface EBGum
See Also:
Gum.changeFilePermissions(java.io.File, int)

createPlaypen

public void createPlaypen(EventQueue<ResponseEvent> responseQueue,
                          int size)
Specified by:
createPlaypen in interface EBGum
See Also:
Gum.createPlaypen(int)

createStorageDirectory

public void createStorageDirectory(EventQueue<ResponseEvent> responseQueue)
Specified by:
createStorageDirectory in interface EBGum
See Also:
Gum.createStorageDirectory()

fileExists

public void fileExists(EventQueue<ResponseEvent> responseQueue,
                       java.io.File file)
Specified by:
fileExists in interface EBGum
See Also:
Gum.fileExists(java.io.File)

getFile

public void getFile(EventQueue<ResponseEvent> responseQueue,
                    java.lang.String filePath,
                    long filePos,
                    int size)
Specified by:
getFile in interface EBGum
See Also:
Gum.getFile(String, long, int)

getRemoteFileDigest

public void getRemoteFileDigest(EventQueue<ResponseEvent> responseQueue,
                                java.io.File remoteFile)
Specified by:
getRemoteFileDigest in interface EBGum
See Also:
Gum.getRemoteFileDigest(File)

getRemoteFileLastModification

public void getRemoteFileLastModification(EventQueue<ResponseEvent> responseQueue,
                                          java.io.File remoteFile,
                                          boolean normalized)
Specified by:
getRemoteFileLastModification in interface EBGum
See Also:
(java.io.File, boolean)

getRemoteFileLength

public void getRemoteFileLength(EventQueue<ResponseEvent> responseQueue,
                                java.io.File file)
Specified by:
getRemoteFileLength in interface EBGum
See Also:
Gum.getRemoteFileLength(java.io.File)

getResult

public void getResult(EventQueue<ResponseEvent> responseQueue,
                      ExecutorHandle handle)
Specified by:
getResult in interface EBGum
See Also:
(org.ourgrid.common.executor.ExecutorHandle)

getStatus

public void getStatus(EventQueue<ResponseEvent> responseQueue)
Specified by:
getStatus in interface EBGum
See Also:
Gum.getStatus()

getStorageDirectory

public void getStorageDirectory(EventQueue<ResponseEvent> responseQueue)
Specified by:
getStorageDirectory in interface EBGum
See Also:
Gum.getStorageDirectory()

putFile

public void putFile(EventQueue<ResponseEvent> responseQueue,
                    java.lang.String remoteFile,
                    byte[] data,
                    boolean firstSlice)
Specified by:
putFile in interface EBGum
See Also:
Gum.putFile(String, byte[], boolean)

remoteExecute

public void remoteExecute(EventQueue<ResponseEvent> responseQueue,
                          java.lang.String remoteDir,
                          java.lang.String command,
                          java.util.Map<java.lang.String,java.lang.String> environmentVars)
Specified by:
remoteExecute in interface EBGum
See Also:
Gum.remoteExecute(java.lang.String, java.lang.String, java.util.Map)

startReplica

public void startReplica(EventQueue<ResponseEvent> responseQueue)
Specified by:
startReplica in interface EBGum
See Also:
Gum.startReplica()

stopReplica

public void stopReplica(EventQueue<ResponseEvent> responseQueue)
Specified by:
stopReplica in interface EBGum
See Also:
Gum.stopReplica()

stop

public EventQueue<ShutdownResponseEvent> stop()
Description copied from interface: EBGum
Must be implemented by the facade to stop event processing

Specified by:
stop in interface EBGum

start

public void start()
Description copied from interface: EBGum
Start the event processor

Specified by:
start in interface EBGum