Search in sources :

Example 1 with AvoidNodeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.AvoidNodeBuilder in project bgpcep by opendaylight.

the class DetourObjectIpv6Parser method localParseObject.

@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) {
    final ByteBuf plrId = byteBuf.readSlice(byteBuf.capacity() / 2);
    final Ipv6DetourObjectBuilder ipv6Case = new Ipv6DetourObjectBuilder();
    final List<PlrId> plrIdList = new ArrayList<>();
    while (plrId.isReadable()) {
        final PlrIdBuilder plr = new PlrIdBuilder();
        plr.setPlrId(Ipv6Util.addressForByteBuf(plrId));
        plrIdList.add(plr.build());
    }
    final List<AvoidNode> avoidNodeList = new ArrayList<>();
    while (byteBuf.isReadable()) {
        final AvoidNodeBuilder plr = new AvoidNodeBuilder();
        plr.setAvoidNode(Ipv6Util.addressForByteBuf(byteBuf));
        avoidNodeList.add(plr.build());
    }
    return ipv6Case.setPlrId(plrIdList).setAvoidNode(avoidNodeList).build();
}
Also used : PlrIdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.PlrIdBuilder) AvoidNode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.AvoidNode) ArrayList(java.util.ArrayList) Ipv6DetourObjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.Ipv6DetourObjectBuilder) AvoidNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.AvoidNodeBuilder) PlrId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.PlrId) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 ArrayList (java.util.ArrayList)1 Ipv6DetourObjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.Ipv6DetourObjectBuilder)1 AvoidNode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.AvoidNode)1 AvoidNodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.AvoidNodeBuilder)1 PlrId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.PlrId)1 PlrIdBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.PlrIdBuilder)1