use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionId in project bgpcep by opendaylight.
the class ProgrammingServiceImpl method collectDependencies.
private List<InstructionImpl> collectDependencies(final SubmitInstructionInput input) throws SchedulerException {
final List<InstructionImpl> dependencies = new ArrayList<>();
for (final InstructionId pid : input.getPreconditions()) {
final InstructionImpl instruction = this.insns.get(pid);
if (instruction == null) {
LOG.info("Instruction {} depends on {}, which is not a known instruction", input.getId(), pid);
throw new SchedulerException("Unknown dependency ID specified", new FailureBuilder().setType(UnknownPreconditionId.class).build());
}
dependencies.add(instruction);
}
return dependencies;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionId in project bgpcep by opendaylight.
the class MockedNotificationServiceWrapper method assertInstructionStatusChangedNotification.
void assertInstructionStatusChangedNotification(final int idx, final InstructionId id, final InstructionStatus status) {
assertTrue(InstructionStatusChanged.class.isAssignableFrom(this.publishedNotifications.get(idx).getClass()));
final InstructionStatusChanged firstNotification = (InstructionStatusChanged) this.publishedNotifications.get(idx);
assertInstructionStatusChangedNotification(id, status, firstNotification);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionId in project bgpcep by opendaylight.
the class ProgrammingServiceImplTest method getMockedSubmitInstructionInput.
private static SubmitInstructionInput getMockedSubmitInstructionInput(final String id, final Optional<Nanotime> deadline, final String... dependencyIds) {
final SubmitInstructionInput mockedSubmitInstruction = mock(SubmitInstructionInput.class);
doReturn(PcepUpdateTunnelInput.class).when(mockedSubmitInstruction).getImplementedInterface();
final List<InstructionId> dependencies = Lists.newArrayList();
for (final String dependencyId : dependencyIds) {
dependencies.add(new InstructionId(dependencyId));
}
doReturn(dependencies).when(mockedSubmitInstruction).getPreconditions();
doReturn(new InstructionId(id)).when(mockedSubmitInstruction).getId();
doReturn(deadline.isPresent() ? deadline.get() : new Nanotime(BigInteger.valueOf(Long.MAX_VALUE))).when(mockedSubmitInstruction).getDeadline();
return mockedSubmitInstruction;
}
Aggregations