public class DatabaseClientFactory extends Object
A Database Client Factory configures a database client for making database requests.
| Modifier and Type | Class and Description |
|---|---|
static class |
DatabaseClientFactory.Authentication
Deprecated.
(as of 4.0.1) use BasicAuthContext, DigestAuthContext and KerberosAuthContext classes
|
static class |
DatabaseClientFactory.BasicAuthContext |
static class |
DatabaseClientFactory.Bean
A Database Client Factory Bean provides an object for specifying configuration before creating a client to make database requests.
|
static class |
DatabaseClientFactory.CertificateAuthContext |
static interface |
DatabaseClientFactory.ClientConfigurator<T>
A ClientConfigurator provides custom configuration for the communication library used to sending client requests and receiving server responses.
|
static class |
DatabaseClientFactory.DigestAuthContext |
static interface |
DatabaseClientFactory.HandleFactoryRegistry
A HandleFactoryRegistry associates IO representation classes with handle factories.
|
static class |
DatabaseClientFactory.KerberosAuthContext |
static interface |
DatabaseClientFactory.SecurityContext |
static interface |
DatabaseClientFactory.SSLHostnameVerifier
An SSLHostnameVerifier checks whether a hostname is acceptable during SSL authentication.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addConfigurator(DatabaseClientFactory.ClientConfigurator<?> configurator)
Adds a listener that provides custom configuration when a communication library is created.
|
static void |
clearHandleRegistry()
Removes the current registered associations so the handle registry is empty.
|
static DatabaseClientFactory.HandleFactoryRegistry |
getHandleRegistry()
Returns the default registry with factories for creating handles as adapters for IO representations.
|
static DatabaseClient |
newClient(String host,
int port)
Creates a client to access the database by means of a REST server without any authentication.
|
static DatabaseClient |
newClient(String host,
int port,
DatabaseClientFactory.SecurityContext securityContext)
Creates a client to access the database by means of a REST server.
|
static DatabaseClient |
newClient(String host,
int port,
String database)
Creates a client to access the database by means of a REST server without any authentication.
|
static DatabaseClient |
newClient(String host,
int port,
String database,
DatabaseClientFactory.SecurityContext securityContext)
Creates a client to access the database by means of a REST server.
|
static DatabaseClient |
newClient(String host,
int port,
String user,
String password,
DatabaseClientFactory.Authentication type)
Deprecated.
(as of 4.0.1) use
newClient(String host, int port, SecurityContext securityContext) |
static DatabaseClient |
newClient(String host,
int port,
String user,
String password,
DatabaseClientFactory.Authentication type,
SSLContext context)
Deprecated.
(as of 4.0.1) use
newClient(String host, int port, SecurityContext securityContext) |
static DatabaseClient |
newClient(String host,
int port,
String user,
String password,
DatabaseClientFactory.Authentication type,
SSLContext context,
DatabaseClientFactory.SSLHostnameVerifier verifier)
Deprecated.
(as of 4.0.1) use
newClient(String host, int port, SecurityContext securityContext) |
static DatabaseClient |
newClient(String host,
int port,
String database,
String user,
String password,
DatabaseClientFactory.Authentication type)
Deprecated.
|
static DatabaseClient |
newClient(String host,
int port,
String database,
String user,
String password,
DatabaseClientFactory.Authentication type,
SSLContext context)
Deprecated.
|
static DatabaseClient |
newClient(String host,
int port,
String database,
String user,
String password,
DatabaseClientFactory.Authentication type,
SSLContext context,
DatabaseClientFactory.SSLHostnameVerifier verifier)
Deprecated.
|
static void |
registerDefaultHandles()
Initializes a handle registry with the default associations between the content handles provided by the API and the supported IO representation classes.
|
public static DatabaseClient newClient(String host, int port)
Creates a client to access the database by means of a REST server without any authentication. Such clients can be convenient for experimentation but should not be used in production.
host - the host with the REST serverport - the port for the REST serverpublic static DatabaseClient newClient(String host, int port, String database)
Creates a client to access the database by means of a REST server without any authentication. Such clients can be convenient for experimentation but should not be used in production.
host - the host with the REST serverport - the port for the REST serverdatabase - the database to access (default: configured database for the REST server)public static DatabaseClient newClient(String host, int port, DatabaseClientFactory.SecurityContext securityContext)
Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serversecurityContext - the security context created depending upon the authentication type - BasicAuthContext, DigestAuthContext or KerberosAuthContext and communication channel type (SSL)public static DatabaseClient newClient(String host, int port, String database, DatabaseClientFactory.SecurityContext securityContext)
Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serverdatabase - the database to access (default: configured database for the REST server)securityContext - the security context created depending upon the authentication type - BasicAuthContext, DigestAuthContext or KerberosAuthContext and communication channel type (SSL)@Deprecated public static DatabaseClient newClient(String host, int port, String user, String password, DatabaseClientFactory.Authentication type)
newClient(String host, int port, SecurityContext securityContext)Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serveruser - the user with read, write, or administrative privilegespassword - the password for the usertype - the type of authentication applied to the request@Deprecated public static DatabaseClient newClient(String host, int port, String database, String user, String password, DatabaseClientFactory.Authentication type)
newClient(String host, int port, String database, SecurityContext securityContext)Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serverdatabase - the database to access (default: configured database for the REST server)user - the user with read, write, or administrative privilegespassword - the password for the usertype - the type of authentication applied to the request@Deprecated public static DatabaseClient newClient(String host, int port, String user, String password, DatabaseClientFactory.Authentication type, SSLContext context)
newClient(String host, int port, SecurityContext securityContext)Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serveruser - the user with read, write, or administrative privilegespassword - the password for the usertype - the type of authentication applied to the requestcontext - the SSL context for authenticating with the server@Deprecated public static DatabaseClient newClient(String host, int port, String database, String user, String password, DatabaseClientFactory.Authentication type, SSLContext context)
newClient(String host, int port, String database, SecurityContext securityContext)Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serverdatabase - the database to access (default: configured database for the REST server)user - the user with read, write, or administrative privilegespassword - the password for the usertype - the type of authentication applied to the requestcontext - the SSL context for authenticating with the server@Deprecated public static DatabaseClient newClient(String host, int port, String user, String password, DatabaseClientFactory.Authentication type, SSLContext context, DatabaseClientFactory.SSLHostnameVerifier verifier)
newClient(String host, int port, SecurityContext securityContext)Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serveruser - the user with read, write, or administrative privilegespassword - the password for the usertype - the type of authentication applied to the requestcontext - the SSL context for authenticating with the serververifier - a callback for checking hostnames@Deprecated public static DatabaseClient newClient(String host, int port, String database, String user, String password, DatabaseClientFactory.Authentication type, SSLContext context, DatabaseClientFactory.SSLHostnameVerifier verifier)
newClient(String host, int port, String database, SecurityContext securityContext)Creates a client to access the database by means of a REST server.
host - the host with the REST serverport - the port for the REST serverdatabase - the database to access (default: configured database for the REST server)user - the user with read, write, or administrative privilegespassword - the password for the usertype - the type of authentication applied to the requestcontext - the SSL context for authenticating with the serververifier - a callback for checking hostnamespublic static DatabaseClientFactory.HandleFactoryRegistry getHandleRegistry()
Returns the default registry with factories for creating handles as adapters for IO representations. To create custom registries, use
public static void clearHandleRegistry()
Removes the current registered associations so the handle registry is empty.
public static void registerDefaultHandles()
Initializes a handle registry with the default associations between the content handles provided by the API and the supported IO representation classes. Use this method only after clearing or overwriting associations in the handle registry.
public static void addConfigurator(DatabaseClientFactory.ClientConfigurator<?> configurator)
Adds a listener that provides custom configuration when a communication library is created.
configurator - the listener for configuring the communication libraryHttpClientConfiguratorCopyright © 2013-2017 MarkLogic Corporation.