Package com.couchbase.lite
Class MessageEndpointListener
- java.lang.Object
-
- com.couchbase.lite.MessageEndpointListener
-
public class MessageEndpointListener extends Object
MessageEndpointListener to serve incoming message endpoint connection.
-
-
Constructor Summary
Constructors Constructor Description MessageEndpointListener(MessageEndpointListenerConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(MessageEndpointConnection connection)
Accept a new connection.ListenerToken
addChangeListener(MessageEndpointListenerChangeListener listener)
Add a change listener.ListenerToken
addChangeListener(Executor queue, MessageEndpointListenerChangeListener listener)
Add a change listener with the given dispatch queue.void
close(MessageEndpointConnection connection)
Close the given connection.void
closeAll()
Close all connections active at the time of the call.void
removeChangeListener(ListenerToken token)
Remove a change listener.
-
-
-
Constructor Detail
-
MessageEndpointListener
public MessageEndpointListener(@NonNull MessageEndpointListenerConfiguration config)
-
-
Method Detail
-
accept
public void accept(@NonNull MessageEndpointConnection connection)
Accept a new connection.- Parameters:
connection
- new incoming connection
-
close
public void close(@NonNull MessageEndpointConnection connection)
Close the given connection.- Parameters:
connection
- the connection to be closed
-
closeAll
public void closeAll()
Close all connections active at the time of the call.
-
addChangeListener
@NonNull public ListenerToken addChangeListener(@NonNull MessageEndpointListenerChangeListener listener)
Add a change listener.- Parameters:
listener
- the listener- Returns:
- listener identifier
-
addChangeListener
@NonNull public ListenerToken addChangeListener(@Nullable Executor queue, @NonNull MessageEndpointListenerChangeListener listener)
Add a change listener with the given dispatch queue.- Parameters:
queue
- the executor on which the listener will runlistener
- the listener- Returns:
- listener identifier
-
removeChangeListener
public void removeChangeListener(@NonNull ListenerToken token)
Remove a change listener.- Parameters:
token
- identifier for the listener to be removed
-
-