public class CouchDbClient extends CouchDbClientBase
This class is the main object to use to gain access to the APIs.
Create a new client instance:
CouchDbClient dbClient = new CouchDbClient();
Start using the API by the client:
Documents CRUD
APIs is accessed by the client directly, eg.: dbClient.find(Foo.class, "doc-id")
View APIs dbClient.view()
Change Notifications dbClient.changes()
Replication dbClient.replication()
and dbClient.replicator()
DB server dbClient.context()
Design documents dbClient.design()
At the end of a client usage; it's useful to call: shutdown()
to ensure proper release of resources.
CouchDbClientAndroid
Constructor and Description |
---|
CouchDbClient()
Constructs a new instance of this class, expects a configuration file named
couchdb.properties to be available in your application default classpath. |
CouchDbClient(CouchDbProperties properties)
Constructs a new instance of this class.
|
CouchDbClient(String configFileName)
Constructs a new instance of this class.
|
CouchDbClient(String dbName,
boolean createDbIfNotExist,
String protocol,
String host,
int port,
String username,
String password)
Constructs a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
shutdown()
Shuts down the connection manager used by this client instance.
|
batch, bulk, changes, contains, context, design, executeRequest, find, find, find, find, find, findAny, getBaseUri, getDBUri, getGson, invokeUpdateHandler, invokeUpdateHandler, post, remove, remove, replication, replicator, save, saveAttachment, saveAttachment, setGsonBuilder, syncDesignDocsWithDb, update, view
public CouchDbClient()
couchdb.properties
to be available in your application default classpath.public CouchDbClient(String configFileName)
configFileName
- The configuration file name.public CouchDbClient(String dbName, boolean createDbIfNotExist, String protocol, String host, int port, String username, String password)
dbName
- The database name.createDbIfNotExist
- To create a new database if it does not already exist.protocol
- The protocol to use (i.e http or https)host
- The database host addressport
- The database listening portusername
- The Username credentialpassword
- The Password credentialpublic CouchDbClient(CouchDbProperties properties)
properties
- An object containing configuration properties.CouchDbProperties}
public void shutdown()
CouchDbClientBase
Copyright © 2011–2016. All rights reserved.