gov.nasa.pds.registry.service
Interface RegistryService

All Known Implementing Classes:
RegistryServiceImpl

public interface RegistryService

Author:
pramirez

Method Summary
 void changeObjectStatus(String user, String guid, ObjectAction action, Class<? extends RegistryObject> objectClass)
          Changes the status of registry object with the given guid and of the given type
 void changeObjectStatus(String user, String lid, String versionId, ObjectAction action, Class<? extends RegistryObject> objectClass)
          Changes the RegistryObject status with the given identifying information.
 String configure(String user, RegistryPackage registryPackage, List<? extends RegistryObject> list)
          Configures the registry with a list of registry objects as input.
 void deleteObject(String user, String guid, Class<? extends RegistryObject> objectClass)
          Deletes a RegistryObject from the registry which share the logical identifier and version.
 void deleteObject(String user, String lid, String versionId, Class<? extends RegistryObject> objectClass)
          Deletes a RegistryObject from the registry which share the logical identifier and version.
 Association getAssocation(String guid)
          Retrieves the Association from the registry with the given guid
 RegistryResponse getAssociations(AssociationQuery query, Integer start, Integer rows)
          Retrieves a set of associations that match the given query.
 RegistryResponse getAuditableEvents(String affectedObject)
          Retrieves the list of (@link AuditableEvent}'s for the affected object
 List<ClassificationNode> getClassificationNodes(String scheme)
          Retrieves all ClassificationNode for a given ClassificationScheme
 RegistryObject getEarliestObject(String lid, Class<? extends RegistryObject> objectClass)
          Retrieves the earliest version of the RegsitryObject with the given logical identifier
 ExtrinsicObject getExtrinsic(String guid)
          Retrieves a ExtrinsicObject from the registry
 RegistryResponse getExtrinsics(ExtrinsicQuery query)
          Retrieves the first set of extrinsics that match the query
 RegistryResponse getExtrinsics(ExtrinsicQuery query, Integer start, Integer rows)
          Retrieves a set of extinsics that match the given query.
 RegistryResponse getExtrinsics(Integer start, Integer rows)
          This method allows one to page through the ExtrinsicObject's in the registry.
 IdentifierGenerator getIdentifierGenerator()
           
 RegistryObject getLatestObject(String lid, Class<? extends RegistryObject> objectClass)
          Retrieves the latest version of the RegistryObject with the given logical identifier
 MetadataStore getMetadataStore()
          Get access to the back end store for the registry service.
 RegistryObject getNextObject(String lid, String versionId, Class<? extends RegistryObject> objectClass)
          Retrieves the next version of the RegsitryObject
 RegistryObject getObject(String guid, Class<? extends RegistryObject> objectClass)
          Retrieves a registry object of the requested type
 RegistryObject getObject(String lid, String versionId, Class<? extends RegistryObject> objectClass)
          Retrieves a RegistryObject from the registry with the given identifying information.
 RegistryResponse getObjects(ObjectQuery query, Integer start, Integer rows, Class<? extends RegistryObject> objectClass)
          Generic query for a given class of registry objects.
 List<RegistryObject> getObjectVersions(String lid, Class<? extends RegistryObject> objectClass)
          Retrieves all versions of a RegistryObject
 RegistryObject getPreviousObject(String lid, String versionId, Class<? extends RegistryObject> objectClass)
          Retrieves the previous version of the RegistryObject
 Report getReport()
          Gives back some basic summary information about the registry.
 Versioner getVersioner()
           
 String publishObject(String user, RegistryObject registryObject)
          Publishes a registry object to the registry.
 String publishObject(String user, RegistryObject registryObject, String packageId)
          Publishes a registry object to the registry.
 void setIdentifierGenerator(IdentifierGenerator idGenerator)
          Sets the class used to generate unique ids for registry objects
 void setMetadataStore(MetadataStore metadataStore)
          Set where to store all the metadata for registry objects.
 void setVersioner(Versioner versioner)
          Sets the class used to generate and sort versions for registry objects.
 void updateObject(String user, RegistryObject registryObject)
          This method allows one to update all the metadata associated with a registry object.
 String versionObject(String user, String lid, RegistryObject object, boolean major)
          Versions a RegistryObject in the registry and publishes the contents of the provided extrinsic object.
 

Method Detail

setMetadataStore

void setMetadataStore(MetadataStore metadataStore)
Set where to store all the metadata for registry objects. Typically this has a database back end.

Parameters:
metadataStore - for registry object metadata

getMetadataStore

MetadataStore getMetadataStore()
Get access to the back end store for the registry service. Mostly used for internal purposes.

Returns:
metadata store for registry objects

setVersioner

void setVersioner(Versioner versioner)
Sets the class used to generate and sort versions for registry objects.

Parameters:
versioner - to use when generating a new version of a registry object.

getVersioner

Versioner getVersioner()
Returns:
versioner used to generate version for registry objects

setIdentifierGenerator

void setIdentifierGenerator(IdentifierGenerator idGenerator)
Sets the class used to generate unique ids for registry objects

Parameters:
idGenerator - to use to generate a guid for registry objects when there is not one supplied by clients.

getIdentifierGenerator

IdentifierGenerator getIdentifierGenerator()
Returns:
id generator used to generate guids for registry objects

getExtrinsics

RegistryResponse getExtrinsics(Integer start,
                               Integer rows)
This method allows one to page through the ExtrinsicObject's in the registry.

Parameters:
start - the index at which to start the result list from
rows - how many results to return
Returns:
a list of extrinsics

getExtrinsics

RegistryResponse getExtrinsics(ExtrinsicQuery query)
Retrieves the first set of extrinsics that match the query

Parameters:
query - holds a set of filters to match against extrinsics
Returns:
a list of extrinsics

getExtrinsics

RegistryResponse getExtrinsics(ExtrinsicQuery query,
                               Integer start,
                               Integer rows)
Retrieves a set of extinsics that match the given query. Allows one to page through results.

Parameters:
query - holds a set of filters to match against ExtrinsicObject's
start - the index at which to start the result list from. This index starts at one and if anything less than one is provided it will default to one.
rows - how many results to return
Returns:
a list of extrinsics

getReport

Report getReport()
Gives back some basic summary information about the registry. This summary information includes the amount of managed objects.

Returns:
registry status

versionObject

String versionObject(String user,
                     String lid,
                     RegistryObject object,
                     boolean major)
                     throws RegistryServiceException
Versions a RegistryObject in the registry and publishes the contents of the provided extrinsic object.

Parameters:
user - that has taken the action. Typically this should point to a unique username.
lid - logical identifier of the parent extrinsic object
object - the contents for this version of the extrinsic object
major - flag to indicate whether this is a minor or major version
Returns:
the guid of the versioned extrinsic object
Throws:
RegistryServiceException

getLatestObject

RegistryObject getLatestObject(String lid,
                               Class<? extends RegistryObject> objectClass)
Retrieves the latest version of the RegistryObject with the given logical identifier

Parameters:
lid - of extrinsic to look up
Returns:
latest version of extrinsic

getEarliestObject

RegistryObject getEarliestObject(String lid,
                                 Class<? extends RegistryObject> objectClass)
Retrieves the earliest version of the RegsitryObject with the given logical identifier

Parameters:
lid - of registry object to look up
objectClass - the type of object to look up
Returns:
earliest version of registry object

getNextObject

RegistryObject getNextObject(String lid,
                             String versionId,
                             Class<? extends RegistryObject> objectClass)
Retrieves the next version of the RegsitryObject

Parameters:
lid - of the current registry object
versionId - of the current registry object. This is the user provided version.
objectClass - the type of object to look up
Returns:
the next version of the registry object otherwise null if there is no more versions

getPreviousObject

RegistryObject getPreviousObject(String lid,
                                 String versionId,
                                 Class<? extends RegistryObject> objectClass)
Retrieves the previous version of the RegistryObject

Parameters:
lid - of the current registry object
versionId - of the current registry version. This is the user provided version.
objectClass - the type of object to look up
Returns:
the previous version of the registry object otherwise null if there is no versions before the current one

getObjectVersions

List<RegistryObject> getObjectVersions(String lid,
                                       Class<? extends RegistryObject> objectClass)
Retrieves all versions of a RegistryObject

Parameters:
lid - of the registry object of interest
objectClass - the type of object to look up
Returns:
all versions of the registry object that share the given lid

getObject

RegistryObject getObject(String lid,
                         String versionId,
                         Class<? extends RegistryObject> objectClass)
Retrieves a RegistryObject from the registry with the given identifying information.

Parameters:
lid - of the registry object of interest.
versionId - of the registry object of interest. This is the user provided version.
objectClass - the type of object to look up
Returns:
a registry object

getClassificationNodes

List<ClassificationNode> getClassificationNodes(String scheme)
Retrieves all ClassificationNode for a given ClassificationScheme

Parameters:
scheme - guid for which to get the classification nodes for
Returns:
all classification nodes for the scheme's guid

changeObjectStatus

void changeObjectStatus(String user,
                        String lid,
                        String versionId,
                        ObjectAction action,
                        Class<? extends RegistryObject> objectClass)
Changes the RegistryObject status with the given identifying information.

Parameters:
user - that is requesting the change
lid - logical identifier of the extrinsic
versionId - of the registry object. This is the user supplied version
action - which to take (i.e. approve, deprecate, etc.)
objectClass - identifies the type of registry object

changeObjectStatus

void changeObjectStatus(String user,
                        String guid,
                        ObjectAction action,
                        Class<? extends RegistryObject> objectClass)
Changes the status of registry object with the given guid and of the given type

Parameters:
user - that is requesting the change
guid - of the registry object to uniquely identify it
action - which to take (i.e. approve, deprecate, etc.)
objectClass - identifies the type of registry object

updateObject

void updateObject(String user,
                  RegistryObject registryObject)
This method allows one to update all the metadata associated with a registry object.

Parameters:
user - that is requesting the update
registryObject - to update too. The update is made to the object with the same guid

getAssociations

RegistryResponse getAssociations(AssociationQuery query,
                                 Integer start,
                                 Integer rows)
Retrieves a set of associations that match the given query. Allows one to page through results.

Parameters:
query - holds a set of filters to match against Association's
start - the index at which to start the result list from. This index starts at one and if anything less than one is provided it will default to one.
rows - how many results to return
Returns:
a list of associations

getObjects

RegistryResponse getObjects(ObjectQuery 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

getAuditableEvents

RegistryResponse getAuditableEvents(String affectedObject)
Retrieves the list of (@link AuditableEvent}'s for the affected object

Parameters:
affectedObject - guid for the registry object of interest
Returns:
list of events associated with the guid

publishObject

String publishObject(String user,
                     RegistryObject registryObject)
                     throws RegistryServiceException
Publishes a registry object to the registry.

Parameters:
user - that is requesting the object to be published
registryObject - to publish
Returns:
guid of the published object
Throws:
RegistryServiceException

publishObject

String publishObject(String user,
                     RegistryObject registryObject,
                     String packageId)
                     throws RegistryServiceException
Publishes a registry object to the registry.

Parameters:
user - that is requesting the object to be published
registryObject - to publish
packageId - to associate this publish event with
Returns:
guid of the published object
Throws:
RegistryServiceException

deleteObject

void deleteObject(String user,
                  String lid,
                  String versionId,
                  Class<? extends RegistryObject> objectClass)
Deletes a RegistryObject from the registry which share the logical identifier and version.

Parameters:
user - that requested the delete
lid - logical identifier of registry object
versionId - user defined version for the registry object
objectClass - type of registry object

deleteObject

void deleteObject(String user,
                  String guid,
                  Class<? extends RegistryObject> objectClass)
Deletes a RegistryObject from the registry which share the logical identifier and version.

Parameters:
user - that requested the delete
guid - globally unique identifier of the registry object
objectClass - type of registry object

getAssocation

Association getAssocation(String guid)
Retrieves the Association from the registry with the given guid

Parameters:
guid - globally unique identifier of the registry object
Returns:
the identified association

getExtrinsic

ExtrinsicObject getExtrinsic(String guid)
Retrieves a ExtrinsicObject from the registry

Parameters:
guid - globally unique identifier of the extrinsic object
Returns:
matching extrinsic object

getObject

RegistryObject getObject(String guid,
                         Class<? extends RegistryObject> objectClass)
Retrieves a registry object of the requested type

Parameters:
guid - globally unique identifier of the object
objectClass - type of the registry object
Returns:
matching registry object

configure

String configure(String user,
                 RegistryPackage registryPackage,
                 List<? extends RegistryObject> list)
                 throws RegistryServiceException
Configures the registry with a list of registry objects as input. This should be limited to publishing a set of Classification Schemes and Nodes that drive registry function. This would include but not limited to object types and association types.

Parameters:
user - that has taken the action. Typically this should point to a unique username.
registryPackage - to associate objects to
list - classification schemes and nodes that are apart of this config
Returns:
identifier for the package with which the configuration is associated
Throws:
RegistryServiceException


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