public class DatabaseClientFactory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DatabaseClientFactory.Authentication
Authentication enumerates the methods for verifying a user and
password with the database.
|
static class |
DatabaseClientFactory.Bean
A Database Client Factory Bean provides an object for specifying configuration
before creating a client to make database requests.
|
static interface |
DatabaseClientFactory.ClientConfigurator<T>
A ClientConfigurator provides custom configuration for the communication library
used to sending client requests and receiving server responses.
|
static interface |
DatabaseClientFactory.HandleFactoryRegistry
A HandleFactoryRegistry associates IO representation classes
with handle factories.
|
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,
String user,
String password,
DatabaseClientFactory.Authentication type)
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,
SSLContext context)
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,
SSLContext context,
DatabaseClientFactory.SSLHostnameVerifier verifier)
Creates a client to access the database by means of a REST server.
|
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)
host
- the host with the REST serverport
- the port for the REST serverpublic static DatabaseClient newClient(String host, int port, String user, String password, DatabaseClientFactory.Authentication type)
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 requestpublic static DatabaseClient newClient(String host, int port, String user, String password, DatabaseClientFactory.Authentication type, SSLContext context)
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 serverpublic static DatabaseClient newClient(String host, int port, String user, String password, DatabaseClientFactory.Authentication type, SSLContext context, DatabaseClientFactory.SSLHostnameVerifier verifier)
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 hostnamespublic static DatabaseClientFactory.HandleFactoryRegistry getHandleRegistry()
public static void clearHandleRegistry()
public static void registerDefaultHandles()
public static void addConfigurator(DatabaseClientFactory.ClientConfigurator<?> configurator)
configurator
- the listener for configuring the communication libraryHttpClientConfigurator
Copyright © 2013-2015 MarkLogic Corporation.