private void validateInstanceCommands(Set<String> optionsList,
String entity, String type,
String start, String colo) throws FalconCLIException {
if (entity == null || entity.equals("")) {
throw new FalconCLIException("Missing argument: name");
}
if (type == null || type.equals("")) {
throw new FalconCLIException("Missing argument: type");
}
if (colo == null || colo.equals("")) {
throw new FalconCLIException("Missing argument: colo");
}
if (!optionsList.contains(RUNNING_OPT)) {
if (start == null || start.equals("")) {
throw new FalconCLIException("Missing argument: start");
}
}
if (optionsList.contains(CLUSTERS_OPT)) {
if (optionsList.contains(RUNNING_OPT)
|| optionsList.contains(LOG_OPT)
|| optionsList.contains(STATUS_OPT)) {
throw new FalconCLIException("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 FalconCLIException("Invalid argument: sourceClusters");
}
}
}