Package org.apache.qpid.server.store
Class JsonFileConfigStore
- java.lang.Object
-
- org.apache.qpid.server.store.AbstractJsonFileStore
-
- org.apache.qpid.server.store.JsonFileConfigStore
-
- All Implemented Interfaces:
DurableConfigurationStore
public class JsonFileConfigStore extends AbstractJsonFileStore implements DurableConfigurationStore
-
-
Constructor Summary
Constructors Constructor Description JsonFileConfigStore(Class<? extends ConfiguredObject> rootClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeConfigurationStore()
void
create(ConfiguredObjectRecord record)
Makes the specified object persistent.protected com.fasterxml.jackson.databind.ObjectMapper
getSerialisationObjectMapper()
void
init(ConfiguredObject<?> parent)
Initializes and opens the configuration store.protected boolean
load(ConfiguredObjectRecord... initialRecords)
void
onDelete(ConfiguredObject<?> parent)
Deletes the configuration store from its underlying storage.boolean
openConfigurationStore(ConfiguredObjectRecordHandler handler, ConfiguredObjectRecord... initialRecords)
Visit all configured object records with given handler.void
reload(ConfiguredObjectRecordHandler handler)
UUID[]
remove(ConfiguredObjectRecord... objects)
Removes the specified persistent configured objects.void
update(boolean createIfNecessary, ConfiguredObjectRecord... records)
Updates the specified objects in the persistent store, IF it is already present.void
upgradeStoreStructure()
Requests that the store performs any upgrade work on the store's structure.-
Methods inherited from class org.apache.qpid.server.store.AbstractJsonFileStore
cleanup, delete, getConfigFile, save, setup
-
-
-
-
Constructor Detail
-
JsonFileConfigStore
public JsonFileConfigStore(Class<? extends ConfiguredObject> rootClass)
-
-
Method Detail
-
upgradeStoreStructure
public void upgradeStoreStructure() throws StoreException
Description copied from interface:DurableConfigurationStore
Requests that the store performs any upgrade work on the store's structure. If there is no upgrade work to be done, this method should return without doing anything.- Specified by:
upgradeStoreStructure
in interfaceDurableConfigurationStore
- Throws:
StoreException
- signals that a problem was encountered trying to upgrade the store. Implementations, on encountering a problem, should endeavour to leave the store in its original state.
-
init
public void init(ConfiguredObject<?> parent)
Description copied from interface:DurableConfigurationStore
Initializes and opens the configuration store.- Specified by:
init
in interfaceDurableConfigurationStore
-
openConfigurationStore
public boolean openConfigurationStore(ConfiguredObjectRecordHandler handler, ConfiguredObjectRecord... initialRecords)
Description copied from interface:DurableConfigurationStore
Visit all configured object records with given handler.- Specified by:
openConfigurationStore
in interfaceDurableConfigurationStore
- Parameters:
handler
- a handler to invoke on each configured object record
-
reload
public void reload(ConfiguredObjectRecordHandler handler)
- Specified by:
reload
in interfaceDurableConfigurationStore
-
load
protected boolean load(ConfiguredObjectRecord... initialRecords)
-
create
public void create(ConfiguredObjectRecord record) throws StoreException
Description copied from interface:DurableConfigurationStore
Makes the specified object persistent.- Specified by:
create
in interfaceDurableConfigurationStore
- Parameters:
record
- The object to persist.- Throws:
StoreException
- If the operation fails for any reason.
-
remove
public UUID[] remove(ConfiguredObjectRecord... objects) throws StoreException
Description copied from interface:DurableConfigurationStore
Removes the specified persistent configured objects.- Specified by:
remove
in interfaceDurableConfigurationStore
- Parameters:
objects
- The objects to remove.- Throws:
StoreException
- If the operation fails for any reason.
-
update
public void update(boolean createIfNecessary, ConfiguredObjectRecord... records) throws StoreException
Description copied from interface:DurableConfigurationStore
Updates the specified objects in the persistent store, IF it is already present. If the object is not present in the store, it will only be added if createIfNecessary is set to true, otherwise an exception will be thrown.- Specified by:
update
in interfaceDurableConfigurationStore
- Parameters:
createIfNecessary
- if false then will fail if the object does not exist.records
- the records to update- Throws:
StoreException
- If the operation fails for any reason.
-
closeConfigurationStore
public void closeConfigurationStore()
- Specified by:
closeConfigurationStore
in interfaceDurableConfigurationStore
-
onDelete
public void onDelete(ConfiguredObject<?> parent)
Description copied from interface:DurableConfigurationStore
Deletes the configuration store from its underlying storage. If the store has not be opened, then this call will be ignored. The store should be closed before making this call.- Specified by:
onDelete
in interfaceDurableConfigurationStore
-
getSerialisationObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getSerialisationObjectMapper()
- Specified by:
getSerialisationObjectMapper
in classAbstractJsonFileStore
-
-