Package org.lightcouch
Class CouchDbClientAndroid
- java.lang.Object
-
- org.lightcouch.CouchDbClientBase
-
- org.lightcouch.CouchDbClientAndroid
-
public class CouchDbClientAndroid extends CouchDbClientBase
Presents a client to CouchDB database server; targeted to run on Android platform.- Since:
- 0.1.0
- See Also:
CouchDbClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CouchDbClientAndroid.MySSLSocketFactory
private static class
CouchDbClientAndroid.PreemptiveAuthInterceptor
-
Field Summary
-
Fields inherited from class org.lightcouch.CouchDbClientBase
host, httpClient, log
-
-
Constructor Summary
Constructors Constructor Description CouchDbClientAndroid()
Constructs a new client instance.CouchDbClientAndroid(java.lang.String configFileName)
Constructs a new client instance.CouchDbClientAndroid(java.lang.String dbName, boolean createDbIfNotExist, java.lang.String protocol, java.lang.String host, int port, java.lang.String username, java.lang.String password)
Constructs a new client instance.CouchDbClientAndroid(CouchDbProperties properties)
Constructs a new client instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) org.apache.http.protocol.HttpContext
createContext()
(package private) org.apache.http.client.HttpClient
createHttpClient(CouchDbProperties props)
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 Detail
-
CouchDbClientAndroid
public CouchDbClientAndroid()
Constructs a new client instance.
-
CouchDbClientAndroid
public CouchDbClientAndroid(java.lang.String configFileName)
Constructs a new client instance.- Parameters:
configFileName
- The configuration file
-
CouchDbClientAndroid
public CouchDbClientAndroid(java.lang.String dbName, boolean createDbIfNotExist, java.lang.String protocol, java.lang.String host, int port, java.lang.String username, java.lang.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
public CouchDbClientAndroid(CouchDbProperties properties)
Constructs a new client instance.- Parameters:
properties
- An object containing configuration properties.
-
-
Method Detail
-
createHttpClient
org.apache.http.client.HttpClient createHttpClient(CouchDbProperties props)
- 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 java.security.NoSuchAlgorithmException, java.security.KeyManagementException, java.security.KeyStoreException, java.security.cert.CertificateException, java.io.IOException, java.security.UnrecoverableKeyException
- Throws:
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
java.security.KeyStoreException
java.security.cert.CertificateException
java.io.IOException
java.security.UnrecoverableKeyException
-
registerInterceptors
private void registerInterceptors(org.apache.http.impl.client.DefaultHttpClient httpclient)
-
-