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();
}
Aggregations