gov.nasa.pds.registry.resource
Class AssociationsResource

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

public class AssociationsResource
extends Object

This is the resource responsible for managing Associations

Author:
pramirez

Constructor Summary
AssociationsResource(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.Request request, RegistryService registryService)
           
 
Method Summary
 javax.ws.rs.core.Response deleteAssociation(String guid)
          Deletes the association with the given guid
 Association getAssociation(String guid)
          Retrieves an association with the given global identifier.
 javax.ws.rs.core.Response getAssociations(Integer start, Integer rows, String lid, String versionId)
          Retrieves the associations related with a given product in the registry regardless if the product is the source or target in the relationship.
 javax.ws.rs.core.Response getAssociations(Integer start, Integer rows, String targetLid, String targetVersionId, String targetHome, String sourceLid, String sourceVersionId, String sourceHome, String associationType, QueryOperator operator, List<String> sort)
          Retrieves all associations managed by the registry given a set of filters.
protected static URI getAssociationUri(Association association, javax.ws.rs.core.UriInfo uriInfo)
           
 javax.ws.rs.core.Response publishAssociation(Association association)
          Publishes an association to the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationsResource

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

getAssociations

public javax.ws.rs.core.Response getAssociations(Integer start,
                                                 Integer rows,
                                                 String targetLid,
                                                 String targetVersionId,
                                                 String targetHome,
                                                 String sourceLid,
                                                 String sourceVersionId,
                                                 String sourceHome,
                                                 String associationType,
                                                 QueryOperator operator,
                                                 List<String> sort)
Retrieves all associations managed by the registry given a set of filters.

Parameters:
start - the index at which to start the result list from
rows - how many results to return
targetLid - filter on the logical identifier of the target in the association supports wildcard (*)
targetVersionId - filter on the version id of the target in the association supports wildcard (*)
targetHome - filter on the URI of the home of the target in the association supports wildcard (*)
sourcetLid - filter on the logical identifier of the source in the association supports wildcard (*)
sourceVersionId - filter on the version id of the source in the association supports wildcard (*)
sourceHome - filter on the URI of the home of the source in the association supports wildcard (*)
associationType - filter on the type of association supports wildcard (*)
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:
all matching associations in the registry

getAssociations

public javax.ws.rs.core.Response getAssociations(Integer start,
                                                 Integer rows,
                                                 String lid,
                                                 String versionId)
Retrieves the associations related with a given product in the registry regardless if the product is the source or target in the relationship.

Parameters:
start - the index at which to start the result list from
rows - how many results to return
lid - of the product
versionId - of the product
Returns:
List of associations

publishAssociation

public javax.ws.rs.core.Response publishAssociation(Association association)
Publishes an association to the registry. Publishing includes validation, assigning an internal version, validating the submission, and notification.

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

getAssociationUri

protected static URI getAssociationUri(Association association,
                                       javax.ws.rs.core.UriInfo uriInfo)

getAssociation

public Association getAssociation(String guid)
Retrieves an association with the given global identifier.

Returns:
the association

deleteAssociation

public javax.ws.rs.core.Response deleteAssociation(String guid)
Deletes the association with the given guid

Parameters:
guid - of association
Returns:
Response indicating whether the operation succeeded or had an error


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