|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjpl.eda.archive.server.Product
This class represents the interface to a product's references.
This class uses the following property to populate the
prodId and Identifier elements of a product's
profile:
urn:eda:rmi:JPL.Test.Archive.
| Field Summary | |
static java.lang.String |
FILE_DATA_LOCAL
Constant for FILE_DATA_LOCAL |
static java.lang.String |
FILE_DATA_REMOTE
Constant for FILE_DATA_REMOTE |
static java.lang.String |
FILE_METADATA
Constant for FILE_METADATA |
| Constructor Summary | |
Product(jpl.eda.util.JDBC_DB db,
Dataset dataset)
Constructor given a database connection and dataset information. |
|
Product(jpl.eda.util.JDBC_DB db,
Dataset dataset,
int productId)
Deprecated. Replaced by a combination of Product(JDBC_DB, Dataset) and load(int). |
|
| Method Summary | |
void |
add(java.lang.String productName,
java.lang.String productOwner)
This method adds the product to the product metadata table after generating an unique identifier and determining the version. |
void |
addReferences()
Add the product item references to the product reference table. |
void |
delete()
Delete all references to the associated product. |
Dataset |
getDataset()
This method returns the Dataset associated with the product. |
int |
getProductId()
This method returns the product identifier of the currently loaded product. |
ProductList |
getProductList()
This method returns the product item list for the currently loaded product. |
java.util.HashMap |
getProductMetadata()
This method creates and returns a hash map of element/value pairs for the currently loaded product. |
java.lang.String |
getProductName()
This method returns the product name of the currently loaded product. |
java.lang.String |
getProductOwner()
This method returns the product user name of the owner of the currently loaded product. |
jpl.eda.profile.Profile |
getProductProfile()
This method creates and returns a Profile object representing the currently loaded product. |
java.lang.String |
getProductReceivedTime()
This method returns the product received time of the currently loaded product. |
java.lang.String |
getProductStatusType()
This method returns the product status type of the currently loaded product. |
int |
getProductVersion()
This method returns the product version of the currently loaded product. |
void |
load(int productId)
This method retrieves the product information for the given product identified by the identifier and then loads that information into the local variables. |
void |
load(java.lang.String productName)
This method retrieves the product information for the given product with the latest version identified by name and then loads that information into the local variables. |
void |
load(java.lang.String productName,
int productVersion)
This method retrieves the product information for the given product identified by name and version and then loads that information into the local variables. |
static void |
main(java.lang.String[] argv)
Execute the Product class via the command-line. |
void |
updateLength(java.lang.String archiveRef,
long length)
Update the product item length in the product reference table. |
void |
updateStatus()
Update the product status to NORMAL in the product metadata table. |
boolean |
validName(java.lang.String name)
This method will determine whether the product name is valid. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String FILE_METADATA
public static final java.lang.String FILE_DATA_LOCAL
public static final java.lang.String FILE_DATA_REMOTE
| Constructor Detail |
public Product(jpl.eda.util.JDBC_DB db,
Dataset dataset)
throws ProductException
db - The database connection.dataset - The dataset information.
ProductException - If the data type list cannot be retrieved
from the database.
public Product(jpl.eda.util.JDBC_DB db,
Dataset dataset,
int productId)
throws ProductException
Product(JDBC_DB, Dataset) and load(int).
db - The database connection.dataset - The dataset information.productId - The product identifier.
ProductException - If the product cannot be retrieved
from the database.| Method Detail |
public void add(java.lang.String productName,
java.lang.String productOwner)
throws ProductException
productName - The name of the product.productOwner - The owner of the product.
ProductException - If the product cannot be inserted
into the database.
public void addReferences()
throws ProductException
ProductException - If the insert to the database fails.
public void load(java.lang.String productName)
throws ProductException
productName - The name of the product.
ProductException - If the product cannot be retrieved
from the database.
public void load(java.lang.String productName,
int productVersion)
throws ProductException
productName - The name of the product.productVersion - The version of the product.
ProductException - If the product cannot be retrieved
from the database.
public void load(int productId)
throws ProductException
productId - The product identifier.
ProductException - If the product cannot be retrieved
from the database.public Dataset getDataset()
public int getProductId()
public java.lang.String getProductName()
public int getProductVersion()
public java.lang.String getProductStatusType()
public java.lang.String getProductReceivedTime()
public java.lang.String getProductOwner()
public ProductList getProductList()
public java.util.HashMap getProductMetadata()
public jpl.eda.profile.Profile getProductProfile()
public void delete()
throws ProductException
ProductException - If an error occurs deleting the files or
their referencespublic boolean validName(java.lang.String name)
name - The name of the product to validate.
public void updateLength(java.lang.String archiveRef,
long length)
throws ProductException
archiveRef - The archive reference to the product item.length - The length of the product item in bytes.
ProductException - If the update to the database fails.
public void updateStatus()
throws ProductException
ProductException - If the update to the database fails.public static void main(java.lang.String[] argv)
The command-line arguments are as follows:
reference, metadata or profile.
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 | ||||||||||