org.apache.oodt.product.handlers.ofsn
Class OFSNFileHandler

java.lang.Object
  extended by org.apache.oodt.product.handlers.ofsn.OFSNFileHandler
All Implemented Interfaces:
OFSNMetKeys, OFSNXMLConfigMetKeys, OFSNXMLMetKeys, XMLQueryMetKeys, LargeProductQueryHandler, QueryHandler

public class OFSNFileHandler
extends Object
implements LargeProductQueryHandler, XMLQueryMetKeys, OFSNXMLMetKeys, OFSNMetKeys, OFSNXMLConfigMetKeys

An extensible implementation of the PDS-inspired Online File Specification Name (OFSN) style product server. See the ofsn-ps.xml file for a detailed specification of the configuration and motivation behind this product handler.

Version:
$Revision$
Author:
mattmann

Field Summary
 
Fields inherited from interface org.apache.oodt.product.handlers.ofsn.metadata.XMLQueryMetKeys
OFSN, RETURN_TYPE
 
Fields inherited from interface org.apache.oodt.product.handlers.ofsn.metadata.OFSNXMLMetKeys
DIR_ENTRY_TAG, DIR_LISTING_NS, DIR_RESULT_TAG, FILE_SIZE_TAG, OFSN_TAG, XML_MIME_TYPE
 
Fields inherited from interface org.apache.oodt.product.handlers.ofsn.metadata.OFSNMetKeys
GET_CMD, LISTING_CMD, OFSN_COMPUTE_DIR_SIZE, OFSN_COMPUTE_FILE_SIZE, OFSN_XML_CONF_FILE_KEY
 
Fields inherited from interface org.apache.oodt.product.handlers.ofsn.metadata.OFSNXMLConfigMetKeys
HANDLER_CLASSNAME_ATTR, HANDLER_NAME_ATTR, HANDLER_TAG, HANDLER_TYPE_ATTR, OFSN_CFG_ID_ATTR, OFSN_CFG_NAME_ATTR, OFSN_PRODUCT_ROOT_ATTR, PROPERTY_MIMETYPE_ATTR, PROPERTY_NAME_ATTR, PROPERTY_TAG, PROPERTY_VALUE_ATTR
 
Constructor Summary
OFSNFileHandler()
           
 
Method Summary
 void close(String id)
          Close off a product.
 XMLQuery query(XMLQuery xmlQuery)
          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

OFSNFileHandler

public OFSNFileHandler()
                throws InstantiationException
Throws:
InstantiationException
Method Detail

query

public XMLQuery query(XMLQuery xmlQuery)
               throws ProductException
Description copied from interface: QueryHandler
Run a query.

Specified by:
query in interface QueryHandler
Parameters:
xmlQuery - The query.
Returns:
The response.
Throws:
ProductException - if an error occurs.

close

public void close(String id)
           throws ProductException
Description copied from interface: LargeProductQueryHandler
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 LargeProductQueryHandler
Parameters:
id - Product ID.
Throws:
ProductException - if an error occurs.

retrieveChunk

public byte[] retrieveChunk(String id,
                            long offset,
                            int length)
                     throws ProductException
Description copied from interface: LargeProductQueryHandler
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 LargeProductQueryHandler
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.


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