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 changeStatusOfPackageMembers(String user, String packageId, ObjectAction action)
          Changes the status of all registry objects that are members of the package.
 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 deletePackageMembers(String user, String packageId)
          Removes all registry objects that are associated with the package.
 Association getAssocation(String guid)
          Retrieves the Association from the registry with the given guid
 PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> query, Integer start, Integer rows)
          Retrieves a set of associations that match the given query.
 PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query, Integer start, Integer rows)
          Retrieves the list of (@link AuditableEvent}'s matching the query
 PagedResponse<AuditableEvent> 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
 PagedResponse<ExtrinsicObject> getExtrinsics(Integer start, Integer rows)
          This method allows one to page through the ExtrinsicObject's in the registry.
 PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query)
          Retrieves the first set of extrinsics that match the query
 PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query, Integer start, Integer rows)
          Retrieves a set of extinsics that match the given query.
 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 guid, 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 versionName, Class<? extends RegistryObject> objectClass)
           
 PagedResponse<? extends RegistryObject> getObjects(RegistryQuery<ObjectFilter> 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 guid, Class<? extends RegistryObject> objectClass)
          Retrieves the previous version of the RegistryObject
 ReplicationReport getReplicationReport()
          Get the inform about the current replication event.
 Report getReport()
          Gives back some basic summary information about the registry.
 Versioner getVersioner()
           
 Boolean hasReplicationInProgress()
          A check to see if replication is currently under way by the registry.
 void performReplication(String user, String registryUrl, Date lastModified)
          Replicates contents from a remote registry connected to using the provided URL.
 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, 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

PagedResponse<ExtrinsicObject> 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

PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> 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

PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> 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,
                     RegistryObject object,
                     boolean major)
                     throws RegistryServiceException
Versions a RegistryObject in the registry and publishes the contents of the provided extrinsic object. A registry object with the the same lid must be already published otherwise there will be nothing to version off of.

Parameters:
user - that has taken the action. Typically this should point to a unique username.
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)
                               throws RegistryServiceException
Retrieves the latest version of the RegistryObject with the given logical identifier

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

getEarliestObject

RegistryObject getEarliestObject(String lid,
                                 Class<? extends RegistryObject> objectClass)
                                 throws RegistryServiceException
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
Throws:
RegistryServiceException

getNextObject

RegistryObject getNextObject(String guid,
                             Class<? extends RegistryObject> objectClass)
                             throws RegistryServiceException
Retrieves the next version of the RegsitryObject

Parameters:
guid - of the registry object to uniquely identify it
objectClass - the type of object to look up
Returns:
the next version of the registry object otherwise null if there is no more versions
Throws:
RegistryServiceException

getPreviousObject

RegistryObject getPreviousObject(String guid,
                                 Class<? extends RegistryObject> objectClass)
                                 throws RegistryServiceException
Retrieves the previous version of the RegistryObject

Parameters:
guid - of the registry object to uniquely identify it
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
Throws:
RegistryServiceException

getObjectVersions

List<RegistryObject> getObjectVersions(String lid,
                                       Class<? extends RegistryObject> objectClass)
                                       throws RegistryServiceException
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
Throws:
RegistryServiceException

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 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

PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> 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

PagedResponse<? extends RegistryObject> getObjects(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

getAuditableEvents

PagedResponse<AuditableEvent> 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

getAuditableEvents

PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query,
                                                 Integer start,
                                                 Integer rows)
Retrieves the list of (@link AuditableEvent}'s matching the query

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

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 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)
                          throws RegistryServiceException
Retrieves the Association from the registry with the given guid

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

getExtrinsic

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

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

getObject

RegistryObject getObject(String guid,
                         Class<? extends RegistryObject> objectClass)
                         throws RegistryServiceException
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
Throws:
RegistryServiceException

getObject

RegistryObject getObject(String lid,
                         String versionName,
                         Class<? extends RegistryObject> objectClass)
Parameters:
lid - logical identifier which correlates to a group of related registry objects
versionName - that specifially identifies an object withing the group
objectClass - type of registry object that is being looked for
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

deletePackageMembers

void deletePackageMembers(String user,
                          String packageId)
                          throws RegistryServiceException
Removes all registry objects that are associated with the package. This call will not delete the package itself.

Parameters:
user - that has taken the action. Typically this should point to a unique username.
packageId - unique guid of the package to delete members from
Throws:
RegistryServiceException

changeStatusOfPackageMembers

void changeStatusOfPackageMembers(String user,
                                  String packageId,
                                  ObjectAction action)
                                  throws RegistryServiceException
Changes the status of all registry objects that are members of the package. This will not change the status on the package itself.

Parameters:
user - that has taken the action. Typically this should point to a unique username.
packageId - unique guid of the package to update members status from
action - which to take (i.e. approve, deprecate, etc.)
Throws:
RegistryServiceException

performReplication

void performReplication(String user,
                        String registryUrl,
                        Date lastModified)
                        throws RegistryServiceException
Replicates contents from a remote registry connected to using the provided URL. Items that have been delete, updated, or added will be replicated in the local registry. Only one replication event can happen at a given time.

Parameters:
user - that has taken the action. Typically this should point to a unique username.
registryUrl - to pull registry object from to replicate locally
lastModified - time to constrain which registry objects are relevant to replicate. This time is inclusive. If set to null all will be pulled.
Throws:
RegistryServiceException - if another replication is already taking place

getReplicationReport

ReplicationReport getReplicationReport()
Get the inform about the current replication event.

Returns:
report statistics about the replication event that was last completed or in process

hasReplicationInProgress

Boolean hasReplicationInProgress()
A check to see if replication is currently under way by the registry.

Returns:
flag to indicate in progress (true) or completed/none pending (false)


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