Example #1
0
 @Override
 public void execute(ApplicationContext currentContext) throws CLIException {
   SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
   try {
     boolean success = scheduler.stopScheduler(currentContext.getSessionId());
     resultStack(currentContext).push(success);
     if (success) {
       writeLine(currentContext, "Scheduler successfully stopped.");
     } else {
       writeLine(currentContext, "Cannot stop scheduler.");
     }
   } catch (Exception e) {
     handleError("An error occurred while attempting to stop scheduler:", e, currentContext);
   }
 }
  @Override
  public void execute(ApplicationContext currentContext) throws CLIException {
    File file = new File(sessionFile);
    if (file.exists()) {
      currentContext.setSessionId(FileUtility.readFileToString(file));

    } else {
      throw new CLIException(
          CLIException.REASON_INVALID_ARGUMENTS,
          String.format("File does not exist: %s", sessionFile));
    }
  }
Example #3
0
 @Override
 public void execute(ApplicationContext currentContext) throws CLIException {
   HelpFormatter formatter = new HelpFormatter();
   Writer writer = currentContext.getDevice().getWriter();
   PrintWriter pw = new PrintWriter(writer, true);
   Options options =
       CommandFactory.getCommandFactory(CommandFactory.Type.SCHEDULER).supportedOptions();
   formatter.printHelp(
       pw,
       110,
       USAGE,
       "",
       options,
       formatter.getLeftPadding(),
       formatter.getDescPadding(),
       "",
       false);
 }
Example #4
0
  @Override
  public void execute(ApplicationContext currentContext) throws CLIException {
    HelpFormatter formatter = new HelpFormatter();
    Writer writer = currentContext.getDevice().getWriter();

    ProActiveVersionUtility.writeProActiveVersionWithBreakEndLine(currentContext, System.out);

    PrintWriter pw = new PrintWriter(writer, true);
    formatter.printHelp(
        pw,
        110,
        USAGE,
        "",
        CommandFactory.getCommandFactory(CommandFactory.Type.ALL).supportedOptions(),
        formatter.getLeftPadding(),
        formatter.getDescPadding(),
        "",
        false);
  }