gov.nasa.pds.registry.resource
Class ProductResource

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

public class ProductResource
extends Object

This class delegates all functions involving a particular product. This is defined as a sub-resource to the registry resource merely to partition off the operations involving products.

Author:
pramirez

Constructor Summary
ProductResource(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, RegistryService registryService, String lid, String versionId)
           
 
Method Summary
protected static void addApproveProductLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, Product product)
           
protected static void addDeprecateProductLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, Product product)
           
protected static void addEarliestProductLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, RegistryService registryService, Product product)
           
protected static void addLatestProductLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, RegistryService registryService, Product product)
           
protected static void addNextProductLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, RegistryService registryService, Product product)
           
protected static void addPreviousProductLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, RegistryService registryService, Product product)
           
 javax.ws.rs.core.Response changeStatus(ObjectAction action)
          This will change the status of the registered product
 javax.ws.rs.core.Response deleteProduct()
          Removes an product from the registry
 javax.ws.rs.core.Response getProduct()
          Retrieves a single product from the registry.
protected static URI getProductUri(Product product, javax.ws.rs.core.UriInfo uriInfo)
           
 javax.ws.rs.core.Response updateProduct(Product product)
          Updates an existing product with the given local identifier and version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductResource

public ProductResource(javax.ws.rs.core.UriInfo uriInfo,
                       javax.ws.rs.core.Request request,
                       RegistryService registryService,
                       String lid,
                       String versionId)
Method Detail

getProduct

public javax.ws.rs.core.Response getProduct()
Retrieves a single product from the registry. The local identifier with the version uniquely identifies one product.

Returns:
Product within the registry with the lid and version

updateProduct

public javax.ws.rs.core.Response updateProduct(Product product)
Updates an existing product with the given local identifier and version.

Parameters:
product - to update to
Returns:
returns an HTTP response that indicates an error or ok

deleteProduct

public javax.ws.rs.core.Response deleteProduct()
Removes an product from the registry


changeStatus

public javax.ws.rs.core.Response changeStatus(ObjectAction action)
This will change the status of the registered product

Parameters:
action - to take on product which will result in an update of status ObjectAction
Returns:
the updated product

addPreviousProductLink

protected static void addPreviousProductLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                             javax.ws.rs.core.UriInfo uriInfo,
                                             RegistryService registryService,
                                             Product product)

addNextProductLink

protected static void addNextProductLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                         javax.ws.rs.core.UriInfo uriInfo,
                                         RegistryService registryService,
                                         Product product)

addEarliestProductLink

protected static void addEarliestProductLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                             javax.ws.rs.core.UriInfo uriInfo,
                                             RegistryService registryService,
                                             Product product)

addLatestProductLink

protected static void addLatestProductLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                           javax.ws.rs.core.UriInfo uriInfo,
                                           RegistryService registryService,
                                           Product product)

addDeprecateProductLink

protected static void addDeprecateProductLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                              javax.ws.rs.core.UriInfo uriInfo,
                                              Product product)

addApproveProductLink

protected static void addApproveProductLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                            javax.ws.rs.core.UriInfo uriInfo,
                                            Product product)

getProductUri

protected static URI getProductUri(Product product,
                                   javax.ws.rs.core.UriInfo uriInfo)


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