org.ektorp
Interface CouchDbInstance

All Known Implementing Classes:
StdCouchDbInstance

public interface CouchDbInstance

Author:
henrik lundgren

Method Summary
 boolean checkIfDbExists(DbPath db)
           
 boolean checkIfDbExists(String path)
           
 CouchDbConnector createConnector(String path, boolean createIfNotExists)
           
 void createDatabase(DbPath path)
           
 void createDatabase(String path)
           
 boolean createDatabaseIfNotExists(DbPath path)
           
 boolean createDatabaseIfNotExists(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
 

Method Detail

getAllDatabases

List<String> getAllDatabases()
Returns:
the names of all databases residing in this instance.

checkIfDbExists

boolean checkIfDbExists(DbPath db)
Parameters:
db -
Returns:
true if the database exists.

checkIfDbExists

boolean checkIfDbExists(String path)

createDatabase

void createDatabase(DbPath path)

createDatabase

void createDatabase(String path)

createDatabaseIfNotExists

boolean createDatabaseIfNotExists(DbPath path)

createDatabaseIfNotExists

boolean createDatabaseIfNotExists(String path)

deleteDatabase

void deleteDatabase(String path)

createConnector

CouchDbConnector createConnector(String path,
                                 boolean createIfNotExists)
Parameters:
path -
createIfNotExists -
Returns:

getReplicatorConnector

CouchDbConnector getReplicatorConnector()
Returns the Couch _replicator database

Returns:
CouchDbConnector a connector to the replicator database

getConnection

HttpClient getConnection()
Convenience method for accessing the underlying HttpClient. Preferably used wrapped in a org.ektorp.http.RestTemplate.

Returns:

replicate

ReplicationStatus replicate(ReplicationCommand cmd)

getConfiguration

<T> T getConfiguration(Class<T> c)
Get the full configuration of this instance

Parameters:
c - the type to return the configuration in (Map, JsonNode, POJO)
Returns:

getConfiguration

<T> T getConfiguration(Class<T> c,
                       String section)
Get the configuration of this instance within the specified section

Parameters:
c - the type to return the configuration in (Map, JsonNode, POJO)
section -
Returns:

getConfiguration

<T> T getConfiguration(Class<T> c,
                       String section,
                       String key)
Get the configuration of this instance for this specific section and key

Parameters:
c - the type to return the configuration in (Map, JsonNode, POJO)
section -
key -
Returns:

getConfiguration

String getConfiguration(String section,
                        String key)
Convenience method to get specific configuration item

Parameters:
section -
key -
Returns:
the configuration value for the specified key in the specified section

setConfiguration

String setConfiguration(String section,
                        String key,
                        String value)
Update the configuration key in the specified section with the specified value

Parameters:
section -
key -
value - the value to set (all config values are Strings in CouchDB)
Returns:
the previous value for this key

deleteConfiguration

String deleteConfiguration(String section,
                           String key)
Delete the configuration key in the specified section

Parameters:
section -
key -
Returns:
the previous value for this key

getActiveTasks

Collection<ActiveTask> getActiveTasks()
Returns:
all active tasks


Copyright © 2017. All rights reserved.