org.apache.oodt.product
Interface LargeProductQueryHandler

All Superinterfaces:
QueryHandler
All Known Implementing Classes:
OFSNFileHandler

public interface LargeProductQueryHandler
extends QueryHandler

Handle requests for products that are too large to fit in an XMLQuery object.

Version:
$Revision: 1.1.1.1 $
Author:
Kelly

Method Summary
 void close(String id)
          Close off a product.
 byte[] retrieveChunk(String id, long offset, int length)
          Retrieve a chunk of a product.
 
Methods inherited from interface org.apache.oodt.product.QueryHandler
query
 

Method Detail

retrieveChunk

byte[] retrieveChunk(String id,
                     long offset,
                     int length)
                     throws ProductException
Retrieve a chunk of a product. The product is identified by a string ID. The query handler should return a binary chunk of the product using the given offset and length. If the ID isn't recognized, it should return null. It should throw an exception if retrieval fails for some reason.

Parameters:
id - Product ID.
offset - Where in the product to get a chunk of it.
length - How much of the product to get.
Returns:
A chunk, or null if the id is unknown.
Throws:
ProductException - if an error occurs.

close

void close(String id)
           throws ProductException
Close off a product. This method indicates that the product is no longer required and its resources can be freed by the query handler. If the ID is unknown, no untoward action is required. It should throw an exception if there is an error during the resource release (such as an IOException when closing a file.

Parameters:
id - Product ID.
Throws:
ProductException - if an error occurs.


Copyright © 1999-2013 Apache OODT. All Rights Reserved.