@Component public class DBInstanceFactoryImpl extends Object implements DBInstanceFactory
| Constructor and Description |
|---|
DBInstanceFactoryImpl(MetadataStore metadataStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInstance(String instanceId,
String path)
Adds a new instance with default configuration with a specified
database path
|
void |
deleteInstance(String instanceId)
Deletes an instance and all of its resources, this operation is destructive and
will remove all data permanently.
|
DBInstance |
getInstance()
Gets the default Database instance
|
DBInstance |
getInstance(String instanceId)
Gets the instance for the specified instance id
|
boolean |
hasInstance(String instanceId)
Returns wether an instanceId exists or not
|
void |
initializeServices() |
List<DBInstance> |
listInstances()
Retrieves a list of all the instances configured
|
void |
shutdown()
Does a shutdown of all the instances
|
@Inject public DBInstanceFactoryImpl(MetadataStore metadataStore) throws JasDBStorageException
JasDBStorageExceptionpublic void initializeServices()
throws JasDBStorageException
JasDBStorageExceptionpublic void addInstance(String instanceId, String path) throws JasDBStorageException
DBInstanceFactoryaddInstance in interface DBInstanceFactoryinstanceId - The instanceIdpath - The path where the database is locatedConfigurationException - If unable to configure the instanceJasDBStorageExceptionpublic void deleteInstance(String instanceId) throws JasDBStorageException
DBInstanceFactorydeleteInstance in interface DBInstanceFactoryinstanceId - The instance id to delete all resources forConfigurationException - If unable to remove the instanceJasDBStorageExceptionpublic DBInstance getInstance() throws ConfigurationException
DBInstanceFactorygetInstance in interface DBInstanceFactoryConfigurationException - If unable to configurepublic DBInstance getInstance(String instanceId) throws ConfigurationException
DBInstanceFactorygetInstance in interface DBInstanceFactoryinstanceId - The name of the instanceConfigurationException - If unable to load the instancepublic boolean hasInstance(String instanceId)
DBInstanceFactoryhasInstance in interface DBInstanceFactoryinstanceId - The instanceId to check forpublic List<DBInstance> listInstances()
DBInstanceFactorylistInstances in interface DBInstanceFactorypublic void shutdown()
throws ConfigurationException
DBInstanceFactoryshutdown in interface DBInstanceFactoryConfigurationExceptionCopyright © 2015. All rights reserved.