gov.nasa.pds.registry.service
Interface MetadataStore

All Known Implementing Classes:
MetadataStoreJPA

public interface MetadataStore

This interface provides the methods required by the RegistryService in order for it to operate. This is the extension point one would implement when providing a different back end storage.

Author:
pramirez

Method Summary
 void deleteRegistryObject(String guid, Class<? extends RegistryObject> objectClass)
          Removes a registry object from the back end store.
 RegistryResponse getAssociations(AssociationQuery query, Integer start, Integer rows)
          Retrieves associations from the back end store that match the query and are within the requested results list range
 RegistryResponse getAssociations(String lid, String versionId, Integer start, Integer rows)
          Retrieves associations that have the lid and version id where they appear as either the source or target.
 List<AuditableEvent> getAuditableEvents(String affectedObject)
          Retrieves the list of events that the given affected object was referenced in
 List<ClassificationNode> getClassificationNodes(String scheme)
          Retrieves the list of classification nodes which fall under a given classification scheme
 long getNumRegistryObjects(Class<? extends RegistryObject> objectClass)
          Gets the count of registry objects managed in the backed of a given type.
 RegistryResponse getProducts(ProductQuery query, Integer start, Integer rows)
          Retrieves products from back end store that match the query and are within the requested result list range
 RegistryObject getRegistryObject(String guid, Class<? extends RegistryObject> objectClass)
          Returns the registry object with a given guid and of the given type
 RegistryObject getRegistryObject(String lid, String versionId, Class<? extends RegistryObject> objectClass)
          Retrieves a registry object that is identified by its logical identifier and user supplied version.
 List<RegistryObject> getRegistryObjects(Integer start, Integer rows, Class<? extends RegistryObject> objectClass)
          This method allows paging through registry objects of a given type.
 List<RegistryObject> getRegistryObjectVersions(String lid, Class<? extends RegistryObject> objectClass)
          Returns all versions of a registry object that share a logical identifier
 boolean hasClassificationNode(String scheme, String code)
          Checks to see if a code exists within a classification scheme
 boolean hasRegistryObject(String guid, Class<? extends RegistryObject> objectClass)
          Test to see if a registry object exists with a guid and type requested.
 boolean hasRegistryObject(String lid, String versionId, Class<? extends RegistryObject> objectClass)
          Test to see if a registry object exists with a logical identifier, version, and type requested.
 boolean hasRegistryObjectVersions(String lid, Class<? extends RegistryObject> objectClass)
          Test to see if there are any versions of the registry object with the logical id and type requested
 void saveRegistryObject(RegistryObject registryObject)
          Stores a registry object into the back end.
 void updateRegistryObject(RegistryObject registryObject)
          Updates a registry object that shares the guid of the given object
 

Method Detail

getProducts

RegistryResponse getProducts(ProductQuery query,
                             Integer start,
                             Integer rows)
Retrieves products from back end store that match the query and are within the requested result list range

Parameters:
query - to filter against products
start - index within the results to start at. This index is one based
rows - number of results to get
Returns:
list of products

getAssociations

RegistryResponse getAssociations(AssociationQuery query,
                                 Integer start,
                                 Integer rows)
Retrieves associations from the back end store that match the query and are within the requested results list range

Parameters:
query - to filter against associations.
start - index within the results to start at. This index is one based
rows - number of results to get
Returns:
list of associations

getAssociations

RegistryResponse getAssociations(String lid,
                                 String versionId,
                                 Integer start,
                                 Integer rows)
Retrieves associations that have the lid and version id where they appear as either the source or target.

Parameters:
lid - logical identifier to match
versionId - user provided version to match. This is different from the internally tracked registry version.
start - index within the results to start at. This index is one based.
rows - number of results to get
Returns:
list of associations

getAuditableEvents

List<AuditableEvent> getAuditableEvents(String affectedObject)
Retrieves the list of events that the given affected object was referenced in

Parameters:
affectedObject - guid of a registry object
Returns:
list of events

getClassificationNodes

List<ClassificationNode> getClassificationNodes(String scheme)
Retrieves the list of classification nodes which fall under a given classification scheme

Parameters:
scheme - guid of the scheme
Returns:
list of classification nodes

hasClassificationNode

boolean hasClassificationNode(String scheme,
                              String code)
Checks to see if a code exists within a classification scheme

Parameters:
scheme - guid of the scheme
code - to check for in scheme
Returns:
flag to indicate existence

getRegistryObject

RegistryObject getRegistryObject(String guid,
                                 Class<? extends RegistryObject> objectClass)
Returns the registry object with a given guid and of the given type

Parameters:
guid - of requested registry object
objectClass - type of object. For instance, a Product, ClassificationNode, Service, etc. Anything that extends from a RegistryObject
Returns:

getRegistryObject

RegistryObject getRegistryObject(String lid,
                                 String versionId,
                                 Class<? extends RegistryObject> objectClass)
Retrieves a registry object that is identified by its logical identifier and user supplied version.

Parameters:
lid - logical identifier of registry object.
versionId - version of registry object.
objectClass - type of registry object.
Returns:
The identfied registry object of the requested type.

saveRegistryObject

void saveRegistryObject(RegistryObject registryObject)
Stores a registry object into the back end.

Parameters:
registryObject - to store

getNumRegistryObjects

long getNumRegistryObjects(Class<? extends RegistryObject> objectClass)
Gets the count of registry objects managed in the backed of a given type.

Parameters:
objectClass - type of object to look up
Returns:
count of objects

deleteRegistryObject

void deleteRegistryObject(String guid,
                          Class<? extends RegistryObject> objectClass)
Removes a registry object from the back end store.

Parameters:
guid - of object to remove
objectClass - type of object to remove

updateRegistryObject

void updateRegistryObject(RegistryObject registryObject)
Updates a registry object that shares the guid of the given object

Parameters:
registryObject - to update too

getRegistryObjectVersions

List<RegistryObject> getRegistryObjectVersions(String lid,
                                               Class<? extends RegistryObject> objectClass)
Returns all versions of a registry object that share a logical identifier

Parameters:
lid - logical identifier of objects to look up
objectClass - type of registry object
Returns:
list of matching registry objects

getRegistryObjects

List<RegistryObject> getRegistryObjects(Integer start,
                                        Integer rows,
                                        Class<? extends RegistryObject> objectClass)
This method allows paging through registry objects of a given type.

Parameters:
start - index within the results to start at. This index is one based
rows - number of results to get
objectClass - type of object to get
Returns:
list of registry objects that share the type requested

hasRegistryObject

boolean hasRegistryObject(String lid,
                          String versionId,
                          Class<? extends RegistryObject> objectClass)
Test to see if a registry object exists with a logical identifier, version, and type requested.

Parameters:
lid - logical id of object
versionId - user provided version
objectClass - type of registry object
Returns:
flag indicating existence of registry object

hasRegistryObject

boolean hasRegistryObject(String guid,
                          Class<? extends RegistryObject> objectClass)
Test to see if a registry object exists with a guid and type requested.

Parameters:
guid - globally unique identifier of object
objectClass - type of registry object
Returns:
flag indicating existence of registry object

hasRegistryObjectVersions

boolean hasRegistryObjectVersions(String lid,
                                  Class<? extends RegistryObject> objectClass)
Test to see if there are any versions of the registry object with the logical id and type requested

Parameters:
lid - logical id of object
objectClass - type of registry object
Returns:
flag indicating existence of registry object


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