Search in sources :

Example 1 with SuccessCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.SuccessCase 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);
}
Also used : FailureCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.FailureCase) SuccessCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.SuccessCase)

Example 2 with SuccessCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.SuccessCase in project bgpcep by opendaylight.

the class PCEPReplyMessageParser method serializeSuccess.

private void serializeSuccess(final SuccessCase s, final ByteBuf buffer) {
    if (s == null || s.getSuccess() == null) {
        return;
    }
    for (final Paths p : s.getSuccess().getPaths()) {
        serializeObject(p.getEro(), buffer);
        serializeObject(p.getLspa(), buffer);
        serializeObject(p.getOf(), buffer);
        serializeObject(p.getBandwidth(), buffer);
        if (p.getMetrics() != null) {
            for (final Metrics m : p.getMetrics()) {
                serializeObject(m.getMetric(), buffer);
            }
        }
        serializeObject(p.getIro(), buffer);
    }
    serializeVendorInformationObjects(s.getSuccess().getVendorInformationObject(), buffer);
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics) Paths(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.success._case.success.Paths)

Aggregations

Metrics (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics)1 FailureCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.FailureCase)1 SuccessCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.SuccessCase)1 Paths (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.success._case.success.Paths)1