@Service(value="registryService") public class RegistryServiceImpl extends Object implements RegistryService
Constructor and Description |
---|
RegistryServiceImpl() |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
changeStatusOfPackageMembersWithQuery(String user,
String packageId,
ObjectAction action) |
String |
configure(String user,
RegistryPackage registryPackage,
List<? extends RegistryObject> registryObjects)
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) |
void |
deletePackageMembers(String user,
String packageId)
Removes all registry objects that are associated with the package.
|
void |
deletePackageMembersWithQuery(String user,
String packageId) |
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 |
RegistryObject |
getLatestObjectWithoutException(String lid,
Class<? extends RegistryObject> objectClass) |
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 |
getNextObject(String lid,
String versionName,
Class<? extends RegistryObject> objectClass) |
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<Association> |
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 |
PagedResponse<RegistryPackage> |
getPackages(RegistryQuery<PackageFilter> query,
Integer start,
Integer rows)
Generic query for a given class of registry packages.
|
RegistryObject |
getPreviousObject(String guid,
Class<? extends RegistryObject> objectClass)
Retrieves the previous version of the
RegistryObject |
RegistryObject |
getPreviousObject(String lid,
String versionName,
Class<? extends RegistryObject> objectClass) |
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,
String objectType,
RegistryPackage replicationPackage)
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 |
publishObjects(String user,
List<? extends RegistryObject> registryObjects) |
void |
publishObjects(String user,
List<? extends RegistryObject> registryObjects,
String packageId) |
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 registryObject,
boolean major)
Versions a
RegistryObject in the registry and publishes the
contents of the provided extrinsic object. |
String |
versionObject(String user,
RegistryObject registryObject,
boolean major,
String packageId)
Versions a
RegistryObject in the registry and publishes the
contents of the provided extrinsic object. |
void |
versionObjects(String user,
List<? extends RegistryObject> registryObjects,
boolean major) |
void |
versionObjects(String user,
List<? extends RegistryObject> registryObjects,
boolean major,
String packageId) |
public void setMetadataStore(MetadataStore metadataStore)
RegistryService
setMetadataStore
in interface RegistryService
metadataStore
- for registry object metadatapublic MetadataStore getMetadataStore()
RegistryService
getMetadataStore
in interface RegistryService
public void setVersioner(Versioner versioner)
RegistryService
setVersioner
in interface RegistryService
versioner
- to use when generating a new version of a registry object.public Versioner getVersioner()
getVersioner
in interface RegistryService
public void setIdentifierGenerator(IdentifierGenerator idGenerator)
RegistryService
setIdentifierGenerator
in interface RegistryService
idGenerator
- to use to generate a guid for registry objects when there is not
one supplied by clients.public IdentifierGenerator getIdentifierGenerator()
getIdentifierGenerator
in interface RegistryService
public PagedResponse<ExtrinsicObject> getExtrinsics(Integer start, Integer rows)
RegistryService
ExtrinsicObject
's in the
registry.getExtrinsics
in interface RegistryService
start
- the index at which to start the result list fromrows
- how many results to returnpublic PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query)
RegistryService
getExtrinsics
in interface RegistryService
query
- holds a set of filters to match against extrinsicspublic PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query, Integer start, Integer rows)
RegistryService
getExtrinsics
in interface RegistryService
query
- holds a set of filters to match against ExtrinsicObject
'sstart
- 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 returnpublic Report getReport()
RegistryService
getReport
in interface RegistryService
public String versionObject(String user, RegistryObject registryObject, boolean major) throws RegistryServiceException
RegistryService
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.versionObject
in interface RegistryService
user
- that has taken the action. Typically this should point to a unique
username.major
- flag to indicate whether this is a minor or major versionRegistryServiceException
public String versionObject(String user, RegistryObject registryObject, boolean major, String packageId) throws RegistryServiceException
RegistryService
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.versionObject
in interface RegistryService
user
- that has taken the action. Typically this should point to a unique
username.registryObject
- the contents for this version of the extrinsic objectmajor
- flag to indicate whether this is a minor or major versionpackageId
- to associate this version event withRegistryServiceException
public void versionObjects(String user, List<? extends RegistryObject> registryObjects, boolean major) throws RegistryServiceException
versionObjects
in interface RegistryService
RegistryServiceException
public void versionObjects(String user, List<? extends RegistryObject> registryObjects, boolean major, String packageId) throws RegistryServiceException
versionObjects
in interface RegistryService
RegistryServiceException
public RegistryObject getLatestObject(String lid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryService
RegistryObject
with the given
logical identifiergetLatestObject
in interface RegistryService
lid
- of extrinsic to look upRegistryServiceException
public RegistryObject getLatestObjectWithoutException(String lid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryServiceException
public RegistryObject getEarliestObject(String lid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryService
RegsitryObject
with the given
logical identifiergetEarliestObject
in interface RegistryService
lid
- of registry object to look upobjectClass
- the type of object to look upRegistryServiceException
public RegistryObject getNextObject(String lid, String versionName, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryServiceException
public RegistryObject getPreviousObject(String lid, String versionName, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryServiceException
public List<RegistryObject> getObjectVersions(String lid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryService
RegistryObject
getObjectVersions
in interface RegistryService
lid
- of the registry object of interestobjectClass
- the type of object to look upRegistryServiceException
public RegistryObject getObject(String lid, String versionName, Class<? extends RegistryObject> objectClass)
getObject
in interface RegistryService
lid
- logical identifier which correlates to a group of related registry
objectsversionName
- that specifially identifies an object withing the groupobjectClass
- type of registry object that is being looked forpublic List<ClassificationNode> getClassificationNodes(String scheme)
RegistryService
ClassificationNode
for a given
ClassificationScheme
getClassificationNodes
in interface RegistryService
scheme
- guid for which to get the classification nodes forpublic void changeObjectStatus(String user, String guid, ObjectAction action, Class<? extends RegistryObject> objectClass)
RegistryService
changeObjectStatus
in interface RegistryService
user
- that is requesting the changeguid
- of the registry object to uniquely identify itaction
- which to take (i.e. approve, deprecate, etc.)objectClass
- identifies the type of registry objectpublic void updateObject(String user, RegistryObject registryObject) throws RegistryServiceException
RegistryService
updateObject
in interface RegistryService
user
- that is requesting the updateregistryObject
- to update too. The update is made to the object with the same guidRegistryServiceException
public PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> query, Integer start, Integer rows)
RegistryService
getAssociations
in interface RegistryService
query
- holds a set of filters to match against Association
'sstart
- 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 returnpublic PagedResponse<Association> getObjects(RegistryQuery<ObjectFilter> query, Integer start, Integer rows, Class<? extends RegistryObject> objectClass)
RegistryService
getObjects
in interface RegistryService
query
- based on a set of filtersstart
- index within the results to start at. This index is one basedrows
- number of results to getobjectClass
- the type of registry object to look forRegistryObject
with the given classpublic PagedResponse<RegistryPackage> getPackages(RegistryQuery<PackageFilter> query, Integer start, Integer rows)
RegistryService
getPackages
in interface RegistryService
query
- based on a set of filtersstart
- index within the results to start at. This index is one basedrows
- number of results to getpublic PagedResponse<AuditableEvent> getAuditableEvents(String affectedObject)
RegistryService
getAuditableEvents
in interface RegistryService
affectedObject
- guid for the registry object of interestpublic String publishObject(String user, RegistryObject registryObject, String packageId) throws RegistryServiceException
RegistryService
publishObject
in interface RegistryService
user
- that is requesting the object to be publishedregistryObject
- to publishpackageId
- to associate this publish event withRegistryServiceException
public void publishObjects(String user, List<? extends RegistryObject> registryObjects, String packageId) throws RegistryServiceException
publishObjects
in interface RegistryService
RegistryServiceException
public String publishObject(String user, RegistryObject registryObject) throws RegistryServiceException
RegistryService
publishObject
in interface RegistryService
user
- that is requesting the object to be publishedregistryObject
- to publishRegistryServiceException
public void publishObjects(String user, List<? extends RegistryObject> registryObjects) throws RegistryServiceException
publishObjects
in interface RegistryService
RegistryServiceException
public void deleteObject(String user, String lid, String versionId, Class<? extends RegistryObject> objectClass)
public void deleteObject(String user, String guid, Class<? extends RegistryObject> objectClass)
RegistryService
RegistryObject
from the registry which share the logical
identifier and version.deleteObject
in interface RegistryService
user
- that requested the deleteguid
- globally unique identifier of the registry objectobjectClass
- type of registry objectpublic Association getAssocation(String guid) throws RegistryServiceException
RegistryService
Association
from the registry with the given guidgetAssocation
in interface RegistryService
guid
- globally unique identifier of the registry objectRegistryServiceException
public ExtrinsicObject getExtrinsic(String guid) throws RegistryServiceException
RegistryService
ExtrinsicObject
from the registrygetExtrinsic
in interface RegistryService
guid
- globally unique identifier of the extrinsic objectRegistryServiceException
public RegistryObject getObject(String guid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryService
getObject
in interface RegistryService
guid
- globally unique identifier of the objectobjectClass
- type of the registry objectRegistryServiceException
public String configure(String user, RegistryPackage registryPackage, List<? extends RegistryObject> registryObjects) throws RegistryServiceException
RegistryService
configure
in interface RegistryService
user
- that has taken the action. Typically this should point to a unique
username.registryPackage
- to associate objects toregistryObjects
- classification schemes and nodes that are apart of this configRegistryServiceException
public RegistryObject getNextObject(String guid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryService
RegsitryObject
getNextObject
in interface RegistryService
guid
- of the registry object to uniquely identify itobjectClass
- the type of object to look upRegistryServiceException
public RegistryObject getPreviousObject(String guid, Class<? extends RegistryObject> objectClass) throws RegistryServiceException
RegistryService
RegistryObject
getPreviousObject
in interface RegistryService
guid
- of the registry object to uniquely identify itobjectClass
- the type of object to look upRegistryServiceException
public void changeStatusOfPackageMembers(String user, String packageId, ObjectAction action)
RegistryService
changeStatusOfPackageMembers
in interface RegistryService
user
- that has taken the action. Typically this should point to a unique
username.packageId
- unique guid of the package to update members status fromaction
- which to take (i.e. approve, deprecate, etc.)public void changeStatusOfPackageMembersWithQuery(String user, String packageId, ObjectAction action)
changeStatusOfPackageMembersWithQuery
in interface RegistryService
public void deletePackageMembers(String user, String packageId) throws RegistryServiceException
RegistryService
deletePackageMembers
in interface RegistryService
user
- that has taken the action. Typically this should point to a unique
username.packageId
- unique guid of the package to delete members fromRegistryServiceException
public void deletePackageMembersWithQuery(String user, String packageId) throws RegistryServiceException
deletePackageMembersWithQuery
in interface RegistryService
RegistryServiceException
public ReplicationReport getReplicationReport()
RegistryService
getReplicationReport
in interface RegistryService
public Boolean hasReplicationInProgress()
RegistryService
hasReplicationInProgress
in interface RegistryService
public void performReplication(String user, String registryUrl, Date lastModified, String objectType, RegistryPackage replicationPackage) throws RegistryServiceException
RegistryService
performReplication
in interface RegistryService
user
- that has taken the action. Typically this should point to a unique
username.registryUrl
- to pull registry object from to replicate locallylastModified
- time to constrain which registry objects are relevant to
replicate. This time is inclusive. If set to null all will be
pulled.objectType
- to filter out registry objects that should be replicated.replicationPackage
- to which replicated items will be associatedRegistryServiceException
- if another replication is already taking placepublic PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query, Integer start, Integer rows)
RegistryService
getAuditableEvents
in interface RegistryService
query
- to filter out eventsstart
- index within the results to start at. This index is one basedrows
- number of results to getCopyright © 2010–2015 Planetary Data System. All rights reserved.