gov.nasa.pds.registry.service
Interface MetadataStore

All Known Implementing Classes:
MetadataStoreJPA

public interface MetadataStore

This interface provides the methods required by the RegistryServiceImpl 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.
 PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> query, Integer start, Integer rows)
          Retrieves associations from the back end store that match the query and are within the requested results list range
 PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query, Integer start, Integer rows)
          Retrieves auditable events from the back end store that match the query and are within the requested results list range
 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
 PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query, Integer start, Integer rows)
          Retrieves products from back end store that match the query and are within the requested result list range
 long getNumRegistryObjects(Class<? extends RegistryObject> objectClass)
          Gets the count of registry objects managed in the backed of a given type.
 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 versionName, Class<? extends RegistryObject> objectClass)
          Retrieves a registry object that is identified by its logical identifier and user supplied version.
 List<? extends RegistryObject> getRegistryObjects(Integer start, Integer rows, Class<? extends RegistryObject> objectClass)
          This method allows paging through registry objects of a given type.
 PagedResponse<? extends RegistryObject> getRegistryObjects(RegistryQuery<ObjectFilter> query, Integer start, Integer rows, Class<? extends RegistryObject> objectClass)
          Generic query for a given class of registry objects.
 List<? extends 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 versionName, 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

getExtrinsics

PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> 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 extrinsics
start - index within the results to start at. This index is one based
rows - number of results to get
Returns:
list of extrinsics

getAssociations

PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> 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. If equal to -1 return all.
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

getAuditableEvents

PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query,
                                                 Integer start,
                                                 Integer rows)
Retrieves auditable events from the back end store that match the query and are within the requested results list range

Parameters:
query - to filter against events.
start - index within the results to start at. This index is one based
rows - number of results to get. If equal to -1 return all.
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 ExtrinsicObject, ClassificationNode, Service, etc. Anything that extends from a RegistryObject
Returns:

getRegistryObject

RegistryObject getRegistryObject(String lid,
                                 String versionName,
                                 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.
versionName - 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<? extends 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<? extends 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

getRegistryObjects

PagedResponse<? extends RegistryObject> getRegistryObjects(RegistryQuery<ObjectFilter> query,
                                                           Integer start,
                                                           Integer rows,
                                                           Class<? extends RegistryObject> objectClass)
Generic query for a given class of registry objects. This query only contains attributes that are applicable across all registry objects.

Parameters:
query - based on a set of filters
start - index within the results to start at. This index is one based
rows - number of results to get
objectClass - the type of registry object to look for
Returns:
list of RegistryObject with the given class

hasRegistryObject

boolean hasRegistryObject(String lid,
                          String versionName,
                          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
versionName - registry generated 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 © 2010-2012 Planetary Data System. All Rights Reserved.