@Repository(value="metadataStore") public class MetadataStoreJPA extends 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(String guid,
Class<? extends RegistryObject> objectClass)
Removes a registry object from the back end store.
|
AffectedInfo |
deleteRegistryObjects(String packageId,
String associationType)
Removes registry object(s) 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
|
javax.persistence.EntityManager |
getEntityManager() |
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.
|
PagedResponse<RegistryPackage> |
getPackages(RegistryQuery<PackageFilter> query,
Integer start,
Integer rows)
Retrieves packages from back end store that match the query and are within
the requested result list range
|
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<RegistryObject> |
getRegistryObjects(Integer start,
Integer rows,
Class<? extends RegistryObject> objectClass)
This method allows paging through registry objects of a given type.
|
PagedResponse |
getRegistryObjects(RegistryQuery<ObjectFilter> query,
Integer start,
Integer rows,
Class<? extends RegistryObject> objectClass)
Generic query for a given class of registry objects.
|
List<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 |
saveRegistryObjects(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(String packageId,
Integer status,
String associationType) |
public void setEntityManager(javax.persistence.EntityManager entityManager)
public javax.persistence.EntityManager getEntityManager()
@Transactional(readOnly=true) public PagedResponse<ExtrinsicObject> getExtrinsics(RegistryQuery<ExtrinsicFilter> query, Integer start, 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, Integer start, 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 List<AuditableEvent> getAuditableEvents(String affectedObject)
MetadataStore
getAuditableEvents
in interface MetadataStore
affectedObject
- guid of a registry object@Transactional(readOnly=true) public List<ClassificationNode> getClassificationNodes(String scheme)
MetadataStore
getClassificationNodes
in interface MetadataStore
scheme
- guid of the scheme@Transactional(readOnly=true) public PagedResponse<Association> getAssociations(RegistryQuery<AssociationFilter> query, Integer start, 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(String guid, 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(List<RegistryObject> registryObjects)
saveRegistryObjects
in interface MetadataStore
@Transactional(readOnly=false, propagation=REQUIRED) public void deleteRegistryObject(String guid, 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(String packageId, String associationType)
MetadataStore
deleteRegistryObjects
in interface MetadataStore
packageId
- of object to removeassociationType
- type of association to remove@Transactional(readOnly=true) public long getNumRegistryObjects(Class<? extends RegistryObject> objectClass)
MetadataStore
getNumRegistryObjects
in interface MetadataStore
objectClass
- type of object to look uppublic RegistryObject getRegistryObject(String lid, String versionName, 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 List<RegistryObject> getRegistryObjectVersions(String lid, 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 List<RegistryObject> getRegistryObjects(Integer start, Integer rows, 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, Integer start, Integer rows, 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(String lid, String versionName, 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(String lid, Class<? extends RegistryObject> objectClass)
MetadataStore
hasRegistryObjectVersions
in interface MetadataStore
lid
- logical id of objectobjectClass
- type of registry object@Transactional(readOnly=true) public boolean hasRegistryObject(String guid, 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(String packageId, Integer status, 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(String scheme, String code)
MetadataStore
hasClassificationNode
in interface MetadataStore
scheme
- guid of the schemecode
- to check for in schemepublic PagedResponse<AuditableEvent> getAuditableEvents(RegistryQuery<EventFilter> query, Integer start, 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–2017 Planetary Data System. All rights reserved.