gov.ornl.csed.csiir.idr.kdd.dataservice.client
Interface DocumentConsumer


public interface DocumentConsumer

The DocumentConsumer interface needs to be implemented by a class wishing to receive document data asynchronously.


Method Summary
 void data(java.lang.String dataSetId, java.lang.String documentId, byte[] data)
          Called with blocks of the byte data for the document.
 void done(java.lang.String dataSetId, java.lang.String documentId)
          Called when all byte data blocks have been received.
 void exception(java.lang.String dataSetId, java.lang.String documentId, java.lang.Exception exception)
          Called if an exception occurs during processing of the request.
 void httpResponseCode(java.lang.String dataSetId, java.lang.String documentId, int code)
          Called with the HTTP response code that results from a document request.
 void mimeType(java.lang.String dataSetId, java.lang.String documentId, java.lang.String type)
          Called with the MIME type for the document data that follows.
 

Method Detail

httpResponseCode

void httpResponseCode(java.lang.String dataSetId,
                      java.lang.String documentId,
                      int code)
Called with the HTTP response code that results from a document request.

Parameters:
dataSetId - the data set ID
documentId - the document ID
code - the HTTP code

mimeType

void mimeType(java.lang.String dataSetId,
              java.lang.String documentId,
              java.lang.String type)
Called with the MIME type for the document data that follows.

Parameters:
dataSetId - the data set ID
documentId - the document ID
type - the MIME type string

data

void data(java.lang.String dataSetId,
          java.lang.String documentId,
          byte[] data)
Called with blocks of the byte data for the document.

Parameters:
dataSetId - the data set ID
documentId - the document ID
data - byte data block of the requested document

exception

void exception(java.lang.String dataSetId,
               java.lang.String documentId,
               java.lang.Exception exception)
Called if an exception occurs during processing of the request.

Parameters:
exception - the exception that occurred

done

void done(java.lang.String dataSetId,
          java.lang.String documentId)
Called when all byte data blocks have been received.

Parameters:
dataSetId - the data set ID
documentId - the document ID