@Test public void whenThisNodeLeavesTheClusterAMessageWillBeSent() { clusterMonitor.leftCluster(); verify(xmppServer).sendMessageToAdmins(any()); }
@Override public void leftCluster() { final String nodeName = xmppServer.getServerInfo().getHostname(); LOGGER.info("This node ({}/{}) has left the cluster", xmppServer.getNodeID(), nodeName); sendMessageToAdminsIfEnabled("The local node ('" + nodeName + "') has left the cluster - this node no longer has any resilience"); }
ClusterMonitor implements Module, ClusterEventListener { @Override public void leftCluster() { final String nodeName = xmppServer.getServerInfo().getHostname(); LOGGER.info("This node ({}/{}) has left the cluster", xmppServer.getNodeID(), nodeName); sendMessageToAdminsIfEnabled("The local node ('" + nodeName + "') has left the cluster - this node no longer has any resilience"); } }
ClusterMonitor implements Module, ClusterEventListener { @Override public void leftCluster() { final String nodeName = xmppServer.getServerInfo().getHostname(); LOGGER.info("This node ({}/{}) has left the cluster", xmppServer.getNodeID(), nodeName); sendMessageToAdminsIfEnabled("The local node ('" + nodeName + "') has left the cluster - this node no longer has any resilience"); } @SuppressWarnings("WeakerAccess")  ClusterMonitor(); }
ClusterMonitor implements Module, ClusterEventListener { @Override public void leftCluster() { final String nodeName = xmppServer.getServerInfo().getHostname(); LOGGER.info("This node ({}/{}) has left the cluster", xmppServer.getNodeID(), nodeName); sendMessageToAdminsIfEnabled("The local node ('" + nodeName + "') has left the cluster - this node no longer has any resilience"); } @SuppressWarnings("WeakerAccess")  ClusterMonitor(); @Override String getName(); @Override void initialize(final XMPPServer xmppServer); @Override void start(); @Override void stop(); @Override void destroy(); @Override void joinedCluster(); @Override void joinedCluster(final byte[] nodeIdBytes); @Override void leftCluster(); @Override void leftCluster(final byte[] nodeIdBytes); @Override void markedAsSeniorClusterMember(); }
ClusterMonitor implements Module, ClusterEventListener { @Override public void leftCluster() { final String nodeName = xmppServer.getServerInfo().getHostname(); LOGGER.info("This node ({}/{}) has left the cluster", xmppServer.getNodeID(), nodeName); sendMessageToAdminsIfEnabled("The local node ('" + nodeName + "') has left the cluster - this node no longer has any resilience"); } @SuppressWarnings("WeakerAccess")  ClusterMonitor(); @Override String getName(); @Override void initialize(final XMPPServer xmppServer); @Override void start(); @Override void stop(); @Override void destroy(); @Override void joinedCluster(); @Override void joinedCluster(final byte[] nodeIdBytes); @Override void leftCluster(); @Override void leftCluster(final byte[] nodeIdBytes); @Override void markedAsSeniorClusterMember();  }