Package com.couchbase.lite
Class URLEndpointListener
- java.lang.Object
-
- com.couchbase.lite.URLEndpointListener
-
public class URLEndpointListener extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description URLEndpointListener(URLEndpointListenerConfiguration config)Create a URLEndpointListener with the passed configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URLEndpointListenerConfigurationgetConfig()Get the listener's configuration.intgetPort()Get the listener's port.ConnectionStatusgetStatus()Get the listener status.TLSIdentitygetTlsIdentity()Get the TLS identity used by the listener.java.util.List<java.net.URI>getUrls()Get the list of URIs for the listener.voidstart()Start the listener.voidstop()Stop the listener.java.lang.StringtoString()
-
-
-
Constructor Detail
-
URLEndpointListener
public URLEndpointListener(@NonNull URLEndpointListenerConfiguration config)Create a URLEndpointListener with the passed configuration.- Parameters:
config- the listener configuration.
-
-
Method Detail
-
getConfig
@NonNull public URLEndpointListenerConfiguration getConfig()
Get the listener's configuration.- Returns:
- the listener's configuration (read only).
-
getPort
public int getPort()
Get the listener's port. This method will return a value of -1 except between the time the listener is started and the time it is stopped.When a listener is configured with the port number 0, the return value from this function will give the port at which the listener is actually listening.
- Returns:
- the listener's port, or -1.
-
getUrls
@NonNull public java.util.List<java.net.URI> getUrls()
Get the list of URIs for the listener.- Returns:
- a list of listener URIs.
-
getStatus
@Nullable public ConnectionStatus getStatus()
Get the listener status.- Returns:
- listener status.
-
getTlsIdentity
@Nullable public TLSIdentity getTlsIdentity()
Get the TLS identity used by the listener.- Returns:
- TLS identity.
-
start
public void start() throws CouchbaseLiteExceptionStart the listener.- Throws:
CouchbaseLiteException
-
stop
public void stop()
Stop the listener.
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-