gov.nasa.pds.registry.resource
Class ProductsResource

java.lang.Object
  extended by gov.nasa.pds.registry.resource.ProductsResource

public class ProductsResource
extends Object

This resource is responsible for managing collections of Products.

Author:
pramirez

Constructor Summary
ProductsResource(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, RegistryService registryService)
           
 
Method Summary
 javax.ws.rs.core.Response getEarliestVersion(String lid)
          Retrieves the earliest product from the registry.
 javax.ws.rs.core.Response getLatestVersion(String lid)
          Retrieves the latest product from the registry.
 ProductResource getProductResource(String lid, String versionId)
           
 javax.ws.rs.core.Response getProducts(Integer start, Integer rows, String guid, String name, String lid, String versionName, String versionId, String objectType, String submitter, ObjectStatus status, EventType eventType, QueryOperator operator, List<String> sort)
          Allows access to all the products managed by this repository.
 RegistryResponse getProductVersions(String lid)
          Retrieves the collection of products that share the same local identifier.
 javax.ws.rs.core.Response publishProduct(Product product)
          Publishes a product to the registry.
 javax.ws.rs.core.Response versionProduct(Product product, String lid, boolean major)
          Creates a new version of a product in the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductsResource

public ProductsResource(javax.ws.rs.core.UriInfo uriInfo,
                        javax.ws.rs.core.Request request,
                        RegistryService registryService)
Method Detail

getProducts

public javax.ws.rs.core.Response getProducts(Integer start,
                                             Integer rows,
                                             String guid,
                                             String name,
                                             String lid,
                                             String versionName,
                                             String versionId,
                                             String objectType,
                                             String submitter,
                                             ObjectStatus status,
                                             EventType eventType,
                                             QueryOperator operator,
                                             List<String> sort)
Allows access to all the products managed by this repository. This list of products is based on the latest received product's logical identifier (lid). The header will contain pointers to next and previous when applicable.

Parameters:
start - the index at which to start the result list from
rows - how many results to return
guid - filter to apply on the global unique id, supports wildcard (*)
name - filter to apply to name, support wildcard (*)
lid - filter to apply to logical id, supports wildcard (*)
versionName - filter to apply to registry object version, supports wildcard (*)
versionId - filter to apply on the user version, supports wildcard (*)
objectType - filter to apply on the user defined registry object types,supports wildcard (*)
submitter - CURRENTLY UNSUPPORTED
status - filter to apply on the object status, maps to ObjectStatus enum
eventType - CURRENTLY UNSUPPORTED
operator - to apply to filters, valid values are AND or OR. Defaults to AND.
sort - defines what parameters to sort on. The format is "parameter order" the order is optional. The default is "guid ASC" and if unspecified the ordering is ASC.
Returns:
subset of managed products

publishProduct

public javax.ws.rs.core.Response publishProduct(Product product)
Publishes a product to the registry. Publishing includes validation, assigning an internal version, validating the submission, and notification. The submitted product should not contain the same logical identifier as previously submitted product (412 Precondition Failed), in that scenario the version interface should be used.

Parameters:
product - to update to
Returns:
returns an HTTP response that indicates an error or the location of the created product and its guid

versionProduct

public javax.ws.rs.core.Response versionProduct(Product product,
                                                String lid,
                                                boolean major)
Creates a new version of a product in the registry. Follows the same procedures as publishing with the caveat that the logical identifier this product carries should already exist in the registry (412 Precondition Failed).

Parameters:
product - to update to
lid - the logical identifier to the product
major - if true indicates a major revision otherwise considered minor
Returns:
returns an HTTP response that indicates an error or the location of the versioned product and its guid

getProductVersions

public RegistryResponse getProductVersions(String lid)
Retrieves the collection of products that share the same local identifier. This method supports finding all versions of an product.

Parameters:
lid - local identifier of set products to retrieve
Returns:
collection of products

getEarliestVersion

public javax.ws.rs.core.Response getEarliestVersion(String lid)
Retrieves the earliest product from the registry. The local identifier points to a collection of versions of the same product.

Parameters:
lid - local identifier of product to retrieve
Returns:
Product within the registry with the lid and version

getLatestVersion

public javax.ws.rs.core.Response getLatestVersion(String lid)
Retrieves the latest product from the registry. The local identifier points to a collection of versions of the same product.

Parameters:
lid - the logical identifier to the product
Returns:
Product within the registry with the lid and version

getProductResource

public ProductResource getProductResource(String lid,
                                          String versionId)
Parameters:
versionId - of the product's local identifier
lid - local identifier which identifies a unique set of products
Returns:
the resource that manages an Product in the registry


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