@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
JasDBStorageException
public void initializeServices() throws JasDBStorageException
JasDBStorageException
public void addInstance(String instanceId, String path) throws JasDBStorageException
DBInstanceFactory
addInstance
in interface DBInstanceFactory
instanceId
- The instanceIdpath
- The path where the database is locatedConfigurationException
- If unable to configure the instanceJasDBStorageException
public void deleteInstance(String instanceId) throws JasDBStorageException
DBInstanceFactory
deleteInstance
in interface DBInstanceFactory
instanceId
- The instance id to delete all resources forConfigurationException
- If unable to remove the instanceJasDBStorageException
public DBInstance getInstance() throws ConfigurationException
DBInstanceFactory
getInstance
in interface DBInstanceFactory
ConfigurationException
- If unable to configurepublic DBInstance getInstance(String instanceId) throws ConfigurationException
DBInstanceFactory
getInstance
in interface DBInstanceFactory
instanceId
- The name of the instanceConfigurationException
- If unable to load the instancepublic boolean hasInstance(String instanceId)
DBInstanceFactory
hasInstance
in interface DBInstanceFactory
instanceId
- The instanceId to check forpublic List<DBInstance> listInstances()
DBInstanceFactory
listInstances
in interface DBInstanceFactory
public void shutdown() throws ConfigurationException
DBInstanceFactory
shutdown
in interface DBInstanceFactory
ConfigurationException
Copyright © 2015. All rights reserved.