Search in sources :

Example 1 with UnreservedBandwidthBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidthBuilder in project bgpcep by opendaylight.

the class LinkAttributesParser method parseUnreservedBandwidth.

private static void parseUnreservedBandwidth(final ByteBuf value, final LinkAttributesBuilder builder) {
    final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidth> unreservedBandwidth = new ArrayList<>(UNRESERVED_BW_COUNT);
    for (int i = 0; i < UNRESERVED_BW_COUNT; i++) {
        final ByteBuf v = value.readSlice(BANDWIDTH_LENGTH);
        unreservedBandwidth.add(new UnreservedBandwidthBuilder().setBandwidth(new Bandwidth(ByteArray.readAllBytes(v))).setPriority((short) i).build());
    }
    builder.setUnreservedBandwidth(unreservedBandwidth);
    LOG.debug("Parsed Unreserved Bandwidth {}", builder.getUnreservedBandwidth());
}
Also used : UnreservedBandwidth(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidth) ArrayList(java.util.ArrayList) ByteBuf(io.netty.buffer.ByteBuf) UnreservedBandwidthBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidthBuilder) Bandwidth(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth) UnreservedBandwidth(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidth)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 ArrayList (java.util.ArrayList)1 UnreservedBandwidth (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidth)1 UnreservedBandwidthBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.attribute.UnreservedBandwidthBuilder)1 Bandwidth (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth)1