gov.nasa.pds.registry.resource
Class ExtrinsicsResource

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

public class ExtrinsicsResource
extends Object

This resource is responsible for managing collections of Products.

Author:
pramirez

Constructor Summary
ExtrinsicsResource(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, gov.nasa.pds.registry.service.RegistryService registryService)
           
 
Method Summary
 javax.ws.rs.core.Response getEarliestVersion(String lid)
          Retrieves the earliest product from the registry.
 ExtrinsicResource getExtrinsicResource(String lid, String versionId)
           
 gov.nasa.pds.registry.model.RegistryResponse getExtrinsicVersions(String lid)
          Retrieves the collection of extrinsics that share the same local identifier.
 javax.ws.rs.core.Response getLatestVersion(String lid)
          Retrieves the latest extrinsic from the registry.
 javax.ws.rs.core.Response getProducts(Integer start, Integer rows, String guid, String name, String lid, String versionName, String versionId, String objectType, String submitter, gov.nasa.pds.registry.model.ObjectStatus status, gov.nasa.pds.registry.model.EventType eventType, gov.nasa.pds.registry.query.QueryOperator operator, List<String> sort)
          Allows access to all the extrinsics managed by this repository.
 javax.ws.rs.core.Response publishProduct(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
          Publishes a extrinsic object to the registry.
 javax.ws.rs.core.Response versionExtrinsic(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic, 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

ExtrinsicsResource

public ExtrinsicsResource(javax.ws.rs.core.UriInfo uriInfo,
                          javax.ws.rs.core.Request request,
                          gov.nasa.pds.registry.service.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,
                                             gov.nasa.pds.registry.model.ObjectStatus status,
                                             gov.nasa.pds.registry.model.EventType eventType,
                                             gov.nasa.pds.registry.query.QueryOperator operator,
                                             List<String> sort)
Allows access to all the extrinsics managed by this repository. This list of extrinsics is based on the latest received extrinsic'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(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
Publishes a extrinsic object to the registry. Publishing includes validation, assigning an internal version, validating the submission, and notification. The submitted extrinsic object should not contain the same logical identifier as previously submitted extrinsic (412 Precondition Failed), in that scenario the version interface should be used.

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

versionExtrinsic

public javax.ws.rs.core.Response versionExtrinsic(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic,
                                                  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:
extrinsic - to update to
lid - the logical identifier to the extrinsic
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 extrinsic and its guid

getExtrinsicVersions

public gov.nasa.pds.registry.model.RegistryResponse getExtrinsicVersions(String lid)
Retrieves the collection of extrinsics that share the same local identifier. This method supports finding all versions of extrinsic.

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

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:
ExtrinsicObject within the registry with the lid and version

getLatestVersion

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

Parameters:
lid - the logical identifier to the extrinsic
Returns:
Extrinsic within the registry with the lid and version

getExtrinsicResource

public ExtrinsicResource getExtrinsicResource(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 © 2010-2011 Planetary Data System. All Rights Reserved.