コード例 #1
0
  private IStoredJobLoadResult parseStoredJobResult(
      final Node node1, final boolean successful, final boolean skippedJob, final String message) {
    final String index = node1.selectSingleNode("@index").getStringValue();
    final Node idNode = node1.selectSingleNode("id");
    final String id = null != idNode ? idNode.getStringValue() : null;
    final String name = node1.selectSingleNode("name").getStringValue();
    final Node urlNode = node1.selectSingleNode("url");
    final String url = null != urlNode ? makeAbsoluteURL(urlNode.getStringValue()) : null;
    final String group =
        null != node1.selectSingleNode("group")
            ? node1.selectSingleNode("group").getStringValue()
            : null;
    final String description =
        null != node1.selectSingleNode("description")
            ? node1.selectSingleNode("description").getStringValue()
            : null;
    logger.debug("\t" + index + ": " + name + " [" + id + "] <" + url + ">");
    int ndx = -1;
    try {
      ndx = Integer.parseInt(index);
    } catch (NumberFormatException e) {

    }
    return StoredJobLoadResultImpl.createLoadResult(
        id, name, url, group, description, successful, skippedJob, message, ndx);
  }
コード例 #2
0
 private IStoredJobLoadResult parseAPIJobResult(
     final Node node1, final boolean successful, final boolean skippedJob, final String message) {
   final Node uuidNode = node1.selectSingleNode("uuid");
   final Node idNode = node1.selectSingleNode("id");
   final String id =
       null != uuidNode
           ? uuidNode.getStringValue()
           : null != idNode ? idNode.getStringValue() : null;
   final String name = node1.selectSingleNode("name").getStringValue();
   final String url = null != id ? createJobURL(id) : null;
   final String group =
       null != node1.selectSingleNode("group")
           ? node1.selectSingleNode("group").getStringValue()
           : null;
   final String description =
       null != node1.selectSingleNode("description")
           ? node1.selectSingleNode("description").getStringValue()
           : null;
   final String project =
       null != node1.selectSingleNode("project")
           ? node1.selectSingleNode("project").getStringValue()
           : null;
   logger.debug("\t" + name + " [" + id + "] <" + url + "> (" + project + ")");
   return StoredJobLoadResultImpl.createLoadResult(
       id, name, url, group, description, project, successful, skippedJob, message);
 }