use of org.onosproject.workflow.api.ContextEventMapStore in project onos by opennetworkinglab.
the class WorkFlowEventMapCommand method doExecute.
@Override
protected void doExecute() {
if (Objects.isNull(cmd)) {
error("invalid cmd parameter");
return;
}
ContextEventMapStore store = get(ContextEventMapStore.class);
try {
switch(cmd) {
case PRINT:
JsonNode tree = store.asJsonTree();
ObjectMapper mapper = new ObjectMapper();
try {
print(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(tree));
} catch (JsonProcessingException e) {
error("Exception: " + e.getMessage() + ", trace: " + Arrays.asList(e.getStackTrace()));
}
break;
default:
print("Unsupported cmd: " + cmd);
}
} catch (WorkflowException e) {
error(e.getMessage() + ", trace: " + Arrays.asList(e.getStackTrace()));
}
}
Aggregations