@Override public void addHandler(final ProtocolHandler handler) { listener.addHandler(handler); }
@Override public Collection<ProtocolHandler> getHandlers() { return listener.getHandlers(); }
@Override public boolean isRunning() { return listener.isRunning(); }
@Override public void stop() throws IOException { if (!isRunning()) { return; } listener.stop(); }
@Override public void setBulletinRepository(final BulletinRepository bulletinRepository) { listener.setBulletinRepository(bulletinRepository); }
@Override public boolean removeHandler(final ProtocolHandler handler) { return listener.removeHandler(handler); }
@Override public void start() throws IOException { if (isRunning()) { throw new IllegalStateException("Instance is already started."); } listener.start(); }
@Override public void stop() throws IOException { if (!isRunning()) { throw new IllegalStateException("Instance is already stopped."); } listener.stop(); }
@Override public void setBulletinRepository(final BulletinRepository bulletinRepository) { listener.setBulletinRepository(bulletinRepository); sender.setBulletinRepository(bulletinRepository); }
@Override public boolean removeHandler(final ProtocolHandler handler) { return listener.removeHandler(handler); }
@Override public void start() throws IOException { if (isRunning()) { return; } listener.start(); }
@Override public void addHandler(final ProtocolHandler handler) { listener.addHandler(handler); }
@Override public void stop() throws IOException { if (!isRunning()) { return; } listener.stop(); }
@Override public void setBulletinRepository(final BulletinRepository bulletinRepository) { listener.setBulletinRepository(bulletinRepository); }
@Override public Collection<ProtocolHandler> getHandlers() { return listener.getHandlers(); }
@Override public boolean removeHandler(final ProtocolHandler handler) { return listener.removeHandler(handler); }
@Override public boolean isRunning() { return listener.isRunning(); }
@Override public void start() throws IOException { if (isRunning()) { throw new IllegalStateException("Instance is already started."); } listener.start(); }
public ClusterProtocolHeartbeatMonitor(final ClusterCoordinator clusterCoordinator, final ProtocolListener protocolListener, final NiFiProperties nifiProperties) { super(clusterCoordinator, nifiProperties); protocolListener.addHandler(this); String hostname = nifiProperties.getProperty(NiFiProperties.CLUSTER_NODE_ADDRESS); if (hostname == null || hostname.trim().isEmpty()) { hostname = "localhost"; } final String port = nifiProperties.getProperty(NiFiProperties.CLUSTER_NODE_PROTOCOL_PORT); if (port == null || port.trim().isEmpty()) { throw new RuntimeException("Unable to determine which port Cluster Coordinator Protocol is listening on because the '" + NiFiProperties.CLUSTER_NODE_PROTOCOL_PORT + "' property is not set"); } try { Integer.parseInt(port); } catch (final NumberFormatException nfe) { throw new RuntimeException("Unable to determine which port Cluster Coordinator Protocol is listening on because the '" + NiFiProperties.CLUSTER_NODE_PROTOCOL_PORT + "' property is set to '" + port + "', which is not a valid port number."); } heartbeatAddress = hostname + ":" + port; }
@Override public void stop() throws IOException { if (!isRunning()) { throw new IllegalStateException("Instance is already stopped."); } listener.stop(); }