Package com.couchbase.lite
Class URLEndpointListenerConfiguration
java.lang.Object
com.couchbase.lite.URLEndpointListenerConfiguration
ENTERPRISE EDITION API
Configuration information for a URL endpoint listener. There are two varieties: Http and Tls.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionURLEndpointListenerConfiguration
(Database database) Deprecated.Use URLEndpointListenerConfiguration(Collections)Clone the passed listener configuration.URLEndpointListenerConfiguration
(Set<Collection> collections) Init with the collections that will be available for replication.URLEndpointListenerConfiguration
(Set<Collection> collections, String networkInterface, int port, boolean disableTls, TLSIdentity identity, ListenerAuthenticator authenticator, boolean readOnly, boolean enableDeltaSync) Create a URLEndpointListenerConfiguration with the passed properties. -
Method Summary
Modifier and TypeMethodDescriptionGet the configured authenticator.Get the configured database.Deprecated.use getCollections()Get the configured network interface.int
getPort()
Get the configured port.Get the configured TLS identity.boolean
Is delta sync enabled.boolean
Is connection read-only.boolean
Get configured connection type.void
setAuthenticator
(ListenerAuthenticator authenticator) Set the authenticator.void
setDisableTls
(boolean disableTls) Set the configured security protocol.void
setEnableDeltaSync
(boolean enableDeltaSync) Set delta sync enabled.void
setNetworkInterface
(String networkInterface) Set the configured network interface.void
setPort
(int port) Set the configured port.void
setReadOnly
(boolean readOnly) Set the connection read-only.void
setTlsIdentity
(TLSIdentity identity) Set the certificates and keys for the associated listener.toString()
-
Field Details
-
MIN_PORT
public static final int MIN_PORT- See Also:
-
MAX_PORT
public static final int MAX_PORT- See Also:
-
-
Constructor Details
-
URLEndpointListenerConfiguration
Deprecated.Use URLEndpointListenerConfiguration(Collections)Create a listener configuration, for the specified database, with default values.- Parameters:
database
- the database to which the listener is attached
-
URLEndpointListenerConfiguration
Init with the collections that will be available for replication. The specified collections must contain at least one collection, otherwise an Invalid Argument Exception will be thrown. Currently only collections from a single scope are supported: all of the specified collections must belong to the same scope, otherwise an Invalid Argument Exception will be thrown. All of the collections must belong to the same database, otherwise an Invalid Argument Exception will be thrown. If one of the collections is removed during the replication, the listener will be stopped and the connections to the connected clients will be closed with an error- Parameters:
collections
- the collections to which the listener is attached
-
URLEndpointListenerConfiguration
public URLEndpointListenerConfiguration(@NonNull Set<Collection> collections, @Nullable String networkInterface, int port, boolean disableTls, @Nullable TLSIdentity identity, @Nullable ListenerAuthenticator authenticator, boolean readOnly, boolean enableDeltaSync) Create a URLEndpointListenerConfiguration with the passed properties. The set of passed Collections must contain at least one collection and all of the collections it contains must belong to the same scope and the same database, otherwise an InvalidArgumentException will be thrown. If one of the specified collections is deleted during replication, connected clients will be closed with an error.- Parameters:
collections
- the collections to which the listener is attachednetworkInterface
- the name of the interface on which to receive connectionsport
- the ip port (0 - 65535) on which to configure the listener. Default is 0: first availabledisableTls
- set true to turn of TLS. Default is falseidentity
- the identity this listener will use to authenticate itselfauthenticator
- the predicate used to authenticate clientsreadOnly
- set true to prevent modification of the local connectionsenableDeltaSync
- set true to turn on fast synching.
-
URLEndpointListenerConfiguration
Clone the passed listener configuration.- Parameters:
config
- the configuration to duplicate
-
-
Method Details
-
getDatabase
Deprecated.use getCollections()Get the configured database.- Returns:
- the configured database.
-
getCollections
Get the configured database.- Returns:
- the configured database.
-
getNetworkInterface
Get the configured network interface.- Returns:
- the configured network interface.
-
setNetworkInterface
Set the configured network interface.- Parameters:
networkInterface
- the name of the interface on which to configure the listener (e.g. "en0")
-
getPort
public int getPort()Get the configured port.- Returns:
- the configured port.
-
setPort
public void setPort(int port) Set the configured port. A port number of 0 (the default) tells the OS to choose some available port.- Parameters:
port
- the port number on which to configure the listener (between 0 and 65535, inclusive)
-
isTlsDisabled
public boolean isTlsDisabled()Get configured connection type.- Returns:
- true if this configuration will disable TLS in its associated listener.
-
setDisableTls
public void setDisableTls(boolean disableTls) Set the configured security protocol. TLS is enabled by default. disabling it is not recommended for production.- Parameters:
disableTls
- true to disable TLS security.
-
getTlsIdentity
Get the configured TLS identity.- Returns:
- the TLS identity for the associated listener.
-
setTlsIdentity
Set the certificates and keys for the associated listener.- Parameters:
identity
- a TLSIdentity that the listener will supply to authenticate itself.
-
getAuthenticator
Get the configured authenticator.- Returns:
- the authenticator for the associated listener.
-
setAuthenticator
Set the authenticator. When TLS is enabled, a null authenticator (the default) will allow clients whose certificate chains can be verified by one of the OS-bundled root certificates. There are two types of TLS authenticators. SeeListenerCertificateAuthenticator
When TLS is disabled, a null authenticator (the default) will allow all clients. A non-null authenticator will be passed the client's credentials and is completely responsible for authenticating them. See
ListenerPasswordAuthenticator
- Parameters:
authenticator
- the client authenticator
-
isReadOnly
public boolean isReadOnly()Is connection read-only.- Returns:
- true if the connections is read-only.
-
setReadOnly
public void setReadOnly(boolean readOnly) Set the connection read-only.- Parameters:
readOnly
- set true to make the configured listener read-only
-
isDeltaSyncEnabled
public boolean isDeltaSyncEnabled()Is delta sync enabled.- Returns:
- true if delta sync is enabled.
-
setEnableDeltaSync
public void setEnableDeltaSync(boolean enableDeltaSync) Set delta sync enabled.- Parameters:
enableDeltaSync
- set true to enable delta sync
-
toString
-