gov.nasa.pds.transport
Class RegistryProductHandler

java.lang.Object
  extended by gov.nasa.pds.transport.RegistryProductHandler
All Implemented Interfaces:
org.apache.oodt.product.LargeProductQueryHandler, org.apache.oodt.product.QueryHandler

public class RegistryProductHandler
extends Object
implements org.apache.oodt.product.LargeProductQueryHandler

This Apache OODT Product Server handler accepts a query containing one or more Registry Service identifiers, queries the Registry Service for the associated files and returns a package containing those files back to the calling application.

Version:
$Revision: 12131 $
Author:
shardman

Constructor Summary
RegistryProductHandler()
           
 
Method Summary
 void close(String id)
          Close off a product.
 org.apache.oodt.xmlquery.XMLQuery query(org.apache.oodt.xmlquery.XMLQuery q)
          Run a query.
 byte[] retrieveChunk(String id, long offset, int length)
          Retrieve a chunk of a product.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryProductHandler

public RegistryProductHandler()
Method Detail

query

public org.apache.oodt.xmlquery.XMLQuery query(org.apache.oodt.xmlquery.XMLQuery q)
                                        throws org.apache.oodt.product.ProductException
Run a query.

Specified by:
query in interface org.apache.oodt.product.QueryHandler
Parameters:
q - The query.
Returns:
The response.
Throws:
org.apache.oodt.product.ProductException - if an error occurs.

retrieveChunk

public byte[] retrieveChunk(String id,
                            long offset,
                            int length)
                     throws org.apache.oodt.product.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.

Specified by:
retrieveChunk in interface org.apache.oodt.product.LargeProductQueryHandler
Parameters:
id - Identifier of the product in the form of a file specification.
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:
org.apache.oodt.product.ProductException - if an error occurs.

close

public void close(String id)
           throws org.apache.oodt.product.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.

Specified by:
close in interface org.apache.oodt.product.LargeProductQueryHandler
Parameters:
id - Product ID.
Throws:
org.apache.oodt.product.ProductException - if an error occurs.


Copyright © 2010-2013 Planetary Data System. All Rights Reserved.