use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.att.subobject.lsp.subobject.FlagsTlvBuilder in project bgpcep by opendaylight.
the class RequiredAttributesObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final LspRequiredAttributesObjectBuilder builder = new LspRequiredAttributesObjectBuilder();
final List<SubobjectContainer> subObjectList = new ArrayList<>();
while (byteBuf.isReadable()) {
final int type = byteBuf.readUnsignedShort();
final int length = byteBuf.readUnsignedShort();
final ByteBuf value = byteBuf.readSlice(length);
final SubobjectContainerBuilder subObj = new SubobjectContainerBuilder();
if (type == AttributesObjectParser.FLAG_TLV_TYPE) {
subObj.setLspSubobject(new FlagsTlvBuilder().setFlagContainer(AttributesObjectParser.parseFlag(value)).build());
} else {
LOG.warn("Lsp Attributes Subobject type {} not supported", type);
}
subObjectList.add(subObj.build());
}
return builder.setLspAttributesObject(new LspAttributesObjectBuilder().setSubobjectContainer(subObjectList).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.att.subobject.lsp.subobject.FlagsTlvBuilder in project bgpcep by opendaylight.
the class AttributesObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final LspAttributesObjectBuilder builder = new LspAttributesObjectBuilder();
final List<SubobjectContainer> subObjectList = new ArrayList<>();
while (byteBuf.isReadable()) {
final int type = byteBuf.readUnsignedShort();
final int length = byteBuf.readUnsignedShort();
final ByteBuf value = byteBuf.readSlice(length);
final SubobjectContainerBuilder subObj = new SubobjectContainerBuilder();
if (type == FLAG_TLV_TYPE) {
subObj.setLspSubobject(new FlagsTlvBuilder().setFlagContainer(parseFlag(value)).build());
} else {
LOG.warn("Lsp Attributes Subobject type {} not supported", type);
}
subObjectList.add(subObj.build());
}
return builder.setSubobjectContainer(subObjectList).build();
}
Aggregations