gov.nasa.pds.registry.resource
Class PackagesResource

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

public class PackagesResource
extends Object

This resource is responsible for managing Packages with the registry service.

Author:
pramirez

Constructor Summary
PackagesResource(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 changeStatusOfPackage(String packageGuid, gov.nasa.pds.registry.model.ObjectAction action)
          Updates the status of the package with the given global identifier.
 javax.ws.rs.core.Response changeStatusOfPackageMembers(String packageGuid, gov.nasa.pds.registry.model.ObjectAction action)
          Updates the status of all the members of the package with the given global identifier.
 javax.ws.rs.core.Response deletePackage(String packageGuid)
          Deletes the package with the given global identifier.
 javax.ws.rs.core.Response deletePackageMembers(String packageGuid)
          Deletes all the members of a package with the given global identifier.
 gov.nasa.pds.registry.model.RegistryPackage getPackage(String packageGuid)
          Retrieves the package with the given global identifier.
 javax.ws.rs.core.Response getPackages(Integer start, Integer rows, String guid, String name, String lid, gov.nasa.pds.registry.model.ObjectStatus status, gov.nasa.pds.registry.query.QueryOperator operator, List<String> sort)
          Retrieves all packages managed by the registry given a set of filters.
protected static URI getPackageUri(gov.nasa.pds.registry.model.RegistryPackage registryPackage, javax.ws.rs.core.UriInfo uriInfo)
           
 javax.ws.rs.core.Response publishPackage(gov.nasa.pds.registry.model.RegistryPackage registryPackage)
          Publishes a package to the registry.
 javax.ws.rs.core.Response updatePackage(String guid, gov.nasa.pds.registry.model.RegistryPackage registryPackage)
          Updates the package with the given global identifier.
 javax.ws.rs.core.Response updatePackageWithPost(String guid, gov.nasa.pds.registry.model.RegistryPackage registryPackage)
          Updates the package with the given global identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackagesResource

public PackagesResource(javax.ws.rs.core.UriInfo uriInfo,
                        javax.ws.rs.core.Request request,
                        gov.nasa.pds.registry.service.RegistryService registryService)
Method Detail

publishPackage

public javax.ws.rs.core.Response publishPackage(gov.nasa.pds.registry.model.RegistryPackage registryPackage)
Publishes a package to the registry. Publishing includes validation, assigning an internal version, validating the submission, and notification.

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

getPackageUri

protected static URI getPackageUri(gov.nasa.pds.registry.model.RegistryPackage registryPackage,
                                   javax.ws.rs.core.UriInfo uriInfo)

getPackage

public gov.nasa.pds.registry.model.RegistryPackage getPackage(String packageGuid)
Retrieves the package with the given global identifier.

Returns:
the package

deletePackage

public javax.ws.rs.core.Response deletePackage(String packageGuid)
Deletes the package with the given global identifier.

Parameters:
packageGuid - of package
Returns:
Response indicating whether the operation succeeded or had an error

updatePackage

public javax.ws.rs.core.Response updatePackage(String guid,
                                               gov.nasa.pds.registry.model.RegistryPackage registryPackage)
Updates the package with the given global identifier.

Parameters:
guid - globally unique identifier of the service
service - updates to the service
Returns:
returns an HTTP response that indicates an error or ok

updatePackageWithPost

public javax.ws.rs.core.Response updatePackageWithPost(String guid,
                                                       gov.nasa.pds.registry.model.RegistryPackage registryPackage)
Updates the package with the given global identifier. This method supports clients that can not do a PUT operation.


changeStatusOfPackage

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

Parameters:
packageGuid - unique identifier of package to look up
action - to take on package which will result in an update of status ObjectAction

deletePackageMembers

public javax.ws.rs.core.Response deletePackageMembers(String packageGuid)
Deletes all the members of a package with the given global identifier.

Parameters:
packageGuid - unique identifier of package to look up members of

changeStatusOfPackageMembers

public javax.ws.rs.core.Response changeStatusOfPackageMembers(String packageGuid,
                                                              gov.nasa.pds.registry.model.ObjectAction action)
Updates the status of all the members of the package with the given global identifier.

Parameters:
packageGuid - unique identifier of package to look up members of
action - to take on all members which will result in an update of status ObjectAction

getPackages

public javax.ws.rs.core.Response getPackages(Integer start,
                                             Integer rows,
                                             String guid,
                                             String name,
                                             String lid,
                                             gov.nasa.pds.registry.model.ObjectStatus status,
                                             gov.nasa.pds.registry.query.QueryOperator operator,
                                             List<String> sort)
Retrieves all packages managed by the registry given a set of filters.



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