use of org.batfish.common.WorkItem in project batfish by batfish.
the class Client method runAnalysis.
private boolean runAnalysis(@Nullable FileWriter outWriter, List<String> options, List<String> parameters, boolean delta, boolean differential) {
Command command = differential ? Command.RUN_ANALYSIS_DIFFERENTIAL : delta ? Command.RUN_ANALYSIS_DELTA : Command.RUN_ANALYSIS;
if (!isValidArgument(options, parameters, 0, 1, 1, command)) {
return false;
}
if (!isSetContainer(true) || !isSetTestrig()) {
return false;
}
String analysisName = parameters.get(0);
// answer the question
WorkItem wItemAs = WorkItemBuilder.getWorkItemRunAnalysis(analysisName, _currContainerName, _currTestrig, _currEnv, _currDeltaTestrig, _currDeltaEnv, delta, differential);
return execute(wItemAs, outWriter);
}
use of org.batfish.common.WorkItem in project batfish by batfish.
the class WorkItemBuilder method getWorkItemAnswerQuestion.
public static WorkItem getWorkItemAnswerQuestion(String questionName, String containerName, String testrigName, String envName, String deltaTestrig, String deltaEnvName, boolean isDifferential, boolean isDelta) {
WorkItem wItem = new WorkItem(containerName, testrigName);
wItem.addRequestParam(BfConsts.COMMAND_ANSWER, "");
wItem.addRequestParam(BfConsts.ARG_QUESTION_NAME, questionName);
wItem.addRequestParam(BfConsts.ARG_ENVIRONMENT_NAME, envName);
if (isDifferential) {
wItem.addRequestParam(BfConsts.ARG_DIFFERENTIAL, "");
}
if (deltaEnvName != null) {
wItem.addRequestParam(BfConsts.ARG_DELTA_ENVIRONMENT_NAME, deltaEnvName);
}
if (deltaTestrig != null) {
wItem.addRequestParam(BfConsts.ARG_DELTA_TESTRIG, deltaTestrig);
}
if (isDelta) {
wItem.addRequestParam(BfConsts.ARG_DIFF_ACTIVE, "");
}
return wItem;
}
use of org.batfish.common.WorkItem in project batfish by batfish.
the class WorkItemBuilder method getWorkItemRunAnalysis.
public static WorkItem getWorkItemRunAnalysis(String analysisName, String containerName, String testrigName, String envName, String deltaTestrig, String deltaEnvName, boolean delta, boolean differential) {
WorkItem wItem = new WorkItem(containerName, testrigName);
wItem.addRequestParam(BfConsts.COMMAND_ANALYZE, "");
wItem.addRequestParam(BfConsts.ARG_ANALYSIS_NAME, analysisName);
wItem.addRequestParam(BfConsts.ARG_TESTRIG, testrigName);
wItem.addRequestParam(BfConsts.ARG_ENVIRONMENT_NAME, envName);
if (differential || delta) {
wItem.addRequestParam(BfConsts.ARG_DELTA_TESTRIG, deltaTestrig);
wItem.addRequestParam(BfConsts.ARG_DELTA_ENVIRONMENT_NAME, deltaEnvName);
}
if (delta) {
wItem.addRequestParam(BfConsts.ARG_DIFF_ACTIVE, "");
}
if (differential) {
wItem.addRequestParam(BfConsts.ARG_DIFFERENTIAL, "");
}
return wItem;
}
use of org.batfish.common.WorkItem in project batfish by batfish.
the class WorkItemBuilder method getWorkItemParse.
public static WorkItem getWorkItemParse(String containerName, String testrigName) {
WorkItem wItem = new WorkItem(containerName, testrigName);
wItem.addRequestParam(BfConsts.COMMAND_PARSE_VENDOR_INDEPENDENT, "");
wItem.addRequestParam(BfConsts.COMMAND_PARSE_VENDOR_SPECIFIC, "");
wItem.addRequestParam(BfConsts.COMMAND_INIT_INFO, "");
wItem.addRequestParam(BfConsts.ARG_UNIMPLEMENTED_SUPPRESS, "");
return wItem;
}
Aggregations