use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.srp.object.srp.TlvsBuilder in project bgpcep by opendaylight.
the class SyncOptimizationsOpenObjectParser method addTlv.
@Override
public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
super.addTlv(tbuilder, tlv);
final Tlvs3Builder syncOptTlvsBuilder = new Tlvs3Builder();
if (tbuilder.augmentation(Tlvs3.class) != null) {
final Tlvs3 t = tbuilder.augmentation(Tlvs3.class);
if (t.getLspDbVersion() != null) {
syncOptTlvsBuilder.setLspDbVersion(t.getLspDbVersion());
}
if (t.getSpeakerEntityId() != null) {
syncOptTlvsBuilder.setSpeakerEntityId(t.getSpeakerEntityId());
}
}
if (tlv instanceof LspDbVersion) {
syncOptTlvsBuilder.setLspDbVersion((LspDbVersion) tlv);
}
if (tlv instanceof SpeakerEntityId) {
syncOptTlvsBuilder.setSpeakerEntityId((SpeakerEntityId) tlv);
}
tbuilder.addAugmentation(syncOptTlvsBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.srp.object.srp.TlvsBuilder in project bgpcep by opendaylight.
the class PCEPStatefulCapabilityTest method testPCEPStatefulCapability.
@Test
public void testPCEPStatefulCapability() {
final PCEPStatefulCapability sspf = new PCEPStatefulCapability(true, true, true, true, false, true, false);
assertTrue(sspf.isActive());
assertTrue(sspf.isInstant());
assertTrue(sspf.isStateful());
assertFalse(sspf.isTriggeredResync());
assertTrue(sspf.isTriggeredSync());
assertTrue(sspf.isDeltaLspSync());
assertTrue(sspf.isIncludeDbVersion());
final TlvsBuilder builder = new TlvsBuilder();
sspf.setCapabilityProposal(null, builder);
assertEquals(EXPECTED_TLVS, builder.build());
}
Aggregations