Search in sources :

Example 51 with TlvsBuilder

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());
}
Also used : LspDbVersion(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.lsp.db.version.tlv.LspDbVersion) SpeakerEntityId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.speaker.entity.id.tlv.SpeakerEntityId) Tlvs3Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Tlvs3Builder) Tlvs3(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Tlvs3)

Example 52 with TlvsBuilder

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());
}
Also used : PCEPStatefulCapability(org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability) TlvsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 ByteBuf (io.netty.buffer.ByteBuf)8 TlvsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder)8 TlvsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.initiation.TlvsBuilder)7 LspBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.object.LspBuilder)6 TlvsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.object.lsp.TlvsBuilder)6 Tlvs3Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Tlvs3Builder)5 BitArray (org.opendaylight.protocol.util.BitArray)4 Ipv4AddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone)4 PlspId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.PlspId)4 Ipv4ExtendedTunnelId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.Ipv4ExtendedTunnelId)4 LspId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId)4 ObjectHeaderImpl (org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl)3 InitiationMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.InitiationMessageBuilder)3 SrpIdNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.SrpIdNumber)3 SrpBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.srp.object.SrpBuilder)3 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 Before (org.junit.Before)2 BmpDeserializationException (org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException)2