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 classCouchDbClientAndroid.MySSLSocketFactoryprivate static classCouchDbClientAndroid.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.HttpContextcreateContext()(package private) org.apache.http.client.HttpClientcreateHttpClient(CouchDbProperties props)private org.apache.http.conn.scheme.SchemeRegistrycreateRegistry(CouchDbProperties properties)private voidregisterInterceptors(org.apache.http.impl.client.DefaultHttpClient httpclient)voidshutdown()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:
createHttpClientin classCouchDbClientBase- Returns:
DefaultHttpClientinstance.
-
createContext
org.apache.http.protocol.HttpContext createContext()
- Specified by:
createContextin classCouchDbClientBase- Returns:
HttpContextinstance for HTTP request execution.
-
shutdown
public void shutdown()
Description copied from class:CouchDbClientBaseShuts down the connection manager used by this client instance.- Specified by:
shutdownin 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.NoSuchAlgorithmExceptionjava.security.KeyManagementExceptionjava.security.KeyStoreExceptionjava.security.cert.CertificateExceptionjava.io.IOExceptionjava.security.UnrecoverableKeyException
-
registerInterceptors
private void registerInterceptors(org.apache.http.impl.client.DefaultHttpClient httpclient)
-
-