示例#1
0
  private void showSummary() {
    List<MJob> jobs = client.getJobs();

    List<String> header = new LinkedList<String>();
    header.add(resourceString(Constants.RES_TABLE_HEADER_ID));
    header.add(resourceString(Constants.RES_TABLE_HEADER_NAME));
    header.add(resourceString(Constants.RES_TABLE_HEADER_FROM_CONNECTOR));
    header.add(resourceString(Constants.RES_TABLE_HEADER_TO_CONNECTOR));
    header.add(resourceString(Constants.RES_TABLE_HEADER_ENABLED));

    List<String> ids = new LinkedList<String>();
    List<String> names = new LinkedList<String>();
    List<String> fromConnectors = new LinkedList<String>();
    List<String> toConnectors = new LinkedList<String>();
    List<String> availabilities = new LinkedList<String>();

    for (MJob job : jobs) {
      ids.add(String.valueOf(job.getPersistenceId()));
      names.add(job.getName());
      // From link and connnector
      fromConnectors.add(job.getFromLinkName() + " (" + job.getFromConnectorName() + ")");
      toConnectors.add(job.getToLinkName() + " (" + job.getToConnectorName() + ")");

      availabilities.add(String.valueOf(job.getEnabled()));
    }

    TableDisplayer.display(header, ids, names, fromConnectors, toConnectors, availabilities);
  }
示例#2
0
  private void displayJob(MJob job) {
    DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);

    printlnResource(
        Constants.RES_SHOW_PROMPT_JOB_INFO,
        job.getName(),
        job.getEnabled(),
        job.getCreationUser(),
        formatter.format(job.getCreationDate()),
        job.getLastUpdateUser(),
        formatter.format(job.getLastUpdateDate()));

    displayConfig(job.getDriverConfig().getConfigs(), client.getDriverConfigBundle());
    printlnResource(Constants.RES_SHOW_PROMPT_JOB_FROM_LID_INFO, job.getFromLinkName());
    displayConfig(
        job.getFromJobConfig().getConfigs(),
        client.getConnectorConfigBundle(job.getFromConnectorName()));
    printlnResource(Constants.RES_SHOW_PROMPT_JOB_TO_LID_INFO, job.getToLinkName());
    displayConfig(
        job.getToJobConfig().getConfigs(),
        client.getConnectorConfigBundle(job.getToConnectorName()));
  }