private void createWanSyncState(MemberStateImpl memberState) { WanReplicationService wanReplicationService = instance.node.nodeEngine.getWanReplicationService(); WanSyncState wanSyncState = wanReplicationService.getWanSyncState(); if (wanSyncState != null) { memberState.setWanSyncState(wanSyncState); } }
private void createWanSyncState(MemberStateImpl memberState) { WanReplicationService wanReplicationService = instance.node.nodeEngine.getWanReplicationService(); WanSyncState wanSyncState = wanReplicationService.getWanSyncState(); if (wanSyncState != null) { memberState.setWanSyncState(wanSyncState); } }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
/** * Clears the WAN queues for the wan replication name and publisher ID defined * by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanClearQueues(HttpPostCommand command) throws UnsupportedEncodingException { String res; final String[] params = decodeParams(command, 2); final String wanRepName = params[0]; final String publisherId = params[1]; try { textCommandService.getNode().getNodeEngine().getWanReplicationService().clearQueues(wanRepName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN replication queues are cleared."); } catch (Exception ex) { logger.warning("Error occurred while clearing queues", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Initiates a WAN sync for a single map and the wan replication name and publisher ID defined * by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanSyncMap(HttpPostCommand command) throws UnsupportedEncodingException { String res; final String[] params = decodeParams(command, 3); final String wanRepName = params[0]; final String publisherId = params[1]; final String mapName = params[2]; try { textCommandService.getNode().getNodeEngine().getWanReplicationService().syncMap(wanRepName, publisherId, mapName); res = response(ResponseType.SUCCESS, "message", "Sync initiated"); } catch (Exception ex) { logger.warning("Error occurred while syncing map", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Clears the WAN queues for the wan replication name and publisher ID defined * by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanClearQueues(HttpPostCommand command) throws UnsupportedEncodingException { String res; final String[] params = decodeParams(command, 2); final String wanRepName = params[0]; final String publisherId = params[1]; try { textCommandService.getNode().getNodeEngine().getWanReplicationService().clearQueues(wanRepName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN replication queues are cleared."); } catch (Exception ex) { logger.warning("Error occurred while clearing queues", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Initiates WAN sync for all maps and the wan replication name and publisher ID * defined * by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanSyncAllMaps(HttpPostCommand command) throws UnsupportedEncodingException { String res; final String[] params = decodeParams(command, 2); final String wanRepName = params[0]; final String publisherId = params[1]; try { textCommandService.getNode().getNodeEngine().getWanReplicationService().syncAllMaps(wanRepName, publisherId); res = response(ResponseType.SUCCESS, "message", "Sync initiated"); } catch (Exception ex) { logger.warning("Error occurred while syncing maps", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Initiates WAN sync for all maps and the wan replication name and publisher ID * defined * by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanSyncAllMaps(HttpPostCommand command) throws UnsupportedEncodingException { String res; final String[] params = decodeParams(command, 2); final String wanRepName = params[0]; final String publisherId = params[1]; try { textCommandService.getNode().getNodeEngine().getWanReplicationService().syncAllMaps(wanRepName, publisherId); res = response(ResponseType.SUCCESS, "message", "Sync initiated"); } catch (Exception ex) { logger.warning("Error occurred while syncing maps", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Initiates a WAN sync for a single map and the wan replication name and publisher ID defined * by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanSyncMap(HttpPostCommand command) throws UnsupportedEncodingException { String res; final String[] params = decodeParams(command, 3); final String wanRepName = params[0]; final String publisherId = params[1]; final String mapName = params[2]; try { textCommandService.getNode().getNodeEngine().getWanReplicationService().syncMap(wanRepName, publisherId, mapName); res = response(ResponseType.SUCCESS, "message", "Sync initiated"); } catch (Exception ex) { logger.warning("Error occurred while syncing map", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Initiates a WAN consistency check for a single map and the WAN replication * name and publisher ID defined by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanConsistencyCheck(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 3); String wanReplicationName = params[0]; String publisherId = params[1]; String mapName = params[2]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.consistencyCheck(wanReplicationName, publisherId, mapName); res = response(ResponseType.SUCCESS, "message", "Consistency check initiated"); } catch (Exception ex) { logger.warning("Error occurred while initiating consistency check", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Stops a WAN publisher on this member only. The publisher is identified * by the WAN replication name and publisher ID passed as parameters to * the HTTP command. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported * @see com.hazelcast.config.WanPublisherState#STOPPED */ private void handleWanStopPublisher(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 2); String wanReplicationName = params[0]; String publisherId = params[1]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.stop(wanReplicationName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN publisher stopped"); } catch (Exception ex) { logger.warning("Error occurred while stopping WAN publisher", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Initiates a WAN consistency check for a single map and the WAN replication * name and publisher ID defined by the command parameters. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported */ private void handleWanConsistencyCheck(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 3); String wanReplicationName = params[0]; String publisherId = params[1]; String mapName = params[2]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.consistencyCheck(wanReplicationName, publisherId, mapName); res = response(ResponseType.SUCCESS, "message", "Consistency check initiated"); } catch (Exception ex) { logger.warning("Error occurred while initiating consistency check", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Pauses a WAN publisher on this member only. The publisher is identified * by the WAN replication name and publisher ID passed as parameters to * the HTTP command. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported * @see com.hazelcast.config.WanPublisherState#PAUSED */ private void handleWanPausePublisher(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 2); String wanReplicationName = params[0]; String publisherId = params[1]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.pause(wanReplicationName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN publisher paused"); } catch (Exception ex) { logger.warning("Error occurred while pausing WAN publisher", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Resumes a WAN publisher on this member only. The publisher is identified * by the WAN replication name and publisher ID passed as parameters to * the HTTP command. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported * @see com.hazelcast.config.WanPublisherState#REPLICATING */ private void handleWanResumePublisher(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 2); String wanReplicationName = params[0]; String publisherId = params[1]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.resume(wanReplicationName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN publisher resumed"); } catch (Exception ex) { logger.warning("Error occurred while resuming WAN publisher", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Stops a WAN publisher on this member only. The publisher is identified * by the WAN replication name and publisher ID passed as parameters to * the HTTP command. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported * @see com.hazelcast.config.WanPublisherState#STOPPED */ private void handleWanStopPublisher(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 2); String wanReplicationName = params[0]; String publisherId = params[1]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.stop(wanReplicationName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN publisher stopped"); } catch (Exception ex) { logger.warning("Error occurred while stopping WAN publisher", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Resumes a WAN publisher on this member only. The publisher is identified * by the WAN replication name and publisher ID passed as parameters to * the HTTP command. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported * @see com.hazelcast.config.WanPublisherState#REPLICATING */ private void handleWanResumePublisher(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 2); String wanReplicationName = params[0]; String publisherId = params[1]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.resume(wanReplicationName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN publisher resumed"); } catch (Exception ex) { logger.warning("Error occurred while resuming WAN publisher", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
/** * Pauses a WAN publisher on this member only. The publisher is identified * by the WAN replication name and publisher ID passed as parameters to * the HTTP command. * * @param command the HTTP command * @throws UnsupportedEncodingException If character encoding needs to be consulted, but * named character encoding is not supported * @see com.hazelcast.config.WanPublisherState#PAUSED */ private void handleWanPausePublisher(HttpPostCommand command) throws UnsupportedEncodingException { String res; String[] params = decodeParams(command, 2); String wanReplicationName = params[0]; String publisherId = params[1]; WanReplicationService service = textCommandService.getNode().getNodeEngine().getWanReplicationService(); try { service.pause(wanReplicationName, publisherId); res = response(ResponseType.SUCCESS, "message", "WAN publisher paused"); } catch (Exception ex) { logger.warning("Error occurred while pausing WAN publisher", ex); res = exceptionResponse(ex); } sendResponse(command, res); }
private void registerCoreServices() { logger.finest("Registering core services..."); Node node = nodeEngine.getNode(); registerService(ClusterServiceImpl.SERVICE_NAME, node.getClusterService()); registerService(InternalPartitionService.SERVICE_NAME, node.getPartitionService()); registerService(ProxyServiceImpl.SERVICE_NAME, nodeEngine.getProxyService()); registerService(TransactionManagerServiceImpl.SERVICE_NAME, nodeEngine.getTransactionManagerService()); registerService(ClientEngineImpl.SERVICE_NAME, node.clientEngine); registerService(QuorumServiceImpl.SERVICE_NAME, nodeEngine.getQuorumService()); registerService(WanReplicationService.SERVICE_NAME, nodeEngine.getWanReplicationService()); registerService(EventServiceImpl.SERVICE_NAME, nodeEngine.getEventService()); }
private void registerCoreServices() { logger.finest("Registering core services..."); Node node = nodeEngine.getNode(); registerService(ClusterServiceImpl.SERVICE_NAME, node.getClusterService()); registerService(InternalPartitionService.SERVICE_NAME, node.getPartitionService()); registerService(ProxyServiceImpl.SERVICE_NAME, nodeEngine.getProxyService()); registerService(TransactionManagerServiceImpl.SERVICE_NAME, nodeEngine.getTransactionManagerService()); registerService(ClientEngineImpl.SERVICE_NAME, node.clientEngine); registerService(QuorumServiceImpl.SERVICE_NAME, nodeEngine.getQuorumService()); registerService(WanReplicationService.SERVICE_NAME, nodeEngine.getWanReplicationService()); registerService(EventServiceImpl.SERVICE_NAME, nodeEngine.getEventService()); }