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 Extrinsics with the registry service.

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
protected static void addApproveExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
           
protected static void addDeprecateExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
           
protected static void addEarliestExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, gov.nasa.pds.registry.service.RegistryService registryService, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
           
protected static void addLatestExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, gov.nasa.pds.registry.service.RegistryService registryService, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
           
protected static void addNextExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, gov.nasa.pds.registry.service.RegistryService registryService, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
           
protected static void addPreviousExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder, javax.ws.rs.core.UriInfo uriInfo, gov.nasa.pds.registry.service.RegistryService registryService, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
           
 javax.ws.rs.core.Response changeStatus(String guid, gov.nasa.pds.registry.model.ObjectAction action)
          Updates the status of the extrinsic with the given global identifier.
 javax.ws.rs.core.Response deleteExtrinsic(String guid)
          Removes the extrinsic with the given global identifier.
 javax.ws.rs.core.Response getEarliestVersion(String lid)
          Retrieves the earliest extrinsic from the registry.
 javax.ws.rs.core.Response getExtrinsic(String guid)
          Retrieves a single extrinsic from the registry.
 javax.ws.rs.core.Response getExtrinsics(Integer start, Integer rows, String guid, String name, String lid, String versionName, String objectType, String contentVersion, String mimeType, gov.nasa.pds.registry.model.ObjectStatus status, gov.nasa.pds.registry.query.QueryOperator operator, List<String> sort)
          Allows access to all the extrinsics managed by the registry.
protected static URI getExtrinsicUri(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic, javax.ws.rs.core.UriInfo uriInfo)
           
 gov.nasa.pds.registry.model.PagedResponse<gov.nasa.pds.registry.model.ExtrinsicObject> getExtrinsicVersions(String lid)
          Retrieves the collection of extrinsics that share the same logical identifier.
 javax.ws.rs.core.Response getLatestVersion(String lid)
          Retrieves the latest extrinsic from the registry.
 javax.ws.rs.core.Response publishExtrinsic(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic, String packageGuid)
          Publishes an extrinsic object to the registry.
 javax.ws.rs.core.Response updateExtrinsic(String guid, gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
          Updates the existing extrinsic with the given logical identifier and version.
 javax.ws.rs.core.Response versionExtrinsic(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic, String lid, boolean major, String packageGuid)
          Creates a new version of an extrinsic 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

getExtrinsics

public javax.ws.rs.core.Response getExtrinsics(Integer start,
                                               Integer rows,
                                               String guid,
                                               String name,
                                               String lid,
                                               String versionName,
                                               String objectType,
                                               String contentVersion,
                                               String mimeType,
                                               gov.nasa.pds.registry.model.ObjectStatus status,
                                               gov.nasa.pds.registry.query.QueryOperator operator,
                                               List<String> sort)
Allows access to all the extrinsics managed by the registry. 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 (*)
objectType - filter to apply on the user defined registry object types,supports wildcard (*)
status - filter to apply on the object status, maps to ObjectStatus enum
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

publishExtrinsic

public javax.ws.rs.core.Response publishExtrinsic(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic,
                                                  String packageGuid)
Publishes an 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 publish to registry
packageGuid - optional package guid which this registry object will be a member of
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,
                                                  String packageGuid)
Creates a new version of an extrinsic 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
packageGuid - optional package guid which this registry object will be a member of
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.PagedResponse<gov.nasa.pds.registry.model.ExtrinsicObject> getExtrinsicVersions(String lid)
Retrieves the collection of extrinsics that share the same logical 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 extrinsic from the registry. The logical identifier points to a collection of versions of the same extrinsic.

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 logical 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

getExtrinsic

public javax.ws.rs.core.Response getExtrinsic(String guid)
Retrieves a single extrinsic from the registry. The logical identifier with the version uniquely identifies one extrinsic.

Parameters:
guid - unique identifier of registry item
Returns:
ExtrinsicObject within the registry with the guid

updateExtrinsic

public javax.ws.rs.core.Response updateExtrinsic(String guid,
                                                 gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)
Updates the existing extrinsic with the given logical identifier and version.

Parameters:
guid - unique identifier of registry item
extrinsic - to update to
Returns:
returns an HTTP response that indicates an error or ok

deleteExtrinsic

public javax.ws.rs.core.Response deleteExtrinsic(String guid)
Removes the extrinsic with the given global identifier.

Parameters:
guid - unique identifier of registry item

changeStatus

public javax.ws.rs.core.Response changeStatus(String guid,
                                              gov.nasa.pds.registry.model.ObjectAction action)
Updates the status of the extrinsic with the given global identifier.

Parameters:
guid - unique identifier of registry item
action - to take on extrinsic which will result in an update of status ObjectAction

addPreviousExtrinsicLink

protected static void addPreviousExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                               javax.ws.rs.core.UriInfo uriInfo,
                                               gov.nasa.pds.registry.service.RegistryService registryService,
                                               gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)

addNextExtrinsicLink

protected static void addNextExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                           javax.ws.rs.core.UriInfo uriInfo,
                                           gov.nasa.pds.registry.service.RegistryService registryService,
                                           gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)

addEarliestExtrinsicLink

protected static void addEarliestExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                               javax.ws.rs.core.UriInfo uriInfo,
                                               gov.nasa.pds.registry.service.RegistryService registryService,
                                               gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)

addLatestExtrinsicLink

protected static void addLatestExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                             javax.ws.rs.core.UriInfo uriInfo,
                                             gov.nasa.pds.registry.service.RegistryService registryService,
                                             gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)

addDeprecateExtrinsicLink

protected static void addDeprecateExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                                javax.ws.rs.core.UriInfo uriInfo,
                                                gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)

addApproveExtrinsicLink

protected static void addApproveExtrinsicLink(javax.ws.rs.core.Response.ResponseBuilder builder,
                                              javax.ws.rs.core.UriInfo uriInfo,
                                              gov.nasa.pds.registry.model.ExtrinsicObject extrinsic)

getExtrinsicUri

protected static URI getExtrinsicUri(gov.nasa.pds.registry.model.ExtrinsicObject extrinsic,
                                     javax.ws.rs.core.UriInfo uriInfo)


Copyright © 2010–2015 Planetary Data System. All rights reserved.