use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.FailureCase in project bgpcep by opendaylight.
the class PCEPReplyMessageParser method serializeFailure.
private void serializeFailure(final FailureCase failure, final ByteBuf buffer) {
if (failure == null) {
return;
}
serializeObject(failure.getNoPath(), buffer);
serializeObject(failure.getLspa(), buffer);
serializeObject(failure.getBandwidth(), buffer);
for (final Metrics m : failure.nonnullMetrics()) {
serializeObject(m.getMetric(), buffer);
}
serializeObject(failure.getIro(), buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.FailureCase in project bgpcep by opendaylight.
the class PCEPReplyMessageParser method serializeReply.
protected void serializeReply(final Replies reply, final ByteBuf buffer) {
serializeObject(reply.getRp(), buffer);
serializeMonitoring(reply, buffer);
serializeVendorInformationObjects(reply.getVendorInformationObject(), buffer);
if (reply.getResult() == null) {
return;
}
if (reply.getResult() instanceof FailureCase) {
final FailureCase f = (FailureCase) reply.getResult();
serializeFailure(f, buffer);
return;
}
final SuccessCase s = (SuccessCase) reply.getResult();
serializeSuccess(s, buffer);
serializeMonitoringMetrics(reply, buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.FailureCase in project bgpcep by opendaylight.
the class AbstractInstructionExecutor method schedule.
public static FailureCase schedule(final InstructionScheduler scheduler, final AbstractInstructionExecutor fwd) {
final SubmitInstructionInput input = fwd.getInput();
final ListenableFuture<Instruction> listenableFuture;
try {
listenableFuture = scheduler.scheduleInstruction(input);
} catch (final SchedulerException e) {
LOG.info("Instuction {} failed to schedule", input, e);
return new FailureCaseBuilder().setFailure(e.getFailure()).build();
}
Futures.addCallback(listenableFuture, fwd, MoreExecutors.directExecutor());
return null;
}
Aggregations