use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.path.attribute.link.state.attribute.TeLspAttributesCaseBuilder in project bgpcep by opendaylight.
the class TeLspAttributesParser method parseTeLspAttributes.
static LinkStateAttribute parseTeLspAttributes(final RSVPTeObjectRegistry registry, final ByteBuf attributes) throws BGPParsingException {
final TeLspAttributesBuilder builder = new TeLspAttributesBuilder();
LOG.trace("Initiated parsing TE LSP Objects.");
while (attributes.isReadable()) {
final int length = attributes.readUnsignedShort();
final int classNum = attributes.readUnsignedByte();
final int cType = attributes.readUnsignedByte();
final ByteBuf value = attributes.readSlice(length);
try {
addObject(builder, registry.parseRSPVTe(classNum, cType, value));
} catch (final RSVPParsingException e) {
LOG.debug("Parsering TE LSP Object error. class number: {} cType: {} value: {}", classNum, cType, value, e);
throw new BGPParsingException(e.getMessage());
}
}
LOG.trace("Finished parsing TE LSP Objects.");
return new TeLspAttributesCaseBuilder().setTeLspAttributes(builder.build()).build();
}
Aggregations