compbio.engine
Class FilePuller

java.lang.Object
  extended by compbio.engine.FilePuller
All Implemented Interfaces:
Comparable<Delayed>, Delayed

public class FilePuller
extends Object
implements Delayed


Method Summary
 int compareTo(Delayed o)
           
 void disconnect()
           
 boolean equals(Object obj)
           
 long getDelay(TimeUnit unit)
           
 String getFile()
           
 byte getProgress()
           
 int hashCode()
           
 boolean hasMoreData()
           
 void initPull()
           
 boolean isFileCreated()
           
static FilePuller newFilePuller(String file, int chunkSize)
           
static FilePuller newProgressPuller(String file)
          Progress Puller is designed to read 3 characters from the beginning of the file, nothing more.
 ChunkHolder pull(long position)
           
 String toString()
           
 void waitForFile(long maxWaitSeconds)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newFilePuller

public static FilePuller newFilePuller(String file,
                                       int chunkSize)

newProgressPuller

public static FilePuller newProgressPuller(String file)
Progress Puller is designed to read 3 characters from the beginning of the file, nothing more. Intended to be used in conjunction with a tool which output progress as a percent value from 0 to 100. In any cases progress could not be more than the largest byte value 255.

Parameters:
file -
Returns:
instance

pull

public ChunkHolder pull(long position)
                 throws IOException
Throws:
IOException

initPull

public void initPull()

getFile

public String getFile()

isFileCreated

public boolean isFileCreated()

waitForFile

public void waitForFile(long maxWaitSeconds)

hasMoreData

public boolean hasMoreData()
                    throws IOException
Throws:
IOException

compareTo

public int compareTo(Delayed o)
Specified by:
compareTo in interface Comparable<Delayed>

getDelay

public long getDelay(TimeUnit unit)
Specified by:
getDelay in interface Delayed

disconnect

public void disconnect()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getProgress

public byte getProgress()
                 throws IOException
Throws:
IOException