Search in sources :

Example 6 with Stateful1Builder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Stateful1Builder in project bgpcep by opendaylight.

the class SyncOptimizationsCapabilityTlvParser method parseFlags.

@Override
protected void parseFlags(final StatefulBuilder sb, final ByteBuf buffer) {
    final BitArray flags = BitArray.valueOf(buffer, FLAGS_F_LENGTH);
    sb.setLspUpdateCapability(flags.get(U_FLAG_OFFSET));
    if (flags.get(I_FLAG_OFFSET)) {
        sb.addAugmentation(new Stateful1Builder().setInitiation(Boolean.TRUE).build());
    }
    final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Stateful1Builder syncOptBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Stateful1Builder();
    if (flags.get(S_FLAG_OFFSET)) {
        syncOptBuilder.setIncludeDbVersion(Boolean.TRUE);
    }
    if (flags.get(T_FLAG_OFFSET)) {
        syncOptBuilder.setTriggeredResync(Boolean.TRUE);
    }
    if (flags.get(D_FLAG_OFFSET)) {
        syncOptBuilder.setDeltaLspSyncCapability(Boolean.TRUE);
    }
    if (flags.get(F_FLAG_OFFSET)) {
        syncOptBuilder.setTriggeredInitialSync(Boolean.TRUE);
    }
    sb.addAugmentation(syncOptBuilder.build());
}
Also used : Stateful1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Stateful1Builder) BitArray(org.opendaylight.protocol.util.BitArray)

Aggregations

BitArray (org.opendaylight.protocol.util.BitArray)3 StatefulBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.stateful.capability.tlv.StatefulBuilder)3 ByteBuf (io.netty.buffer.ByteBuf)2 Test (org.junit.Test)2 Stateful1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Stateful1Builder)2 Stateful1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Stateful1Builder)2 Tlvs1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.Tlvs1Builder)2 Stateful (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.stateful.capability.tlv.Stateful)2 Before (org.junit.Before)1 DataTreeChangeListener (org.opendaylight.mdsal.binding.api.DataTreeChangeListener)1 ObjectHeaderImpl (org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl)1 SyncOptimizationsActivator (org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsActivator)1 SyncOptimizationsCapabilityTlvParser (org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsCapabilityTlvParser)1 SyncOptimizationsOpenObjectParser (org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsOpenObjectParser)1 Tlvs3Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Tlvs3Builder)1 LspDbVersionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.lsp.db.version.tlv.LspDbVersionBuilder)1 SpeakerEntityIdBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.speaker.entity.id.tlv.SpeakerEntityIdBuilder)1 Stateful1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.Stateful1Builder)1 TlvsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.srp.object.srp.TlvsBuilder)1 ProtocolVersion (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ProtocolVersion)1