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 |
|---|---|
ClusterWorkloadResponseMessage |
clusterWorkload(ClusterWorkloadRequestMessage msg)
Sends a "cluster workflow request" message to the Cluster Coordinator.
|
private Socket |
createSocket() |
protected abstract InetSocketAddress |
getServiceAddress() |
SocketConfiguration |
getSocketConfiguration() |
HeartbeatResponseMessage |
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 ProtocolMessage |
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 HeartbeatResponseMessage 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 heartbeatpublic ClusterWorkloadResponseMessage clusterWorkload(ClusterWorkloadRequestMessage msg) throws ProtocolException
NodeProtocolSenderclusterWorkload in interface NodeProtocolSendermsg - a request messageProtocolException - if communication failedprivate Socket createSocket()
public SocketConfiguration getSocketConfiguration()
private ProtocolMessage sendProtocolMessage(ProtocolMessage msg, String hostname, int port)
protected abstract InetSocketAddress getServiceAddress() throws IOException
IOExceptionCopyright © 2016 Apache NiFi Project. All rights reserved.