Search in sources :

Example 1 with BasicSessionAttributeObjectBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.session.attribute.object.session.attribute.object.BasicSessionAttributeObjectBuilder in project bgpcep by opendaylight.

the class SessionAttributeLspObjectParser method localParseObject.

@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
    final BasicSessionAttributeObjectBuilder builder = new BasicSessionAttributeObjectBuilder();
    builder.setSetupPriority(byteBuf.readUnsignedByte());
    builder.setHoldPriority(byteBuf.readUnsignedByte());
    final BitArray bs = BitArray.valueOf(byteBuf.readByte());
    builder.setLocalProtectionDesired(bs.get(LOCAL_PROTECTION));
    builder.setLabelRecordingDesired(bs.get(LABEL_RECORDING));
    builder.setSeStyleDesired(bs.get(SE_STYLE));
    final short nameLenght = byteBuf.readUnsignedByte();
    final ByteBuf auxBuf = byteBuf.readSlice(nameLenght);
    final String name = new String(ByteArray.readAllBytes(auxBuf), StandardCharsets.US_ASCII);
    builder.setSessionName(name);
    return builder.build();
}
Also used : BitArray(org.opendaylight.protocol.util.BitArray) ByteBuf(io.netty.buffer.ByteBuf) BasicSessionAttributeObjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.session.attribute.object.session.attribute.object.BasicSessionAttributeObjectBuilder)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 BitArray (org.opendaylight.protocol.util.BitArray)1 BasicSessionAttributeObjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.session.attribute.object.session.attribute.object.BasicSessionAttributeObjectBuilder)1