|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjpl.eda.archive.ArchiveProductHandler
This class implements the LargeProductQueryHandler interface
enabling a Product Server to access the Catalog and Archive Service
(CAS).
In order to use this handler the following property must be specified for the Product Server as follows:
This class uses the following property:
The above property may be defined in the Product Server's properties element.
| Constructor Summary | |
ArchiveProductHandler()
|
|
| Method Summary | |
void |
close(java.lang.String id)
Notify the server that a particular file transfer has completed. |
static void |
main(java.lang.String[] argv)
Execute the large product handler. |
jpl.eda.xmlquery.XMLQuery |
query(jpl.eda.xmlquery.XMLQuery xmlQuery)
Query for the result set associated with the given product. |
byte[] |
retrieveChunk(java.lang.String id,
long offset,
int length)
Retrieve a fragment of the data from the specified file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArchiveProductHandler()
| Method Detail |
public jpl.eda.xmlquery.XMLQuery query(jpl.eda.xmlquery.XMLQuery xmlQuery)
throws jpl.eda.product.ProductException
Query for the result set associated with the given product. The result set will consist of each file associated with the product that is locally archived. Files which are stored as remote references are not added to the result set. The query should resemble the following:
The characters making up the "CAS.ProductId" data element may be of any case and the {product_id} value may be any valid integer equaling the product identifier of an object residing in the Archive Service.
query in interface jpl.eda.product.QueryHandlerxmlQuery - The XMLQuery object containing the query.
jpl.eda.product.ProductException - If the property is not set, the Archive
Service cannot be accessed or the server returns an exception.
public byte[] retrieveChunk(java.lang.String id,
long offset,
int length)
throws jpl.eda.product.ProductException
retrieveChunk in interface jpl.eda.product.LargeProductQueryHandlerid - The unique identifier for the file which is the archive
reference.offset - Skip into the file the specified number of bytes.length - The number of bytes to read from the file.
jpl.eda.product.ProductException - If the server throws an exception.
public void close(java.lang.String id)
throws jpl.eda.product.ProductException
close in interface jpl.eda.product.LargeProductQueryHandlerid - The unique identifier for the object.
jpl.eda.product.ProductException - If the server throws an exception.public static void main(java.lang.String[] argv)
The command-line arguments are as follows:
The program exits with status 0 on success, 1 on failure.
Properties specified inside the
Ideally, from an actual client of the Product Service, the calling application should be able to call the LargeResult.getInputStream() method instead of calling the retrieveChunk() method and managing the transfer as it is done in this method. The former is simpler, but the later offers more control and possibly better exception handling.
argv - The command-line arguments.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||