|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjpl.eda.archive.ArchiveClient
This class serves as the client interface to the Catalog and Archive Service.
This class uses the following property:
32768.
| Constructor Summary | |
ArchiveClient(java.lang.String archiveServiceName)
Constructor given an Archive Service name. |
|
| Method Summary | |
int |
add(java.lang.String datasetName,
java.lang.String productName,
ProductList productList,
java.lang.String metadata)
Add a product to the archive. |
void |
close(java.lang.String id)
Notify the server that a particular file transfer has completed via the retrieveChunk() method. |
void |
delete(int productId)
Delete a product from the archive. |
void |
delete(java.lang.String datasetName,
java.lang.String productName)
Delete all versions of a product from the archive. |
void |
delete(java.lang.String datasetName,
java.lang.String productName,
int productVersion)
Delete a product from the archive. |
ProductList |
get(int productId,
java.lang.String pathSpec)
Get the product from the archive. |
ProductList |
get(java.lang.String datasetName,
java.lang.String productName,
int productVersion,
java.lang.String pathSpec)
Get the product from the archive. |
ProductList |
get(java.lang.String datasetName,
java.lang.String productName,
java.lang.String pathSpec)
Get the latest version of the product from the archive. |
int |
getId(java.lang.String datasetName,
java.lang.String productName,
int productVersion)
Get the product identifier for the product. |
ProductList |
getList(int productId)
Get the item list for the product from the archive. |
java.lang.String |
getMetadata(int productId)
Get the XML formatted metadata for the product. |
java.lang.String |
getMetadata(java.lang.String datasetName,
java.lang.String productName)
Get the XML formatted metadata for the product with the latest version. |
java.lang.String |
getMetadata(java.lang.String datasetName,
java.lang.String productName,
int productVersion)
Get the XML formatted metadata for the product. |
java.util.List |
getProfiles(jpl.eda.xmlquery.XMLQuery query)
Query for products that match the specified criteria across all datasets. |
java.util.List |
getProfiles(jpl.eda.xmlquery.XMLQuery query,
java.lang.String datasetName)
Query for products that match the specified criteria for the given dataset. |
static void |
main(java.lang.String[] argv)
Execute the archive client. |
java.lang.String |
ping()
Ping the server. |
void |
queue()
Check the queue and execute any tasks that have exceeded their wait time. |
byte[] |
retrieveChunk(java.lang.String id,
long offset,
int length)
Retrieve a fragment of the data from the specified file. |
void |
updateMetadata(int productId,
java.lang.String metadata)
Update the database with the XML formatted metadata for the product. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArchiveClient(java.lang.String archiveServiceName)
throws ArchiveException
archiveServiceName - The name of the archive service.
ArchiveException - If the object found was not the Archive Service.| Method Detail |
public int add(java.lang.String datasetName,
java.lang.String productName,
ProductList productList,
java.lang.String metadata)
throws ArchiveException
datasetName - The name of the dataset for the product to be added.productName - The name of the product to be added. A product name must begin with a letter, number or a period. Every other character in the name must be a letter, number, period, underscore, dash or colon.productList - The list of items for the product which consists of zero, one or more productReference and productType pairs.
file:///home/user/test.xml or http://cas.jpl.nasa.gov/dtd/metadata.dtd.
FILE_METADATA - An XML file conforming to the CAS metadata structure which will be parsed with the resulting element/value pairs stored in the catalog.
FILE_DATA_LOCAL - Any file intended to be transferred from the client to the server for local storage.
FILE_DATA_REMOTE - Any file intended to be referenced from its current location, instead of being transferred to the server.
metadata - This is a string representation of the XML metadata structure. This parameter may be null.
ArchiveException - If an exception occurs validating the dataset or product name, or reading or writing the files.
public int getId(java.lang.String datasetName,
java.lang.String productName,
int productVersion)
throws ArchiveException
datasetName - The name of the dataset for the product.productName - The name of the product.productVersion - The version number of the product.
ArchiveException - If retrieving the identifier from the server fails.
public ProductList get(java.lang.String datasetName,
java.lang.String productName,
java.lang.String pathSpec)
throws ArchiveException
datasetName - The name of the dataset for the product to be retrieved.productName - The name of the product to be retrieved.pathSpec - The directory location where the retrieved files should be placed.
ArchiveException - If retrieving the product from the server fails or a malformed reference is encountered.
public ProductList get(java.lang.String datasetName,
java.lang.String productName,
int productVersion,
java.lang.String pathSpec)
throws ArchiveException
datasetName - The name of the dataset for the product to be retrieved.productName - The name of the product to be retrieved.productVersion - The version number of the product to be retrieved.pathSpec - The directory location where the retrieved files should be placed.
ArchiveException - If retrieving the product from the server fails or a malformed reference is encountered.
public ProductList get(int productId,
java.lang.String pathSpec)
throws ArchiveException
productId - The identifier for the product to be retrieved.pathSpec - The directory location where the retrieved files should be placed.
ArchiveException - If retrieving the product from the server fails or a malformed reference is encountered.
public ProductList getList(int productId)
throws ArchiveException
ArchiveProductHandler class and does not transfer the files.
productId - The identifier for the product to be retrieved.
ArchiveException - If retrieving the product list from the server fails or a malformed reference is encountered.
public java.lang.String getMetadata(java.lang.String datasetName,
java.lang.String productName)
throws ArchiveException
datasetName - The name of the dataset for the product.productName - The name of the product.
ArchiveException - If retrieving the metadata from the server fails.
public java.lang.String getMetadata(java.lang.String datasetName,
java.lang.String productName,
int productVersion)
throws ArchiveException
datasetName - The name of the dataset for the product.productName - The name of the product.productVersion - The version of the product.
ArchiveException - If retrieving the metadata from the server fails.
public java.lang.String getMetadata(int productId)
throws ArchiveException
productId - The identifier of the product.
ArchiveException - If retrieving the metadata from the server fails.
public void updateMetadata(int productId,
java.lang.String metadata)
throws ArchiveException
productId - The identifier of the product.metadata - This is a string representation of the XML metadata structure.
ArchiveException - If updating the metadata on the server fails.
public void delete(java.lang.String datasetName,
java.lang.String productName)
throws ArchiveException
datasetName - The name of the dataset for the products to be deleted.productName - The name of the products to be deleted.
ArchiveException - If the delete on server fails.
public void delete(java.lang.String datasetName,
java.lang.String productName,
int productVersion)
throws ArchiveException
datasetName - The name of the dataset for the product to be deleted.productName - The name of the product to be deleted.productVersion - The version number of product to be deleted.
ArchiveException - If the delete on server fails.
public void delete(int productId)
throws ArchiveException
productId - The identifier of product to be deleted.
ArchiveException - If the delete on server fails.
public void queue()
throws ArchiveException
ArchiveException - If the server throws an exception.
public java.lang.String ping()
throws ArchiveException
ArchiveException - If the server throws an exception.
public java.util.List getProfiles(jpl.eda.xmlquery.XMLQuery query)
throws ArchiveException
query - The XMLQuery object.
ArchiveException - If the server throws an exception.
public java.util.List getProfiles(jpl.eda.xmlquery.XMLQuery query,
java.lang.String datasetName)
throws ArchiveException
query - The XMLQuery object.datasetName - The name of the dataset to query.
ArchiveException - If the server throws an exception.
public byte[] retrieveChunk(java.lang.String id,
long offset,
int length)
throws ArchiveException
id - 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.
ArchiveException - If the server throws an exception.
public void close(java.lang.String id)
throws ArchiveException
retrieveChunk() method.
id - The unique identifier for the file which is the archive reference.
ArchiveException - If the id parameter is invalid.public static void main(java.lang.String[] argv)
See the description for the specific method called by the event for detailed information regarding the arguments. Where an argument value varies from the method, the argument description is detailed here. The minimum command-line arguments are as follows:
add, getId, getByName, getByVersion, getById, getList, getMetadataByName, getMetadataByVersion, getMetadataById, deleteByName, deleteByVersion, deleteById, getProfiles, queue, or ping.
The add event calls the add() method in this class and expects these additional arguments:
<datasetName> <productName> [<productReference_1> <productType_1> ... <productReference_n> <productType_n>] [<metadata>]
The getId event calls the getId() method in this class and expects these additional arguments:
<datasetName> <productName> <productVersion>
The getBy* events call the appropriate get() method in this class and expect these additional arguments:
getByName <datasetName> <productName> [<pathSpec>]
getByVersion <datasetName> <productName> <productVersion> [<pathSpec>]
getById <productId> [<pathSpec>]
The getList event calls the getList() method in this class and expects this additional argument:
<productId>
The getMetadata* events call the appropriate getMetadata() method in this class and expect these additional arguments:
getMetadataByName <datasetName> <productName>
getMetadataByVersion <datasetName> <productName> <productVersion>
getMetadataById <productId>
The updateMetadata event calls the updateMetadata() method in this class and expects these additional arguments:
<productId> <metadata>
The delete* events call the appropriate delete() method in this class and expect these additional arguments:
deleteByName <datasetName> <productName>
deleteByVersion <datasetName> <productName> <productVersion>
deleteById <productId>
The getProfiles event calls the appropriate getProfiles() method in this class and expects these additional arguments:
<query> [<datasetName>]
"CAS.ProductName LIKE EDM".
The queue and ping events call the queue() and ping() methods, respectively, and require no additional arguments.
The program exits with status 0 on success, 1 on failure.
argv - The command-line arguments.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||