Package org.apache.ivory.client

Examples of org.apache.ivory.client.IvoryCLIException


    else if (optionsList.contains(CONTINUE_OPT)) {
      result = client.rerunInstances(type, entity, start, end, colo, clusters, sourceClusters);
    } else if(optionsList.contains(LOG_OPT)){
      result = client.getLogsOfInstances(type, entity, start, end, colo, runid);
    } else {
      throw new IvoryCLIException("Invalid command");
    }
    OUT_STREAM.println(result);

  }
View Full Code Here


      String entity, String type, String start, String end,
      String filePath, String colo, String clusters, String sourceClusters)
          throws IvoryCLIException {

    if (entity == null || entity.equals("")) {
      throw new IvoryCLIException("Missing argument: name");
    }

    if (type == null || type.equals("")) {
      throw new IvoryCLIException("Missing argument: type");
    }
   
    if (colo == null || colo.equals("")) {
      throw new IvoryCLIException("Missing argument: colo");
    }
   
    if (!optionsList.contains(RUNNING_OPT)) {
      if (start == null || start.equals("")) {
        throw new IvoryCLIException("Missing argument: start");
      }
    }
   
    if (optionsList.contains(CLUSTERS_OPT)) {
      if (optionsList.contains(RUNNING_OPT)
          || optionsList.contains(LOG_OPT)
          || optionsList.contains(STATUS_OPT)) {
        throw new IvoryCLIException("Invalid argument: clusters");
      }
    }
   
    if (optionsList.contains(SOURCECLUSTER_OPT)) {
      if ( optionsList.contains(RUNNING_OPT)
          || optionsList.contains(LOG_OPT)
          || optionsList.contains(STATUS_OPT) || !type.equals("feed") ) {
        throw new IvoryCLIException("Invalid argument: sourceClusters");
      }
    }

  }
View Full Code Here

      validateColo(optionsList);
      result = client.getEntityList(entityType);
    } else if (optionsList.contains(HELP_CMD)) {
      OUT_STREAM.println("Ivory Help");
    } else {
      throw new IvoryCLIException("Invalid command");
    }
    OUT_STREAM.println(result);
  }
View Full Code Here

    return colo;
  }
  private void validateFilePath(Set<String> optionsList, String filePath)
      throws IvoryCLIException {
    if (filePath == null || filePath.equals("")) {
      throw new IvoryCLIException("Missing argument: file");
    }
  }
View Full Code Here

  }
 
  private void validateColo(Set<String> optionsList)
      throws IvoryCLIException {
    if (optionsList.contains(COLO_OPT)) {
      throw new IvoryCLIException("Invalid argument : " + COLO_OPT);
    }
  }
View Full Code Here

  }

  private void validateEntityName(Set<String> optionsList, String entityName)
      throws IvoryCLIException {
    if (entityName == null || entityName.equals("")) {
      throw new IvoryCLIException("Missing argument: name");
    }
  }
View Full Code Here

  }

  private void validateEntityType(Set<String> optionsList, String entityType)
      throws IvoryCLIException {
    if (entityType == null || entityType.equals("")) {
      throw new IvoryCLIException("Missing argument: type");
    }
  }
View Full Code Here

            Properties prop = getClientProperties();
            if (prop.containsKey("ivory.url"))
                url = prop.getProperty("ivory.url");
    }
    if(url == null)
        throw new IvoryCLIException("Failed to get ivory url from cmdline, or environment or client properties");
    return url;
  }
View Full Code Here

TOP

Related Classes of org.apache.ivory.client.IvoryCLIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.