public class StdCouchDbInstance extends Object implements CouchDbInstance
Constructor and Description |
---|
StdCouchDbInstance(HttpClient client) |
StdCouchDbInstance(HttpClient client,
ObjectMapperFactory of) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkIfDbExists(DbPath db) |
boolean |
checkIfDbExists(String path) |
CouchDbConnector |
createConnector(String path,
boolean createIfNotExists) |
void |
createDatabase(DbPath db) |
void |
createDatabase(String path) |
String |
deleteConfiguration(String section,
String key)
Delete the configuration key in the specified section
|
void |
deleteDatabase(String path) |
Collection<ActiveTask> |
getActiveTasks() |
List<String> |
getAllDatabases() |
<T> T |
getConfiguration(Class<T> c)
Get the full configuration of this instance
|
<T> T |
getConfiguration(Class<T> c,
String section)
Get the configuration of this instance within the specified section
|
<T> T |
getConfiguration(Class<T> c,
String section,
String key)
Get the configuration of this instance for this specific section and key
|
String |
getConfiguration(String section,
String key)
Convenience method to get specific configuration item
|
HttpClient |
getConnection()
Convenience method for accessing the underlying HttpClient.
|
CouchDbConnector |
getReplicatorConnector()
Returns the Couch _replicator database
|
ReplicationStatus |
replicate(ReplicationCommand cmd) |
String |
setConfiguration(String section,
String key,
String value)
Update the configuration key in the specified section with the specified value
|
public StdCouchDbInstance(HttpClient client)
public StdCouchDbInstance(HttpClient client, ObjectMapperFactory of)
public void createDatabase(String path)
createDatabase
in interface CouchDbInstance
public void createDatabase(DbPath db)
createDatabase
in interface CouchDbInstance
public void deleteDatabase(String path)
deleteDatabase
in interface CouchDbInstance
public boolean checkIfDbExists(String path)
checkIfDbExists
in interface CouchDbInstance
public boolean checkIfDbExists(DbPath db)
checkIfDbExists
in interface CouchDbInstance
public List<String> getAllDatabases()
getAllDatabases
in interface CouchDbInstance
public ReplicationStatus replicate(ReplicationCommand cmd)
replicate
in interface CouchDbInstance
public HttpClient getConnection()
CouchDbInstance
getConnection
in interface CouchDbInstance
public CouchDbConnector createConnector(String path, boolean createIfNotExists)
createConnector
in interface CouchDbInstance
public CouchDbConnector getReplicatorConnector()
CouchDbInstance
getReplicatorConnector
in interface CouchDbInstance
public <T> T getConfiguration(Class<T> c)
CouchDbInstance
getConfiguration
in interface CouchDbInstance
c
- the type to return the configuration in (Map, JsonNode, POJO)public <T> T getConfiguration(Class<T> c, String section)
CouchDbInstance
getConfiguration
in interface CouchDbInstance
c
- the type to return the configuration in (Map, JsonNode, POJO)public <T> T getConfiguration(Class<T> c, String section, String key)
CouchDbInstance
getConfiguration
in interface CouchDbInstance
c
- the type to return the configuration in (Map, JsonNode, POJO)public String getConfiguration(String section, String key)
CouchDbInstance
getConfiguration
in interface CouchDbInstance
public String setConfiguration(String section, String key, String value)
CouchDbInstance
setConfiguration
in interface CouchDbInstance
value
- the value to set (all config values are Strings in CouchDB)public String deleteConfiguration(String section, String key)
CouchDbInstance
deleteConfiguration
in interface CouchDbInstance
public Collection<ActiveTask> getActiveTasks()
getActiveTasks
in interface CouchDbInstance
Copyright © 2013. All Rights Reserved.