public abstract class AbstractNodeProtocolSender extends Object implements NodeProtocolSender
| Modifier and Type | Field and Description |
|---|---|
private ProtocolContext<ProtocolMessage> |
protocolContext |
private SocketConfiguration |
socketConfiguration |
| Constructor and Description |
|---|
AbstractNodeProtocolSender(SocketConfiguration socketConfiguration,
ProtocolContext<ProtocolMessage> protocolContext) |
| Modifier and Type | Method and Description |
|---|---|
private Socket |
createSocket() |
protected abstract InetSocketAddress |
getServiceAddress() |
SocketConfiguration |
getSocketConfiguration() |
void |
heartbeat(HeartbeatMessage msg,
String address)
Sends a heartbeat to the address given
|
ConnectionResponseMessage |
requestConnection(ConnectionRequestMessage msg)
Sends a "connection request" message to the cluster manager.
|
private void |
sendProtocolMessage(ProtocolMessage msg,
String hostname,
int port) |
private final SocketConfiguration socketConfiguration
private final ProtocolContext<ProtocolMessage> protocolContext
public AbstractNodeProtocolSender(SocketConfiguration socketConfiguration, ProtocolContext<ProtocolMessage> protocolContext)
public 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 heartbeat(HeartbeatMessage msg, String address) throws ProtocolException
NodeProtocolSenderheartbeat in interface NodeProtocolSendermsg - the heartbeat message to sendaddress - the address of the Cluster Coordinator in <hostname>:<port> formatProtocolException - if unable to send the heartbeatprivate Socket createSocket()
public SocketConfiguration getSocketConfiguration()
private void sendProtocolMessage(ProtocolMessage msg, String hostname, int port)
protected abstract InetSocketAddress getServiceAddress() throws IOException
IOExceptionCopyright © 2016 Apache NiFi Project. All rights reserved.