use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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 ListenableFuture<Instruction> listenableFuture;
try {
listenableFuture = scheduler.scheduleInstruction(fwd.getInput());
} catch (final SchedulerException e) {
LOG.info("Instuction {} failed to schedule", e.getMessage(), e);
return new FailureCaseBuilder().setFailure(e.getFailure()).build();
}
Futures.addCallback(listenableFuture, fwd, MoreExecutors.directExecutor());
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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.rev131005.pcrep.message.pcrep.message.replies.result.FailureCase in project bgpcep by opendaylight.
the class PCEPReplyMessageParser method serializeFailure.
private void serializeFailure(final FailureCase f, final ByteBuf buffer) {
if (f == null) {
return;
}
serializeObject(f.getNoPath(), buffer);
serializeObject(f.getLspa(), buffer);
serializeObject(f.getBandwidth(), buffer);
if (f.getMetrics() != null) {
for (final Metrics m : f.getMetrics()) {
serializeObject(m.getMetric(), buffer);
}
}
serializeObject(f.getIro(), buffer);
}
Aggregations