@Repository(value="metadataStore") public class MetadataStoreJPA extends java.lang.Object implements MetadataStore
MetadataStore
. To use a different type of
database one would need to update the persistence unit provided via
configuration and injected with Spring.Constructor and Description |
---|
MetadataStoreJPA() |
Modifier and Type | Method and Description |
---|---|
void |
deleteRegistryObject(java.lang.String guid,
java.lang.Class<? extends RegistryObject> objectClass)
Removes a registry object from the back end store.
|
AffectedInfo |
deleteRegistryObjects(java.lang.String packageId,
java.lang.String associationType)
Removes registry object(s) from the back end store.
|
PagedResponse<Association> |
getAssociations(RegistryQuery<AssociationFilter> query,
java.lang.Integer start,
java.lang.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,
java.lang.Integer start,
java.lang.Integer rows)
Retrieves auditable events from the back end store that match the query and are
within the requested results list range
|
java.util.List<AuditableEvent> |
getAuditableEvents(java.lang.String affectedObject)
Retrieves the list of events that the given affected object was referenced
in
|
java.util.List<ClassificationNode> |
getClassificationNodes(java.lang.String scheme)
Retrieves the list of classification nodes which fall under a given
classification scheme
|
javax.persistence.EntityManager |
getEntityManager() |
PagedResponse<ExtrinsicObject> |
getExtrinsics(RegistryQuery<ExtrinsicFilter> query,
java.lang.Integer start,
java.lang.Integer rows)
Retrieves products from back end store that match the query and are within
the requested result list range
|
long |
getNumRegistryObjects(java.lang.Class<? extends RegistryObject> objectClass)
Gets the count of registry objects managed in the backed of a given type.
|
PagedResponse<RegistryPackage> |
getPackages(RegistryQuery<PackageFilter> query,
java.lang.Integer start,
java.lang.Integer rows)
Retrieves packages from back end store that match the query and are within
the requested result list range
|
RegistryObject |
getRegistryObject(java.lang.String guid,
java.lang.Class<? extends RegistryObject> objectClass)
Returns the registry object with a given guid and of the given type
|
RegistryObject |
getRegistryObject(java.lang.String lid,
java.lang.String versionName,
java.lang.Class<? extends RegistryObject> objectClass)
Retrieves a registry object that is identified by its logical identifier
and user supplied version.
|
java.util.List<RegistryObject> |
getRegistryObjects(java.lang.Integer start,
java.lang.Integer rows,
java.lang.Class<? extends RegistryObject> objectClass)
This method allows paging through registry objects of a given type.
|
PagedResponse |
getRegistryObjects(RegistryQuery<ObjectFilter> query,
java.lang.Integer start,
java.lang.Integer rows,
java.lang.Class<? extends RegistryObject> objectClass)
Generic query for a given class of registry objects.
|
java.util.List<RegistryObject> |
getRegistryObjectVersions(java.lang.String lid,
java.lang.Class<? extends RegistryObject> objectClass)
Returns all versions of a registry object that share a logical identifier
|
boolean |
hasClassificationNode(java.lang.String scheme,
java.lang.String code)
Checks to see if a code exists within a classification scheme
|
boolean |
hasRegistryObject(java.lang.String guid,
java.lang.Class<? extends RegistryObject> objectClass)
Test to see if a registry object exists with a guid and type requested.
|
boolean |
hasRegistryObject(java.lang.String lid,
java.lang.String versionName,
java.lang.Class<? extends RegistryObject> objectClass)
Test to see if a registry object exists with a logical identifier, version,
and type requested.
|
boolean |
hasRegistryObjectVersions(java.lang.String lid,
java.lang.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 |
saveRegistryObjects(java.util.List<RegistryObject> registryObjects) |
void |
setEntityManager(javax.persistence.EntityManager entityManager) |
void |
updateRegistryObject(RegistryObject registryObject)
Updates a registry object that shares the guid of the given object
|
AffectedInfo |
updateRegistryObjects(java.lang.String packageId,
java.lang.Integer status,
java.lang.String associationType) |
public void setEntityManager(javax.persistence.EntityManager entityManager)
public javax.persistence.EntityManager getEntityManager()
@Transactional(readOnly=true) public PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query, java.lang.Integer start, java.lang.Integer rows)
MetadataStore
getExtrinsics
in interface MetadataStore
query
- to filter against extrinsicsstart
- index within the results to start at. This index is one basedrows
- number of results to get@Transactional(readOnly=true) public PagedResponse<RegistryPackage> getPackages(RegistryQuery<PackageFilter> query, java.lang.Integer start, java.lang.Integer rows)
MetadataStore
getPackages
in interface MetadataStore
query
- to filter against packagesstart
- index within the results to start at. This index is one basedrows
- number of results to get@Transactional(readOnly=true) public java.util.List<AuditableEvent> getAuditableEvents(java.lang.String affectedObject)
MetadataStore
getAuditableEvents
in interface MetadataStore
affectedObject
- guid of a registry object@Transactional(readOnly=true) public java.util.List<ClassificationNode> getClassificationNodes(java.lang.String scheme)
MetadataStore
getClassificationNodes
in interface MetadataStore
scheme
- guid of the scheme@Transactional(readOnly=true) public PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> query, java.lang.Integer start, java.lang.Integer rows)
MetadataStore
getAssociations
in interface MetadataStore
query
- to filter against associations.start
- index within the results to start at. This index is one basedrows
- number of results to get. If equal to -1 return all.@Transactional(readOnly=true) public RegistryObject getRegistryObject(java.lang.String guid, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
getRegistryObject
in interface MetadataStore
guid
- of requested registry objectobjectClass
- type of object. For instance, a ExtrinsicObject
,
ClassificationNode
, Service
, etc. Anything that
extends from a RegistryObject
@Transactional(readOnly=false, propagation=REQUIRED) public void saveRegistryObject(RegistryObject registryObject)
MetadataStore
saveRegistryObject
in interface MetadataStore
registryObject
- to store@Transactional(propagation=REQUIRED, isolation=DEFAULT, readOnly=false) public void saveRegistryObjects(java.util.List<RegistryObject> registryObjects)
saveRegistryObjects
in interface MetadataStore
@Transactional(readOnly=false, propagation=REQUIRED) public void deleteRegistryObject(java.lang.String guid, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
deleteRegistryObject
in interface MetadataStore
guid
- of object to removeobjectClass
- type of object to remove@Transactional(readOnly=false, propagation=REQUIRED) public AffectedInfo deleteRegistryObjects(java.lang.String packageId, java.lang.String associationType)
MetadataStore
deleteRegistryObjects
in interface MetadataStore
packageId
- of object to removeassociationType
- type of association to remove@Transactional(readOnly=true) public long getNumRegistryObjects(java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
getNumRegistryObjects
in interface MetadataStore
objectClass
- type of object to look uppublic RegistryObject getRegistryObject(java.lang.String lid, java.lang.String versionName, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
getRegistryObject
in interface MetadataStore
lid
- logical identifier of registry object.versionName
- version of registry object.objectClass
- type of registry object.@Transactional(readOnly=true) public java.util.List<RegistryObject> getRegistryObjectVersions(java.lang.String lid, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
getRegistryObjectVersions
in interface MetadataStore
lid
- logical identifier of objects to look upobjectClass
- type of registry object@Transactional(readOnly=true) public java.util.List<RegistryObject> getRegistryObjects(java.lang.Integer start, java.lang.Integer rows, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
getRegistryObjects
in interface MetadataStore
start
- index within the results to start at. This index is one basedrows
- number of results to getobjectClass
- type of object to getpublic PagedResponse getRegistryObjects(RegistryQuery<ObjectFilter> query, java.lang.Integer start, java.lang.Integer rows, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
getRegistryObjects
in interface MetadataStore
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 class@Transactional(readOnly=true) public boolean hasRegistryObject(java.lang.String lid, java.lang.String versionName, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
hasRegistryObject
in interface MetadataStore
lid
- logical id of objectversionName
- registry generated versionobjectClass
- type of registry object@Transactional(readOnly=true) public boolean hasRegistryObjectVersions(java.lang.String lid, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
hasRegistryObjectVersions
in interface MetadataStore
lid
- logical id of objectobjectClass
- type of registry object@Transactional(readOnly=true) public boolean hasRegistryObject(java.lang.String guid, java.lang.Class<? extends RegistryObject> objectClass)
MetadataStore
hasRegistryObject
in interface MetadataStore
guid
- globally unique identifier of objectobjectClass
- type of registry object@Transactional(readOnly=false, propagation=REQUIRED) public void updateRegistryObject(RegistryObject registryObject)
MetadataStore
updateRegistryObject
in interface MetadataStore
registryObject
- to update too@Transactional(readOnly=false, propagation=REQUIRED) public AffectedInfo updateRegistryObjects(java.lang.String packageId, java.lang.Integer status, java.lang.String associationType)
updateRegistryObjects
in interface MetadataStore
packageId
- of package member objects to updatestatus
- value of status (0=submitted, 1=approved, 2=deprecated)associationType
- type of association@Transactional(readOnly=true) public boolean hasClassificationNode(java.lang.String scheme, java.lang.String code)
MetadataStore
hasClassificationNode
in interface MetadataStore
scheme
- guid of the schemecode
- to check for in schemepublic PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query, java.lang.Integer start, java.lang.Integer rows)
MetadataStore
getAuditableEvents
in interface MetadataStore
query
- to filter against events.start
- index within the results to start at. This index is one basedrows
- number of results to get. If equal to -1 return all.Copyright © 2010-2019 Planetary Data System. All Rights Reserved.