public class ClusterCoordinationProtocolSenderListener extends Object implements ClusterCoordinationProtocolSender, ProtocolListener
| Modifier and Type | Field and Description |
|---|---|
private ProtocolListener |
listener |
private ClusterCoordinationProtocolSender |
sender |
| Constructor and Description |
|---|
ClusterCoordinationProtocolSenderListener(ClusterCoordinationProtocolSender sender,
ProtocolListener listener) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ProtocolHandler handler)
Registers a handler with the listener.
|
void |
disconnect(DisconnectMessage msg)
Sends a "disconnection request" message to a node.
|
Collection<ProtocolHandler> |
getHandlers() |
boolean |
isRunning() |
void |
notifyNodeStatusChange(Set<NodeIdentifier> nodesToNotify,
NodeStatusChangeMessage msg)
Notifies all nodes in the given set that a node in the cluster has a new status
|
void |
offload(OffloadMessage msg)
Sends an "offload request" message to a node.
|
boolean |
removeHandler(ProtocolHandler handler)
Unregisters the handler with the listener.
|
NodeConnectionStatus |
requestNodeConnectionStatus(String hostname,
int port)
Sends a request to the given hostname and port to request its connection status
|
ReconnectionResponseMessage |
requestReconnection(ReconnectionRequestMessage msg)
Sends a "reconnection request" message to a node.
|
void |
setBulletinRepository(BulletinRepository bulletinRepository)
Sets the
BulletinRepository that can be used to report bulletins |
void |
start()
Starts the instance for listening for messages.
|
void |
stop()
Stops the instance from listening for messages.
|
private final ClusterCoordinationProtocolSender sender
private final ProtocolListener listener
public ClusterCoordinationProtocolSenderListener(ClusterCoordinationProtocolSender sender, ProtocolListener listener)
public void stop()
throws IOException
ProtocolListenerstop in interface ProtocolListenerIOException - expublic void start()
throws IOException
ProtocolListenerstart in interface ProtocolListenerIOException - expublic boolean isRunning()
isRunning in interface ProtocolListenerpublic boolean removeHandler(ProtocolHandler handler)
ProtocolListenerremoveHandler in interface ProtocolListenerhandler - a handlerpublic Collection<ProtocolHandler> getHandlers()
getHandlers in interface ProtocolListenerpublic void addHandler(ProtocolHandler handler)
ProtocolListeneraddHandler in interface ProtocolListenerhandler - a handlerpublic void setBulletinRepository(BulletinRepository bulletinRepository)
ClusterCoordinationProtocolSenderBulletinRepository that can be used to report bulletinssetBulletinRepository in interface ClusterCoordinationProtocolSendersetBulletinRepository in interface ProtocolListenerbulletinRepository - repopublic ReconnectionResponseMessage requestReconnection(ReconnectionRequestMessage msg) throws ProtocolException
ClusterCoordinationProtocolSenderrequestReconnection in interface ClusterCoordinationProtocolSendermsg - a messageProtocolException - if communication failedpublic void offload(OffloadMessage msg) throws ProtocolException
ClusterCoordinationProtocolSenderoffload in interface ClusterCoordinationProtocolSendermsg - a messageProtocolException - if communication failedpublic void disconnect(DisconnectMessage msg) throws ProtocolException
ClusterCoordinationProtocolSenderdisconnect in interface ClusterCoordinationProtocolSendermsg - a messageProtocolException - if communication failedpublic void notifyNodeStatusChange(Set<NodeIdentifier> nodesToNotify, NodeStatusChangeMessage msg)
ClusterCoordinationProtocolSendernotifyNodeStatusChange in interface ClusterCoordinationProtocolSendernodesToNotify - the nodes that should be notified of the changemsg - the message that indicates which node's status changed and what it changed topublic NodeConnectionStatus requestNodeConnectionStatus(String hostname, int port)
ClusterCoordinationProtocolSenderrequestNodeConnectionStatus in interface ClusterCoordinationProtocolSenderCopyright © 2020 Apache NiFi Project. All rights reserved.