org.tranche.remote
Class GetHashesCallback

java.lang.Object
  extended by org.tranche.commons.Debuggable
      extended by org.tranche.remote.RemoteCallback
          extended by org.tranche.remote.GetHashesCallback

public class GetHashesCallback
extends RemoteCallback

Represents a hash array server request.

Author:
Jayson Falkner - jfalkner@umich.edu, James "Augie" Hill - augman85@gmail.com

Field Summary
static java.lang.String NAME
           
 
Fields inherited from class org.tranche.remote.RemoteCallback
NOT_COMPLETED
 
Constructor Summary
GetHashesCallback(long id, RemoteTrancheServer rts, java.lang.String description)
           
 
Method Summary
 void callback(byte[] bs)
          Sets the response from the server.
 BigHash[] getHashes()
          Returns the server response.
static void writeResponse(BigHash[] hashes, java.io.OutputStream out)
           
 
Methods inherited from class org.tranche.remote.RemoteCallback
getCachedException, getDescription, getID, getName, getPurgeMsg, getRemoteTrancheServer, getTimeCompleted, getTimeStarted, isComplete, isPurged, keepAlive, notifyTimedOut, notifyWaiting, purge, setCachedException, waitForCallback
 
Methods inherited from class org.tranche.commons.Debuggable
debugErr, debugErr, debugOut, isDebug, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

GetHashesCallback

public GetHashesCallback(long id,
                         RemoteTrancheServer rts,
                         java.lang.String description)
Parameters:
rts - the remote tranche server received
id - Unique Identification for the Callback
Throws:
java.lang.InterruptedException - if an interrupted exception occurs
Method Detail

getHashes

public BigHash[] getHashes()
                    throws java.lang.Exception

Returns the server response.

Returns:
Throws:
java.lang.Exception

callback

public void callback(byte[] bs)

Sets the response from the server.

Specified by:
callback in class RemoteCallback
Parameters:
bs -

writeResponse

public static void writeResponse(BigHash[] hashes,
                                 java.io.OutputStream out)
                          throws java.lang.Exception
Parameters:
hashes -
out -
Throws:
java.lang.Exception


This code is free for use both commercially and non-commercially as stated in the project's license