Search in sources :

Example 1 with SessionAttributeObjectWithResourcesAffinitiesBuilder

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

the class SessionAttributeLspRaObjectParser method localParseObject.

@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
    final SessionAttributeObjectWithResourcesAffinitiesBuilder builder = new SessionAttributeObjectWithResourcesAffinitiesBuilder();
    builder.setIncludeAny(new AttributeFilter(byteBuf.readUnsignedInt()));
    builder.setExcludeAny(new AttributeFilter(byteBuf.readUnsignedInt()));
    builder.setIncludeAll(new AttributeFilter(byteBuf.readUnsignedInt()));
    builder.setSetupPriority(byteBuf.readUnsignedByte());
    builder.setHoldPriority(byteBuf.readUnsignedByte());
    final BitArray bs = BitArray.valueOf(byteBuf.readByte());
    builder.setLocalProtectionDesired(bs.get(SessionAttributeLspObjectParser.LOCAL_PROTECTION));
    builder.setLabelRecordingDesired(bs.get(SessionAttributeLspObjectParser.LABEL_RECORDING));
    builder.setSeStyleDesired(bs.get(SessionAttributeLspObjectParser.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 : SessionAttributeObjectWithResourcesAffinitiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.session.attribute.object.session.attribute.object.SessionAttributeObjectWithResourcesAffinitiesBuilder) AttributeFilter(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter) BitArray(org.opendaylight.protocol.util.BitArray) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

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