Package org.lightcouch
Class CouchDbClientAndroid
java.lang.Object
org.lightcouch.CouchDbClientBase
org.lightcouch.CouchDbClientAndroid
Presents a client to CouchDB database server; targeted to run on Android platform.
- Since:
- 0.1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
Fields inherited from class org.lightcouch.CouchDbClientBase
host, httpClient, log
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new client instance.CouchDbClientAndroid
(String configFileName) Constructs a new client instance.CouchDbClientAndroid
(String dbName, boolean createDbIfNotExist, String protocol, String host, int port, String username, String password) Constructs a new client instance.CouchDbClientAndroid
(CouchDbProperties properties) Constructs a new client instance. -
Method Summary
Modifier and TypeMethodDescription(package private) org.apache.http.protocol.HttpContext
(package private) org.apache.http.client.HttpClient
private org.apache.http.conn.scheme.SchemeRegistry
createRegistry
(CouchDbProperties properties) private void
registerInterceptors
(org.apache.http.impl.client.DefaultHttpClient httpclient) void
shutdown()
Shuts down the connection manager used by this client instance.Methods inherited from class org.lightcouch.CouchDbClientBase
batch, bulk, changes, contains, context, delete, design, executeRequest, find, find, find, find, find, findAny, findDocs, get, get, get, getBaseUri, getDBUri, getGson, head, invokeUpdateHandler, post, post, put, put, remove, remove, replication, replicator, save, saveAttachment, saveAttachment, setGsonBuilder, syncDesignDocsWithDb, update, validate, view
-
Constructor Details
-
CouchDbClientAndroid
public CouchDbClientAndroid()Constructs a new client instance. -
CouchDbClientAndroid
Constructs a new client instance.- Parameters:
configFileName
- The configuration file
-
CouchDbClientAndroid
public CouchDbClientAndroid(String dbName, boolean createDbIfNotExist, String protocol, String host, int port, String username, String password) Constructs a new client instance.- Parameters:
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 credential
-
CouchDbClientAndroid
Constructs a new client instance.- Parameters:
properties
- An object containing configuration properties.
-
-
Method Details
-
createHttpClient
- Specified by:
createHttpClient
in classCouchDbClientBase
- Returns:
DefaultHttpClient
instance.
-
createContext
org.apache.http.protocol.HttpContext createContext()- Specified by:
createContext
in classCouchDbClientBase
- Returns:
HttpContext
instance for HTTP request execution.
-
shutdown
public void shutdown()Description copied from class:CouchDbClientBase
Shuts down the connection manager used by this client instance.- Specified by:
shutdown
in classCouchDbClientBase
-
createRegistry
private org.apache.http.conn.scheme.SchemeRegistry createRegistry(CouchDbProperties properties) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, CertificateException, IOException, UnrecoverableKeyException -
registerInterceptors
private void registerInterceptors(org.apache.http.impl.client.DefaultHttpClient httpclient)
-