|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.pds.registry.service.MetadataStoreJPA
@Repository(value="metadataStore") public class MetadataStoreJPA
This is a database implementation using Java's persistence library. Any
database that supports JPA can be used in conjunction with this
implementation of a MetadataStore
. To use a different type of
database one would need to update the persistence unit provided via
configuration and injected with Spring.
Constructor Summary | |
---|---|
MetadataStoreJPA()
|
Method Summary | |
---|---|
void |
deleteRegistryObject(String guid,
Class<? extends RegistryObject> objectClass)
Removes a registry object 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. |
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 |
setEntityManager(javax.persistence.EntityManager entityManager)
|
void |
updateRegistryObject(RegistryObject registryObject)
Updates a registry object that shares the guid of the given object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetadataStoreJPA()
Method Detail |
---|
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 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(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=true) public long getNumRegistryObjects(Class<? extends RegistryObject> objectClass)
MetadataStore
getNumRegistryObjects
in interface MetadataStore
objectClass
- type of object to look up
public 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 get
public 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 for
RegistryObject
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=true) public boolean hasClassificationNode(String scheme, String code)
MetadataStore
hasClassificationNode
in interface MetadataStore
scheme
- guid of the schemecode
- to check for in scheme
public 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |