public class NodeProtocolSenderListener extends Object implements NodeProtocolSender, ProtocolListener
| Modifier and Type | Field and Description |
|---|---|
private ProtocolListener |
listener |
private NodeProtocolSender |
sender |
| Constructor and Description |
|---|
NodeProtocolSenderListener(NodeProtocolSender sender,
ProtocolListener listener) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ProtocolHandler handler)
Registers a handler with the listener.
|
Collection<ProtocolHandler> |
getHandlers() |
void |
heartbeat(HeartbeatMessage msg)
Sends a "heartbeat" message to the cluster manager.
|
boolean |
isRunning() |
void |
notifyControllerStartupFailure(ControllerStartupFailureMessage msg)
Sends a failure notification if the controller was unable start.
|
void |
notifyReconnectionFailure(ReconnectionFailureMessage msg)
Sends a failure notification if the node was unable to reconnect to the
cluster
|
boolean |
removeHandler(ProtocolHandler handler)
Unregisters the handler with the listener.
|
ConnectionResponseMessage |
requestConnection(ConnectionRequestMessage msg)
Sends a "connection request" message to the cluster manager.
|
void |
sendBulletins(NodeBulletinsMessage msg)
Sends a bulletins message to the cluster manager.
|
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 NodeProtocolSender sender
private final ProtocolListener listener
public NodeProtocolSenderListener(NodeProtocolSender 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 heartbeat(HeartbeatMessage msg) throws ProtocolException, UnknownServiceAddressException
NodeProtocolSenderheartbeat in interface NodeProtocolSendermsg - a messageProtocolException - if communication failedUnknownServiceAddressException - if the cluster manager's address
is not knownpublic ConnectionResponseMessage requestConnection(ConnectionRequestMessage msg) throws ProtocolException, UnknownServiceAddressException
NodeProtocolSenderrequestConnection in interface NodeProtocolSendermsg - a messageProtocolException - if communication failedUnknownServiceAddressException - if the cluster manager's address
is not knownpublic void notifyControllerStartupFailure(ControllerStartupFailureMessage msg) throws ProtocolException, UnknownServiceAddressException
NodeProtocolSendernotifyControllerStartupFailure in interface NodeProtocolSendermsg - a messageProtocolException - if communication failedUnknownServiceAddressException - if the cluster manager's address
is not knownpublic void notifyReconnectionFailure(ReconnectionFailureMessage msg) throws ProtocolException, UnknownServiceAddressException
NodeProtocolSendernotifyReconnectionFailure in interface NodeProtocolSendermsg - a messageProtocolException - if communication failedUnknownServiceAddressException - if the cluster manager's address
is not knownpublic void sendBulletins(NodeBulletinsMessage msg) throws ProtocolException, UnknownServiceAddressException
NodeProtocolSendersendBulletins in interface NodeProtocolSendermsg - a messageProtocolException - peUnknownServiceAddressException - expublic void setBulletinRepository(BulletinRepository bulletinRepository)
ProtocolListenersetBulletinRepository in interface ProtocolListenerbulletinRepository - repoCopyright © 2015 Apache NiFi(incubating) Project. All rights reserved.