Search in sources :

Example 1 with SuccessCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.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.rev181109.pcrep.message.pcrep.message.replies.result.FailureCase) SuccessCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.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.rev181109.pcrep.message.pcrep.message.replies.result.SuccessCase in project bgpcep by opendaylight.

the class PCEPReplyMessageParser method serializeSuccess.

private void serializeSuccess(final SuccessCase success, final ByteBuf buffer) {
    if (success == null || success.getSuccess() == null) {
        return;
    }
    for (final Paths p : success.getSuccess().nonnullPaths()) {
        serializeObject(p.getEro(), buffer);
        serializeObject(p.getLspa(), buffer);
        serializeObject(p.getOf(), buffer);
        serializeObject(p.getBandwidth(), buffer);
        for (final Metrics m : p.nonnullMetrics()) {
            serializeObject(m.getMetric(), buffer);
        }
        serializeObject(p.getIro(), buffer);
    }
    serializeVendorInformationObjects(success.getSuccess().getVendorInformationObject(), buffer);
}
Also used : Metrics(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics) Paths(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.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.rev181109.lsp.attributes.Metrics)1 FailureCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.FailureCase)1 SuccessCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.SuccessCase)1 Paths (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.success._case.success.Paths)1