@Component @Singleton public class JasDBMetadataStore extends Object implements MetadataStore
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_INSTANCE |
| Constructor and Description |
|---|
JasDBMetadataStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBag(Bag bag)
Adds a new bag to the storage
|
void |
addBagIndex(String instanceId,
String bagName,
IndexDefinition indexDefinition)
Adds an index to an existing bag in a certain instance
|
void |
addInstance(Instance instance)
Adds an instance using the specified instance metadata
|
long |
addMetadataEntity(SimpleEntity entity)
Generic operation to add a metadata entity to the metadata store
|
void |
closeStore()
Close the store
|
boolean |
containsBag(String instanceId,
String bag)
Checks if a bag in an instance exists in the metadata store
|
boolean |
containsIndex(String instanceId,
String bagName,
IndexDefinition indexDefinition)
Checks if the index is already present in the metadata store
|
boolean |
containsInstance(String instanceId)
Checks if the instance alredy exists
|
void |
deleteMetadataEntity(long recordPointer)
Deletes a generic metadata entity
|
Bag |
getBag(String instanceId,
String name)
Gets the a specific bag in an instance
|
List<Bag> |
getBags(String instanceId)
Gets the bags for the given instanceId
|
Instance |
getInstance(String instanceId)
Gets a specific instance identified by the instanceId
|
List<Instance> |
getInstances()
Gets the registered instances
|
<T extends MetadataProvider> |
getMetadataProvider(String type)
Gets a metadata provider that can handle non standard metadata stored in the metadata store
|
boolean |
isLastShutdownClean()
Checks whether the last shutdown was done cleanly
|
void |
removeBag(String instanceId,
String name)
Remove a bag from the metadata store
|
void |
removeBagIndex(String instanceId,
String bagName,
IndexDefinition indexDefinition) |
void |
removeInstance(String instanceId)
Removes an instance from the metadata list
|
void |
updateInstance(Instance instance)
Updates the instance metadata
|
long |
updateMetadataEntity(SimpleEntity entity,
long previousRecord)
Generic operation to update a metadata entity in the metadata store
|
public static final String DEFAULT_INSTANCE
public JasDBMetadataStore()
throws JasDBStorageException
JasDBStorageExceptionpublic boolean isLastShutdownClean()
throws JasDBStorageException
MetadataStoreisLastShutdownClean in interface MetadataStoreJasDBStorageException - If unable to determine if last shutdown is clean@PreDestroy public void closeStore() throws JasDBStorageException
MetadataStorecloseStore in interface MetadataStoreJasDBStorageException - If unable to close the store cleanlypublic long addMetadataEntity(SimpleEntity entity) throws JasDBStorageException
MetadataStoreaddMetadataEntity in interface MetadataStoreentity - The metadata entity to addJasDBStorageException - If unable to add the metadata entitypublic long updateMetadataEntity(SimpleEntity entity, long previousRecord) throws JasDBStorageException
MetadataStoreupdateMetadataEntity in interface MetadataStoreentity - The updated entitypreviousRecord - The previous record pointerJasDBStorageException - If unable to update the entitypublic void deleteMetadataEntity(long recordPointer)
throws JasDBStorageException
MetadataStoredeleteMetadataEntity in interface MetadataStorerecordPointer - The record pointerJasDBStorageException - If unable to delete the entitypublic List<Bag> getBags(String instanceId) throws JasDBStorageException
MetadataStoregetBags in interface MetadataStoreinstanceId - The instanceIdJasDBStorageException - If unable to load the bagspublic Bag getBag(String instanceId, String name) throws JasDBStorageException
MetadataStoregetBag in interface MetadataStoreinstanceId - The instanceIdname - The name of the bagJasDBStorageException - If unable to load the bagpublic boolean containsBag(String instanceId, String bag) throws JasDBStorageException
MetadataStorecontainsBag in interface MetadataStoreinstanceId - The instance in which the bag should existbag - The bag that should existJasDBStorageException - If unable to check if the bag exists in the instancepublic void addBag(Bag bag) throws JasDBStorageException
MetadataStoreaddBag in interface MetadataStorebag - The bag to addJasDBStorageException - If unable to add the bagpublic void removeBag(String instanceId, String name) throws JasDBStorageException
MetadataStoreremoveBag in interface MetadataStoreinstanceId - The name of the instance holding the bagname - The name of the bagJasDBStorageException - If unable to remove the bagpublic void addBagIndex(String instanceId, String bagName, IndexDefinition indexDefinition) throws JasDBStorageException
MetadataStoreaddBagIndex in interface MetadataStoreinstanceId - The instance that contains the bagbagName - The bag to add the index toindexDefinition - The index definitionJasDBStorageException - If unable to add the indexpublic void removeBagIndex(String instanceId, String bagName, IndexDefinition indexDefinition) throws JasDBStorageException
removeBagIndex in interface MetadataStoreinstanceId - The instance that contains the bagbagName - The bag to remove the index fromindexDefinition - The index definitionJasDBStorageException - If unable to remove the indexpublic boolean containsIndex(String instanceId, String bagName, IndexDefinition indexDefinition) throws JasDBStorageException
MetadataStorecontainsIndex in interface MetadataStoreinstanceId - The instance that contains the bagbagName - The bag to check the index presence onindexDefinition - The index definitionJasDBStorageException - If unable to check if the index is presentpublic List<Instance> getInstances() throws JasDBStorageException
MetadataStoregetInstances in interface MetadataStoreJasDBStorageException - If unable to get the list of instancespublic Instance getInstance(String instanceId) throws JasDBStorageException
MetadataStoregetInstance in interface MetadataStoreinstanceId - The instanceIdJasDBStorageException - If unable to get the instancepublic boolean containsInstance(String instanceId) throws JasDBStorageException
MetadataStorecontainsInstance in interface MetadataStoreinstanceId - The instanceIdJasDBStorageException - If unable to check if the instance existspublic void addInstance(Instance instance) throws JasDBStorageException
MetadataStoreaddInstance in interface MetadataStoreinstance - The instanceJasDBStorageException - If unable to add the instancepublic void removeInstance(String instanceId) throws JasDBStorageException
MetadataStoreremoveInstance in interface MetadataStoreinstanceId - The instance to removeJasDBStorageException - If unable to remove the instancepublic void updateInstance(Instance instance) throws JasDBStorageException
MetadataStoreupdateInstance in interface MetadataStoreinstance - The instanceJasDBStorageException - If unable to update the instancepublic <T extends MetadataProvider> T getMetadataProvider(String type)
MetadataStoregetMetadataProvider in interface MetadataStoreT - The subtype of the metadata providertype - The type of metadata provider requestedCopyright © 2015. All rights reserved.