Search in sources :

Example 6 with Srro

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.secondary.reported.route.object.Srro in project bgpcep by opendaylight.

the class SecondaryRecordRouteObjectParser method localSerializeObject.

@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
    Preconditions.checkArgument(teLspObject instanceof SecondaryRecordRouteObject, "RecordRouteObject is mandatory.");
    final SecondaryRecordRouteObject srro = (SecondaryRecordRouteObject) teLspObject;
    final ByteBuf bufferAux = Unpooled.buffer();
    final List<SubobjectContainer> srroSbo = srro.nonnullSubobjectContainer().stream().map(so -> new SubobjectContainerBuilder().setProtectionAvailable(so.getProtectionAvailable()).setProtectionInUse(so.getProtectionInUse()).setSubobjectType(so.getSubobjectType()).build()).collect(Collectors.toList());
    serializeList(srroSbo, bufferAux);
    serializeAttributeHeader(bufferAux.readableBytes(), CLASS_NUM, CTYPE, output);
    output.writeBytes(bufferAux);
}
Also used : SubobjectContainer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainer) SecondaryRecordRouteObjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary._record.route.object.SecondaryRecordRouteObjectBuilder) RSVPParsingException(org.opendaylight.protocol.rsvp.parser.spi.RSVPParsingException) SubobjectContainer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainer) RsvpTeObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject) Collectors(java.util.stream.Collectors) Unpooled(io.netty.buffer.Unpooled) SecondaryRecordRouteObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary._record.route.object.SecondaryRecordRouteObject) List(java.util.List) RROSubobjectListParser(org.opendaylight.protocol.rsvp.parser.spi.subobjects.RROSubobjectListParser) ByteBuf(io.netty.buffer.ByteBuf) Preconditions(com.google.common.base.Preconditions) RROSubobjectRegistry(org.opendaylight.protocol.rsvp.parser.spi.RROSubobjectRegistry) SubobjectContainerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainerBuilder) SubobjectContainerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820._record.route.subobjects.list.SubobjectContainerBuilder) SecondaryRecordRouteObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary._record.route.object.SecondaryRecordRouteObject) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)4 Preconditions (com.google.common.base.Preconditions)3 Unpooled (io.netty.buffer.Unpooled)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 RROSubobjectRegistry (org.opendaylight.protocol.rsvp.parser.spi.RROSubobjectRegistry)2 RSVPParsingException (org.opendaylight.protocol.rsvp.parser.spi.RSVPParsingException)2 RROSubobjectListParser (org.opendaylight.protocol.rsvp.parser.spi.subobjects.RROSubobjectListParser)2 Object (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object)2 Subobject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.Subobject)2 Srro (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.secondary.reported.route.object.Srro)2 SrroBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.secondary.reported.route.object.SrroBuilder)2 SubobjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.secondary.reported.route.object.srro.SubobjectBuilder)2 SecondaryRecordRouteObject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary._record.route.object.SecondaryRecordRouteObject)2 ObjectUtil (org.opendaylight.protocol.pcep.spi.ObjectUtil)1 PCEPDeserializerException (org.opendaylight.protocol.pcep.spi.PCEPDeserializerException)1 RROSubobjectRegistry (org.opendaylight.protocol.pcep.spi.RROSubobjectRegistry)1 TeLspAttributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.path.attribute.link.state.attribute.te.lsp.attributes._case.TeLspAttributes)1 ObjectHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader)1 Bandwidth (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.bandwidth.object.Bandwidth)1