use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.instruction.status.changed.DetailsBuilder in project bgpcep by opendaylight.
the class InstructionImpl method cancelInstrunction.
private synchronized void cancelInstrunction() {
final List<InstructionId> ids = new ArrayList<>();
for (final InstructionImpl instruction : this.dependencies) {
if (instruction.getStatus() != InstructionStatus.Successful) {
ids.add(instruction.getId());
}
}
cancel(new DetailsBuilder().setUnmetDependencies(ids).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.instruction.status.changed.DetailsBuilder in project bgpcep by opendaylight.
the class InstructionImpl method checkDependencies.
private Boolean checkDependencies() {
boolean ready = true;
final List<InstructionId> unmet = new ArrayList<>();
for (final InstructionImpl instruction : this.dependencies) {
switch(instruction.getStatus()) {
case Cancelled:
case Failed:
case Unknown:
unmet.add(instruction.getId());
break;
case Executing:
case Queued:
case Scheduled:
ready = false;
break;
case Successful:
// No-op
break;
default:
break;
}
}
if (!unmet.isEmpty()) {
LOG.warn("Instruction {} was Queued, while some dependencies were resolved unsuccessfully, cancelling it", this.id);
cancel(new DetailsBuilder().setUnmetDependencies(unmet).build());
return false;
}
return ready;
}
Aggregations