public boolean checkLive(TransportConfiguration liveTransportConfiguration) { try { ClusterControl control = clusterController.connectToNode(liveTransportConfiguration); control.close(); return true; } catch (Throwable t) { return false; } }
/** * send a request to a live server to start a backup for us * * @param connectorPair the connector for the node to request a backup from * @param backupSize the current size of the requested nodes backups * @param replicated * @return true if the request wa successful. * @throws Exception */ public boolean requestBackup(Pair<TransportConfiguration, TransportConfiguration> connectorPair, int backupSize, boolean replicated) throws Exception { ClusterController clusterController = server.getClusterManager().getClusterController(); try ( ClusterControl clusterControl = clusterController.connectToNode(connectorPair.getA()); ) { clusterControl.authorize(); if (replicated) { return clusterControl.requestReplicatedBackup(backupSize, server.getNodeID()); } else { return clusterControl.requestSharedStoreBackup(backupSize, server.getConfiguration().getJournalLocation().getAbsolutePath(), server.getConfiguration().getBindingsLocation().getAbsolutePath(), server.getConfiguration().getLargeMessagesLocation().getAbsolutePath(), server.getConfiguration().getPagingLocation().getAbsolutePath()); } } }
return; clusterControl = clusterController.connectToNode(serverTC); clusterControl.authorize();