@Test public void testVerificationOfBehaviorForOtherReturnCodes() throws CommandFailureException { final ControlJvmRequest controlCommand = mock(ControlJvmRequest.class); final Identifier<Jvm> jvmId = new Identifier<>(1L); final Jvm mockJvm = mock(Jvm.class); when(mockJvm.getId()).thenReturn(Identifier.<Jvm>id(jvmId.getId())); when(mockJvm.getJvmName()).thenReturn("testJvmName"); when(mockJvm.getHostName()).thenReturn("testJvmHost"); when(Config.mockJvmPersistenceService.getJvm(any(Identifier.class))).thenReturn(mockJvm); when(controlCommand.getControlOperation()).thenReturn(JvmControlOperation.START); when(mockJvm.getState()).thenReturn(JvmState.JVM_STARTED); when(controlCommand.getJvmId()).thenReturn(jvmId); when(Config.mockJvmCommandFactory.executeCommand(any(Jvm.class), any(JvmControlOperation.class))).thenReturn(new RemoteCommandReturnInfo(ExecReturnCode.JWALA_EXIT_CODE_FAST_FAIL, "Test standard out when START or STOP", "Test standard error")); jvmControlService.controlJvm(controlCommand, user); verify(Config.mockHistoryFacadeService, times(2)).write(anyString(), anyList(), anyString(), any(EventType.class), anyString()); when(Config.mockJvmCommandFactory.executeCommand(any(Jvm.class), any(JvmControlOperation.class))).thenReturn(new RemoteCommandReturnInfo(ExecReturnCode.JWALA_EXIT_NO_SUCH_SERVICE, "Test standard out when START or STOP", "Test standard error")); jvmControlService.controlJvm(controlCommand, user); when(Config.mockJvmCommandFactory.executeCommand(any(Jvm.class), any(JvmControlOperation.class))).thenReturn(new RemoteCommandReturnInfo(ExecReturnCode.JWALA_EXIT_PROCESS_KILLED, "Test standard out when START or STOP", "Test standard error")); final CommandOutput commandOutput = jvmControlService.controlJvm(controlCommand, user); assertTrue(commandOutput.getReturnCode().wasSuccessful()); when(Config.mockJvmCommandFactory.executeCommand(any(Jvm.class), any(JvmControlOperation.class))).thenReturn(new RemoteCommandReturnInfo(88, "", "Test standard error or out")); when(controlCommand.getControlOperation()).thenReturn(JvmControlOperation.HEAP_DUMP); jvmControlService.controlJvm(controlCommand, user); }
@Override public CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser) { final JvmControlOperation controlOperation = controlJvmRequest.getControlOperation(); LOGGER.debug("Control JVM request operation = {}", controlOperation.toString()); final Jvm jvm = jvmPersistenceService.getJvm(controlJvmRequest.getJvmId()); try { final String historyMessage = controlJvmRequest.getMessage() == null ? controlOperation.name() : controlJvmRequest.getMessage(); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), historyMessage, EventType.USER_ACTION_INFO, aUser.getId()); RemoteCommandReturnInfo remoteCommandReturnInfo = jvmCommandFactory.executeCommand(jvm, controlJvmRequest.getControlOperation()); CommandOutput commandOutput = new CommandOutput(new ExecReturnCode(remoteCommandReturnInfo.retCode), remoteCommandReturnInfo.standardOuput, remoteCommandReturnInfo.errorOupout); final String standardOutput = commandOutput.getStandardOutput(); final ExecReturnCode returnCode = commandOutput.getReturnCode(); if (StringUtils.isNotEmpty(standardOutput) && (JvmControlOperation.START.equals(controlOperation) || JvmControlOperation.STOP.equals(controlOperation))) { commandOutput.cleanStandardOutput(); LOGGER.info("shell command output is {}", standardOutput); } else if (StringUtils.isNoneBlank(standardOutput) && JvmControlOperation.HEAP_DUMP.equals(controlOperation) && returnCode.wasSuccessful()) { commandOutput.cleanHeapDumpStandardOutput(); } LOGGER.debug("JvmCommand output return code = {}", returnCode); if (returnCode.wasSuccessful()) { if (JvmControlOperation.STOP.equals(controlOperation)) { LOGGER.debug("Updating state to {}...", JvmState.JVM_STOPPED); jvmStateService.updateState(jvm, JvmState.JVM_STOPPED); LOGGER.debug("State successfully updated to {}", JvmState.JVM_STOPPED); } } else { String commandOutputReturnDescription = CommandOutputReturnCode.fromReturnCode(returnCode.getReturnCode()).getDesc(); switch (returnCode.getReturnCode()) { case ExecReturnCode.JWALA_EXIT_PROCESS_KILLED: commandOutput = new CommandOutput(new ExecReturnCode(0), FORCED_STOPPED, commandOutput.getStandardError()); jvmStateService.updateState(jvm, JvmState.FORCED_STOPPED); break; case ExecReturnCode.JWALA_EXIT_CODE_ABNORMAL_SUCCESS: int retCode = 0; switch (controlJvmRequest.getControlOperation()) { case START: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STARTED; break; case STOP: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STOPPED; break; default: retCode = returnCode.getReturnCode(); break; } sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); if (retCode == 0) { commandOutput = new CommandOutput(new ExecReturnCode(retCode), commandOutputReturnDescription, null); } break; case ExecReturnCode.JWALA_EXIT_CODE_NO_OP: if (controlOperation.equals(JvmControlOperation.START) || controlOperation.equals(JvmControlOperation.STOP)) { sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); } else { final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); } break; default: final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); break; } } return commandOutput; } catch (final RemoteCommandExecutorServiceException e) { LOGGER.error(e.getMessage(), e); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), e.getMessage(), EventType.SYSTEM_ERROR, aUser.getId()); throw new InternalErrorException(FaultType.REMOTE_COMMAND_FAILURE, "CommandFailureException when attempting to control a JVM: " + controlJvmRequest, e); } }
JvmControlServiceImpl implements JvmControlService { @Override public CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser) { final JvmControlOperation controlOperation = controlJvmRequest.getControlOperation(); LOGGER.debug("Control JVM request operation = {}", controlOperation.toString()); final Jvm jvm = jvmPersistenceService.getJvm(controlJvmRequest.getJvmId()); try { final String historyMessage = controlJvmRequest.getMessage() == null ? controlOperation.name() : controlJvmRequest.getMessage(); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), historyMessage, EventType.USER_ACTION_INFO, aUser.getId()); RemoteCommandReturnInfo remoteCommandReturnInfo = jvmCommandFactory.executeCommand(jvm, controlJvmRequest.getControlOperation()); CommandOutput commandOutput = new CommandOutput(new ExecReturnCode(remoteCommandReturnInfo.retCode), remoteCommandReturnInfo.standardOuput, remoteCommandReturnInfo.errorOupout); final String standardOutput = commandOutput.getStandardOutput(); final ExecReturnCode returnCode = commandOutput.getReturnCode(); if (StringUtils.isNotEmpty(standardOutput) && (JvmControlOperation.START.equals(controlOperation) || JvmControlOperation.STOP.equals(controlOperation))) { commandOutput.cleanStandardOutput(); LOGGER.info("shell command output is {}", standardOutput); } else if (StringUtils.isNoneBlank(standardOutput) && JvmControlOperation.HEAP_DUMP.equals(controlOperation) && returnCode.wasSuccessful()) { commandOutput.cleanHeapDumpStandardOutput(); } LOGGER.debug("JvmCommand output return code = {}", returnCode); if (returnCode.wasSuccessful()) { if (JvmControlOperation.STOP.equals(controlOperation)) { LOGGER.debug("Updating state to {}...", JvmState.JVM_STOPPED); jvmStateService.updateState(jvm, JvmState.JVM_STOPPED); LOGGER.debug("State successfully updated to {}", JvmState.JVM_STOPPED); } } else { String commandOutputReturnDescription = CommandOutputReturnCode.fromReturnCode(returnCode.getReturnCode()).getDesc(); switch (returnCode.getReturnCode()) { case ExecReturnCode.JWALA_EXIT_PROCESS_KILLED: commandOutput = new CommandOutput(new ExecReturnCode(0), FORCED_STOPPED, commandOutput.getStandardError()); jvmStateService.updateState(jvm, JvmState.FORCED_STOPPED); break; case ExecReturnCode.JWALA_EXIT_CODE_ABNORMAL_SUCCESS: int retCode = 0; switch (controlJvmRequest.getControlOperation()) { case START: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STARTED; break; case STOP: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STOPPED; break; default: retCode = returnCode.getReturnCode(); break; } sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); if (retCode == 0) { commandOutput = new CommandOutput(new ExecReturnCode(retCode), commandOutputReturnDescription, null); } break; case ExecReturnCode.JWALA_EXIT_CODE_NO_OP: if (controlOperation.equals(JvmControlOperation.START) || controlOperation.equals(JvmControlOperation.STOP)) { sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); } else { final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); } break; default: final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); break; } } return commandOutput; } catch (final RemoteCommandExecutorServiceException e) { LOGGER.error(e.getMessage(), e); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), e.getMessage(), EventType.SYSTEM_ERROR, aUser.getId()); throw new InternalErrorException(FaultType.REMOTE_COMMAND_FAILURE, "CommandFailureException when attempting to control a JVM: " + controlJvmRequest, e); } } }
JvmControlServiceImpl implements JvmControlService { @Override public CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser) { final JvmControlOperation controlOperation = controlJvmRequest.getControlOperation(); LOGGER.debug("Control JVM request operation = {}", controlOperation.toString()); final Jvm jvm = jvmPersistenceService.getJvm(controlJvmRequest.getJvmId()); try { final String historyMessage = controlJvmRequest.getMessage() == null ? controlOperation.name() : controlJvmRequest.getMessage(); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), historyMessage, EventType.USER_ACTION_INFO, aUser.getId()); RemoteCommandReturnInfo remoteCommandReturnInfo = jvmCommandFactory.executeCommand(jvm, controlJvmRequest.getControlOperation()); CommandOutput commandOutput = new CommandOutput(new ExecReturnCode(remoteCommandReturnInfo.retCode), remoteCommandReturnInfo.standardOuput, remoteCommandReturnInfo.errorOupout); final String standardOutput = commandOutput.getStandardOutput(); final ExecReturnCode returnCode = commandOutput.getReturnCode(); if (StringUtils.isNotEmpty(standardOutput) && (JvmControlOperation.START.equals(controlOperation) || JvmControlOperation.STOP.equals(controlOperation))) { commandOutput.cleanStandardOutput(); LOGGER.info("shell command output is {}", standardOutput); } else if (StringUtils.isNoneBlank(standardOutput) && JvmControlOperation.HEAP_DUMP.equals(controlOperation) && returnCode.wasSuccessful()) { commandOutput.cleanHeapDumpStandardOutput(); } LOGGER.debug("JvmCommand output return code = {}", returnCode); if (returnCode.wasSuccessful()) { if (JvmControlOperation.STOP.equals(controlOperation)) { LOGGER.debug("Updating state to {}...", JvmState.JVM_STOPPED); jvmStateService.updateState(jvm, JvmState.JVM_STOPPED); LOGGER.debug("State successfully updated to {}", JvmState.JVM_STOPPED); } } else { String commandOutputReturnDescription = CommandOutputReturnCode.fromReturnCode(returnCode.getReturnCode()).getDesc(); switch (returnCode.getReturnCode()) { case ExecReturnCode.JWALA_EXIT_PROCESS_KILLED: commandOutput = new CommandOutput(new ExecReturnCode(0), FORCED_STOPPED, commandOutput.getStandardError()); jvmStateService.updateState(jvm, JvmState.FORCED_STOPPED); break; case ExecReturnCode.JWALA_EXIT_CODE_ABNORMAL_SUCCESS: int retCode = 0; switch (controlJvmRequest.getControlOperation()) { case START: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STARTED; break; case STOP: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STOPPED; break; default: retCode = returnCode.getReturnCode(); break; } sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); if (retCode == 0) { commandOutput = new CommandOutput(new ExecReturnCode(retCode), commandOutputReturnDescription, null); } break; case ExecReturnCode.JWALA_EXIT_CODE_NO_OP: if (controlOperation.equals(JvmControlOperation.START) || controlOperation.equals(JvmControlOperation.STOP)) { sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); } else { final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); } break; default: final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); break; } } return commandOutput; } catch (final RemoteCommandExecutorServiceException e) { LOGGER.error(e.getMessage(), e); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), e.getMessage(), EventType.SYSTEM_ERROR, aUser.getId()); throw new InternalErrorException(FaultType.REMOTE_COMMAND_FAILURE, "CommandFailureException when attempting to control a JVM: " + controlJvmRequest, e); } } JvmControlServiceImpl(final JvmPersistenceService jvmPersistenceService,
                                 final JvmStateService jvmStateService,
                                 final HistoryFacadeService historyFacadeService); }
JvmControlServiceImpl implements JvmControlService { @Override public CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser) { final JvmControlOperation controlOperation = controlJvmRequest.getControlOperation(); LOGGER.debug("Control JVM request operation = {}", controlOperation.toString()); final Jvm jvm = jvmPersistenceService.getJvm(controlJvmRequest.getJvmId()); try { final String historyMessage = controlJvmRequest.getMessage() == null ? controlOperation.name() : controlJvmRequest.getMessage(); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), historyMessage, EventType.USER_ACTION_INFO, aUser.getId()); RemoteCommandReturnInfo remoteCommandReturnInfo = jvmCommandFactory.executeCommand(jvm, controlJvmRequest.getControlOperation()); CommandOutput commandOutput = new CommandOutput(new ExecReturnCode(remoteCommandReturnInfo.retCode), remoteCommandReturnInfo.standardOuput, remoteCommandReturnInfo.errorOupout); final String standardOutput = commandOutput.getStandardOutput(); final ExecReturnCode returnCode = commandOutput.getReturnCode(); if (StringUtils.isNotEmpty(standardOutput) && (JvmControlOperation.START.equals(controlOperation) || JvmControlOperation.STOP.equals(controlOperation))) { commandOutput.cleanStandardOutput(); LOGGER.info("shell command output is {}", standardOutput); } else if (StringUtils.isNoneBlank(standardOutput) && JvmControlOperation.HEAP_DUMP.equals(controlOperation) && returnCode.wasSuccessful()) { commandOutput.cleanHeapDumpStandardOutput(); } LOGGER.debug("JvmCommand output return code = {}", returnCode); if (returnCode.wasSuccessful()) { if (JvmControlOperation.STOP.equals(controlOperation)) { LOGGER.debug("Updating state to {}...", JvmState.JVM_STOPPED); jvmStateService.updateState(jvm, JvmState.JVM_STOPPED); LOGGER.debug("State successfully updated to {}", JvmState.JVM_STOPPED); } } else { String commandOutputReturnDescription = CommandOutputReturnCode.fromReturnCode(returnCode.getReturnCode()).getDesc(); switch (returnCode.getReturnCode()) { case ExecReturnCode.JWALA_EXIT_PROCESS_KILLED: commandOutput = new CommandOutput(new ExecReturnCode(0), FORCED_STOPPED, commandOutput.getStandardError()); jvmStateService.updateState(jvm, JvmState.FORCED_STOPPED); break; case ExecReturnCode.JWALA_EXIT_CODE_ABNORMAL_SUCCESS: int retCode = 0; switch (controlJvmRequest.getControlOperation()) { case START: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STARTED; break; case STOP: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STOPPED; break; default: retCode = returnCode.getReturnCode(); break; } sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); if (retCode == 0) { commandOutput = new CommandOutput(new ExecReturnCode(retCode), commandOutputReturnDescription, null); } break; case ExecReturnCode.JWALA_EXIT_CODE_NO_OP: if (controlOperation.equals(JvmControlOperation.START) || controlOperation.equals(JvmControlOperation.STOP)) { sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); } else { final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); } break; default: final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); break; } } return commandOutput; } catch (final RemoteCommandExecutorServiceException e) { LOGGER.error(e.getMessage(), e); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), e.getMessage(), EventType.SYSTEM_ERROR, aUser.getId()); throw new InternalErrorException(FaultType.REMOTE_COMMAND_FAILURE, "CommandFailureException when attempting to control a JVM: " + controlJvmRequest, e); } } JvmControlServiceImpl(final JvmPersistenceService jvmPersistenceService,
                                 final JvmStateService jvmStateService,
                                 final HistoryFacadeService historyFacadeService); @Override CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser); @Override CommandOutput controlJvmSynchronously(final ControlJvmRequest controlJvmRequest, final long timeout,
                                                 final User user); @Override CommandOutput secureCopyFile(final ControlJvmRequest secureCopyRequest, final String sourcePath,
                                        final String destPath, String userId, boolean overwrite); @Override CommandOutput executeChangeFileModeCommand(final Jvm jvm, final String modifiedPermissions, final String targetAbsoluteDir, final String targetFile); @Override CommandOutput executeCreateDirectoryCommand(final Jvm jvm, final String dirAbsolutePath); @Override CommandOutput executeCheckFileExistsCommand(final Jvm jvm, final String filename); @Override CommandOutput executeBackUpCommand(final Jvm jvm, final String filename); void setJvmCommandFactory(JvmCommandFactory jvmCommandFactory); }
JvmControlServiceImpl implements JvmControlService { @Override public CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser) { final JvmControlOperation controlOperation = controlJvmRequest.getControlOperation(); LOGGER.debug("Control JVM request operation = {}", controlOperation.toString()); final Jvm jvm = jvmPersistenceService.getJvm(controlJvmRequest.getJvmId()); try { final String historyMessage = controlJvmRequest.getMessage() == null ? controlOperation.name() : controlJvmRequest.getMessage(); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), historyMessage, EventType.USER_ACTION_INFO, aUser.getId()); RemoteCommandReturnInfo remoteCommandReturnInfo = jvmCommandFactory.executeCommand(jvm, controlJvmRequest.getControlOperation()); CommandOutput commandOutput = new CommandOutput(new ExecReturnCode(remoteCommandReturnInfo.retCode), remoteCommandReturnInfo.standardOuput, remoteCommandReturnInfo.errorOupout); final String standardOutput = commandOutput.getStandardOutput(); final ExecReturnCode returnCode = commandOutput.getReturnCode(); if (StringUtils.isNotEmpty(standardOutput) && (JvmControlOperation.START.equals(controlOperation) || JvmControlOperation.STOP.equals(controlOperation))) { commandOutput.cleanStandardOutput(); LOGGER.info("shell command output is {}", standardOutput); } else if (StringUtils.isNoneBlank(standardOutput) && JvmControlOperation.HEAP_DUMP.equals(controlOperation) && returnCode.wasSuccessful()) { commandOutput.cleanHeapDumpStandardOutput(); } LOGGER.debug("JvmCommand output return code = {}", returnCode); if (returnCode.wasSuccessful()) { if (JvmControlOperation.STOP.equals(controlOperation)) { LOGGER.debug("Updating state to {}...", JvmState.JVM_STOPPED); jvmStateService.updateState(jvm, JvmState.JVM_STOPPED); LOGGER.debug("State successfully updated to {}", JvmState.JVM_STOPPED); } } else { String commandOutputReturnDescription = CommandOutputReturnCode.fromReturnCode(returnCode.getReturnCode()).getDesc(); switch (returnCode.getReturnCode()) { case ExecReturnCode.JWALA_EXIT_PROCESS_KILLED: commandOutput = new CommandOutput(new ExecReturnCode(0), FORCED_STOPPED, commandOutput.getStandardError()); jvmStateService.updateState(jvm, JvmState.FORCED_STOPPED); break; case ExecReturnCode.JWALA_EXIT_CODE_ABNORMAL_SUCCESS: int retCode = 0; switch (controlJvmRequest.getControlOperation()) { case START: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STARTED; break; case STOP: commandOutputReturnDescription = MSG_SERVICE_ALREADY_STOPPED; break; default: retCode = returnCode.getReturnCode(); break; } sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); if (retCode == 0) { commandOutput = new CommandOutput(new ExecReturnCode(retCode), commandOutputReturnDescription, null); } break; case ExecReturnCode.JWALA_EXIT_CODE_NO_OP: if (controlOperation.equals(JvmControlOperation.START) || controlOperation.equals(JvmControlOperation.STOP)) { sendMessageToActionEventLog(aUser, jvm, commandOutputReturnDescription); } else { final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); } break; default: final String errorMsg = getCommandErrorMessage(commandOutput, returnCode, commandOutputReturnDescription); sendMessageToActionEventLog(aUser, jvm, errorMsg); break; } } return commandOutput; } catch (final RemoteCommandExecutorServiceException e) { LOGGER.error(e.getMessage(), e); historyFacadeService.write(getServerName(jvm), new ArrayList<>(jvm.getGroups()), e.getMessage(), EventType.SYSTEM_ERROR, aUser.getId()); throw new InternalErrorException(FaultType.REMOTE_COMMAND_FAILURE, "CommandFailureException when attempting to control a JVM: " + controlJvmRequest, e); } } JvmControlServiceImpl(final JvmPersistenceService jvmPersistenceService,
                                 final JvmStateService jvmStateService,
                                 final HistoryFacadeService historyFacadeService); @Override CommandOutput controlJvm(final ControlJvmRequest controlJvmRequest, final User aUser); @Override CommandOutput controlJvmSynchronously(final ControlJvmRequest controlJvmRequest, final long timeout,
                                                 final User user); @Override CommandOutput secureCopyFile(final ControlJvmRequest secureCopyRequest, final String sourcePath,
                                        final String destPath, String userId, boolean overwrite); @Override CommandOutput executeChangeFileModeCommand(final Jvm jvm, final String modifiedPermissions, final String targetAbsoluteDir, final String targetFile); @Override CommandOutput executeCreateDirectoryCommand(final Jvm jvm, final String dirAbsolutePath); @Override CommandOutput executeCheckFileExistsCommand(final Jvm jvm, final String filename); @Override CommandOutput executeBackUpCommand(final Jvm jvm, final String filename); void setJvmCommandFactory(JvmCommandFactory jvmCommandFactory);  }