Remove PCEPCapability.isStateful() 38/104038/12
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 16 Jan 2023 12:32:11 +0000 (13:32 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 16 Jan 2023 22:36:18 +0000 (23:36 +0100)
This is a useless method leaking a particular capability. Remove it and
adjust users.

JIRA: BGPCEP-960
Change-Id: Iedf491ef8f276ea27acca9ac40892200c857dc23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 files changed:
pcep/api/src/main/java/org/opendaylight/protocol/pcep/PCEPCapability.java
pcep/ietf-p2mp-te-lsp/src/main/java/org/opendaylight/protocol/pcep/p2mp/te/lsp/P2MPTeLspCapability.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/PCEPStatefulCapability.java
pcep/ietf-stateful/src/main/yang/odl-pcep-ietf-stateful-config.yang
pcep/ietf-stateful/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPStatefulCapabilityTest.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/Main.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCIncrementalSyncTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncAvoidanceProcedureTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredFullDBResyncTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredLspResyncTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredSyncTest.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/PCEPSegmentRoutingCapability.java
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/Main.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPTopologyConfiguration.java
pcep/topology/topology-provider/src/main/yang/odl-pcep-topology-provider.yang

index 8ff95ebf4283638769b74c69bc1c1f4e5cca638b..6ea4b75bdad27e3451498fba9793445f619085e4 100644 (file)
@@ -14,7 +14,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
  * Stores usability for available capabilities.
  */
 public interface PCEPCapability {
-
     /**
      * Sets stateful capabilities tlv in incoming builder.
      *
@@ -22,11 +21,4 @@ public interface PCEPCapability {
      * @param builder for TLVs included in PCEPOpenObject
      */
     void setCapabilityProposal(InetSocketAddress address, TlvsBuilder builder);
-
-    /**
-     * Returs stateful capability state.
-     *
-     * @return true if capability is present
-     */
-    boolean isStateful();
 }
index 1b37bd8ca6bea6f4fc2dc1e28a6a26aaa3db8147..e719ad3906f08bef700cb698c6ddc5f63d953339 100644 (file)
@@ -24,11 +24,6 @@ public final class P2MPTeLspCapability implements PCEPCapability {
             .build());
     }
 
-    @Override
-    public boolean isStateful() {
-        return false;
-    }
-
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(this).toString();
index f41ed520e6d9f363e7b41f2e818a93edf8b20ea3..6dc327750a5b7cba08081659f82b836deebb5637 100644 (file)
@@ -18,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 
 @MetaInfServices
 public final class PCEPStatefulCapability implements PCEPCapability {
-    private final boolean stateful;
     private final boolean active;
     private final boolean initiated;
     private final boolean triggeredSync;
@@ -27,13 +26,11 @@ public final class PCEPStatefulCapability implements PCEPCapability {
     private final boolean includeDbVersion;
 
     public PCEPStatefulCapability() {
-        this(true, true, true, true, true, true, true);
+        this(true, true, true, true, true, true);
     }
 
-    public PCEPStatefulCapability(final boolean stateful, final boolean active, final boolean initiated,
-            final boolean triggeredSync, final boolean triggeredResync, final boolean deltaLspSync,
-            final boolean includeDbVersion) {
-        this.stateful = stateful || active || triggeredSync || triggeredResync || deltaLspSync || includeDbVersion;
+    public PCEPStatefulCapability(final boolean active, final boolean initiated, final boolean triggeredSync,
+            final boolean triggeredResync, final boolean deltaLspSync, final boolean includeDbVersion) {
         this.active = active;
         this.initiated = initiated;
         this.triggeredSync = triggeredSync;
@@ -43,31 +40,24 @@ public final class PCEPStatefulCapability implements PCEPCapability {
     }
 
     public PCEPStatefulCapability(final StatefulCapabilities config) {
-        this(config.getStateful(), config.getActive(), config.getInitiated(), config.getTriggeredInitialSync(),
+        this(config.getActive(), config.getInitiated(), config.getTriggeredInitialSync(),
                 config.getTriggeredResync(), config.getDeltaLspSyncCapability(), config.getIncludeDbVersion());
     }
 
     @Override
     public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
-        if (stateful) {
-            builder.addAugmentation(new Tlvs1Builder()
-                .setStateful(new StatefulBuilder().setLspUpdateCapability(active)
-                    .addAugmentation(new Stateful1Builder().setInitiation(initiated).build())
-                    .addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller
-                        .pcep.sync.optimizations.rev200720.Stateful1Builder()
-                            .setTriggeredInitialSync(triggeredSync)
-                            .setTriggeredResync(triggeredResync)
-                            .setDeltaLspSyncCapability(deltaLspSync)
-                            .setIncludeDbVersion(includeDbVersion)
-                            .build())
-                    .build())
-                .build());
-        }
-    }
-
-    @Override
-    public boolean isStateful() {
-        return stateful;
+        builder.addAugmentation(new Tlvs1Builder()
+            .setStateful(new StatefulBuilder().setLspUpdateCapability(active)
+                .addAugmentation(new Stateful1Builder().setInitiation(initiated).build())
+                .addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller
+                    .pcep.sync.optimizations.rev200720.Stateful1Builder()
+                        .setTriggeredInitialSync(triggeredSync)
+                        .setTriggeredResync(triggeredResync)
+                        .setDeltaLspSyncCapability(deltaLspSync)
+                        .setIncludeDbVersion(includeDbVersion)
+                        .build())
+                .build())
+            .build());
     }
 
     public boolean isActive() {
index 09204d68fe93371263fe38cc6670fadcd42da199..6d92d4e8820499356641dc38ec1aac6f6c6100c9 100644 (file)
@@ -23,11 +23,6 @@ module odl-pcep-ietf-stateful-config {
             default true;
         }
 
-        leaf stateful {
-            type boolean;
-            default true;
-        }
-
         leaf active {
             type boolean;
             default true;
index 369f1059e24ed39f1434e321480e80c72e07dbc2..eb6e2524b341bd825e344dd794c80ddc04d1fa95 100644 (file)
@@ -16,12 +16,21 @@ import org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Stateful1Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.Tlvs1Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.stateful.capability.tlv.StatefulBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
 
 public class PCEPStatefulCapabilityTest {
-
-    private static final Tlvs EXPECTED_TLVS = new TlvsBuilder()
+    @Test
+    public void testPCEPStatefulCapability() {
+        final PCEPStatefulCapability sspf = new PCEPStatefulCapability(true, true, true, false, true, false);
+        assertTrue(sspf.isActive());
+        assertTrue(sspf.isInstant());
+        assertFalse(sspf.isTriggeredResync());
+        assertTrue(sspf.isTriggeredSync());
+        assertTrue(sspf.isDeltaLspSync());
+        assertTrue(sspf.isIncludeDbVersion());
+        final TlvsBuilder builder = new TlvsBuilder();
+        sspf.setCapabilityProposal(null, builder);
+        assertEquals(new TlvsBuilder()
             .addAugmentation(new Tlvs1Builder()
                 .setStateful(new StatefulBuilder().setLspUpdateCapability(true)
                     .addAugmentation(new Stateful1Builder().setInitiation(true).build())
@@ -34,20 +43,6 @@ public class PCEPStatefulCapabilityTest {
                             .build())
                     .build())
                 .build())
-            .build();
-
-    @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());
+            .build(), builder.build());
     }
 }
index 03335b24477f8973644bf9fead4277ac703508bf..9f9eb3b7aea3c3c748db9c6d1424e07c4607ab4d 100755 (executable)
@@ -154,8 +154,7 @@ public final class Main {
         if (triggeredInitSync) {
             Preconditions.checkArgument(includeDbv);
         }
-        return new PCEPStatefulCapability(true, true, true, triggeredInitSync, triggeredResync,
-                incrementalSync, includeDbv);
+        return new PCEPStatefulCapability(true, true, triggeredInitSync, triggeredResync, incrementalSync, includeDbv);
     }
 
     private static ch.qos.logback.classic.Logger getRootLogger(final LoggerContext lc) {
index ea7a65c8343304895bac5e710e3fbe6595b6d228..96af3bf6989be9ee80959670ead5e3bfd59ca2e6 100644 (file)
@@ -8,8 +8,6 @@
 package org.opendaylight.protocol.pcep.pcc.mock;
 
 import io.netty.channel.Channel;
-import java.math.BigInteger;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import org.junit.Test;
@@ -20,24 +18,22 @@ import org.opendaylight.protocol.util.InetSocketAddressUtil;
 import org.opendaylight.yangtools.yang.common.Uint64;
 
 public class PCCIncrementalSyncTest extends PCCMockCommon {
-
-    private final BigInteger lsp = BigInteger.valueOf(8);
     /**
      * Test Incremental Synchronization
      * Create 8 lsp, then it disconnects after 5 sec and then after 5 sec reconnects with Pcc DBVersion 10
      * After reconnection PCE has DBVersion 10, therefore there is 9 changes missed. 9 Pcrt + 1 Pcrt-Sync
      */
-    private final String[] mainInputIncrementalSync = new String[]{"--local-address", this.localAddress.getHostString(),
-        "--remote-address", InetSocketAddressUtil.toHostAndPort(this.remoteAddress).toString(), "--pcc", "1", "--lsp",
-        this.lsp.toString(), "--log-level", "DEBUG", "-ka", "30", "-d", "120", "--reconnect", "-1",
+    private final String[] mainInputIncrementalSync = new String[]{"--local-address", localAddress.getHostString(),
+        "--remote-address", InetSocketAddressUtil.toHostAndPort(remoteAddress).toString(), "--pcc", "1", "--lsp",
+        "8", "--log-level", "DEBUG", "-ka", "30", "-d", "120", "--reconnect", "-1",
         "--redelegation-timeout", "0", "--state-timeout", "-1", "--incremental-sync-procedure", "10", "5", "5"};
 
     @Test
     public void testSessionIncrementalSyncEstablishment() throws Exception {
         final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
         final Uint64 numberOflspAndDBv = Uint64.valueOf(8);
-        final Channel channel = createServer(factory, this.remoteAddress, new PCCServerPeerProposal(numberOflspAndDBv));
-        Main.main(this.mainInputIncrementalSync);
+        final Channel channel = createServer(factory, remoteAddress, new PCCServerPeerProposal(numberOflspAndDBv));
+        Main.main(mainInputIncrementalSync);
         final TestingSessionListener pceSessionListener = getListener(factory);
         checkSynchronizedSession(8, pceSessionListener, numberOflspAndDBv);
         Thread.sleep(6000);
@@ -51,8 +47,6 @@ public class PCCIncrementalSyncTest extends PCCMockCommon {
 
     @Override
     protected List<PCEPCapability> getCapabilities() {
-        final List<PCEPCapability> caps = new ArrayList<>();
-        caps.add(new PCEPStatefulCapability(true, true, true, false, false, true, true));
-        return caps;
+        return List.of(new PCEPStatefulCapability(true, true, false, false, true, true));
     }
 }
index 1ecd9b7d1989215cc6219a6818c837fa188339c9..d1ff78a9798e1fc0b8ec33a58e64cedd7acb619d 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 import static org.junit.Assert.assertNotNull;
 
 import io.netty.channel.Channel;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import org.junit.Test;
@@ -25,7 +24,7 @@ public class PCCSyncAvoidanceProcedureTest extends PCCMockCommon {
     public void testSessionAvoidanceDesynchronizedEstablishment() throws Exception {
         final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
 
-        final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
+        final Channel channel = createServer(factory, remoteAddress, new PCCPeerProposal());
         final PCEPSession session = createPCCSession(Uint64.TEN).get();
         assertNotNull(session);
         final TestingSessionListener pceSessionListener = getListener(factory);
@@ -37,9 +36,6 @@ public class PCCSyncAvoidanceProcedureTest extends PCCMockCommon {
 
     @Override
     protected List<PCEPCapability> getCapabilities() {
-        final List<PCEPCapability> caps = new ArrayList<>();
-        caps.add(new PCEPStatefulCapability(true, true, true, false,
-            false, false, true));
-        return caps;
+        return List.of(new PCEPStatefulCapability(true, true, false, false, false, true));
     }
 }
index c14f5feaabc0add7e6071d5d78e5796ed3fe5b46..060bdca0a077dbeb8159836c1a4f7be28c992509 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 import static org.junit.Assert.assertNotNull;
 
 import io.netty.channel.Channel;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import org.junit.Test;
@@ -40,13 +38,13 @@ public class PCCTriggeredFullDBResyncTest extends PCCMockCommon {
         final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
         final int lspQuantity = 3;
         final Uint64 numberOflspAndDBv = Uint64.valueOf(lspQuantity);
-        final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
+        final Channel channel = createServer(factory, remoteAddress, new PCCPeerProposal());
         final PCEPSession session = createPCCSession(numberOflspAndDBv).get();
         assertNotNull(session);
         final TestingSessionListener pceSessionListener = getListener(factory);
         assertNotNull(pceSessionListener);
         checkSynchronizedSession(lspQuantity, pceSessionListener, numberOflspAndDBv);
-        this.pccSessionListener.onMessage(session, createTriggerLspResync());
+        pccSessionListener.onMessage(session, createTriggerLspResync());
         final TestingSessionListener sessionListenerAfterReconnect = getListener(factory);
         checkResyncSession(Optional.of(lspQuantity), 4,8, null, numberOflspAndDBv, sessionListenerAfterReconnect);
         channel.close().get();
@@ -64,14 +62,12 @@ public class PCCTriggeredFullDBResyncTest extends PCCMockCommon {
                 .setLsp(lsp)
                 .setPath(new PathBuilder().build());
         final PcupdMessageBuilder ub = new PcupdMessageBuilder();
-        ub.setUpdates(Collections.singletonList(rb.build()));
+        ub.setUpdates(List.of(rb.build()));
         return new PcupdBuilder().setPcupdMessage(ub.build()).build();
     }
 
     @Override
     protected List<PCEPCapability> getCapabilities() {
-        final List<PCEPCapability> caps = new ArrayList<>();
-        caps.add(new PCEPStatefulCapability(true, true, true, false, true, false, true));
-        return caps;
+        return List.of(new PCEPStatefulCapability(true, true, false, true, false, true));
     }
 }
index 4d0eab720359f6d09f2de4dcb3a62fe9d1ee6b3e..ac643c805aa009da1095ad8f045c03e191ee7fb9 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 import static org.junit.Assert.assertNotNull;
 
 import io.netty.channel.Channel;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import org.junit.Test;
@@ -40,13 +38,13 @@ public class PCCTriggeredLspResyncTest extends PCCMockCommon {
         final int lspQuantity = 3;
         final Uint64 numberOflspAndDBv = Uint64.valueOf(lspQuantity);
 
-        final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
+        final Channel channel = createServer(factory, remoteAddress, new PCCPeerProposal());
         final PCEPSession session = createPCCSession(numberOflspAndDBv).get();
         assertNotNull(session);
         final TestingSessionListener pceSessionListener = getListener(factory);
         assertNotNull(pceSessionListener);
         checkSynchronizedSession(lspQuantity, pceSessionListener, numberOflspAndDBv);
-        this.pccSessionListener.onMessage(session, createTriggerLspResync());
+        pccSessionListener.onMessage(session, createTriggerLspResync());
         final TestingSessionListener sessionListenerAfterReconnect = getListener(factory);
         checkResyncSession(Optional.of(lspQuantity), 2, 6, null, numberOflspAndDBv, sessionListenerAfterReconnect);
         channel.close().get();
@@ -65,14 +63,12 @@ public class PCCTriggeredLspResyncTest extends PCCMockCommon {
         final PathBuilder pb = new PathBuilder();
         rb.setPath(pb.build());
         final PcupdMessageBuilder ub = new PcupdMessageBuilder();
-        ub.setUpdates(Collections.singletonList(rb.build()));
+        ub.setUpdates(List.of(rb.build()));
         return new PcupdBuilder().setPcupdMessage(ub.build()).build();
     }
 
     @Override
     protected List<PCEPCapability> getCapabilities() {
-        final List<PCEPCapability> caps = new ArrayList<>();
-        caps.add(new PCEPStatefulCapability(true, true, true, false, true, false, true));
-        return caps;
+        return List.of(new PCEPStatefulCapability(true, true, false, true, false, true));
     }
 }
index 2b8f1ba65ab6fd1853a09640c70417b32e7c944c..89fa91fd6dd42f21541c47c9778ad5ba73f3193e 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 import static org.junit.Assert.assertNotNull;
 
 import io.netty.channel.Channel;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import org.junit.Test;
 import org.opendaylight.protocol.pcep.PCEPCapability;
@@ -34,14 +32,14 @@ public class PCCTriggeredSyncTest extends PCCMockCommon {
     @Test
     public void testSessionTriggeredSync() throws Exception {
         final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
-        final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
+        final Channel channel = createServer(factory, remoteAddress, new PCCPeerProposal());
         final Uint64 numberOflspAndDBv = Uint64.valueOf(3);
         final PCEPSession session = createPCCSession(numberOflspAndDBv).get();
         assertNotNull(session);
         final TestingSessionListener pceSessionListener = getListener(factory);
         assertNotNull(pceSessionListener);
         checkSynchronizedSession(0, pceSessionListener, Uint64.ZERO);
-        this.pccSessionListener.onMessage(session, createTriggerMsg());
+        pccSessionListener.onMessage(session, createTriggerMsg());
         checkSynchronizedSession(3, pceSessionListener, numberOflspAndDBv);
         channel.close().get();
     }
@@ -57,15 +55,13 @@ public class PCCTriggeredSyncTest extends PCCMockCommon {
                 .setLsp(new LspBuilder().setPlspId(new PlspId(Uint32.ZERO)).setSync(Boolean.TRUE).build())
                 .setPath(new PathBuilder().build());
         final PcupdMessageBuilder ub = new PcupdMessageBuilder();
-        ub.setUpdates(Collections.singletonList(rb.build()));
+        ub.setUpdates(List.of(rb.build()));
         return new PcupdBuilder().setPcupdMessage(ub.build()).build();
     }
 
     @Override
     protected List<PCEPCapability> getCapabilities() {
-        final List<PCEPCapability> caps = new ArrayList<>();
-        caps.add(new PCEPStatefulCapability(true, true, true, true, false, false, true));
-        return caps;
+        return List.of(new PCEPStatefulCapability(true, true, true, false, false, true));
     }
 }
 
index c0490b6a2f3942b5a8b8a257f846a2a8c0edbdcc..b7d583875080a791cd2f6c9204764234af85a3ba 100644 (file)
@@ -29,11 +29,6 @@ public class PCEPSegmentRoutingCapability implements PCEPCapability {
             .build());
     }
 
-    @Override
-    public boolean isStateful() {
-        return false;
-    }
-
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(this).toString();
index f928d46bc8703e20c4797304e69592b4d4fc29c6..089438918e758747d0b2985be265fcfb51796488 100644 (file)
@@ -127,7 +127,7 @@ public final class Main {
         dispatcher.createServer(address, KeyMapping.of(), handlerRegistry, new DefaultPCEPSessionNegotiatorFactory(
             new TestingSessionListenerFactory(),
             new PCEPTimerProposal(keepAliveValue, deadTimerValue),
-            List.of(new PCEPStatefulCapability(stateful, active, instant, false, false, false, false)),
+            stateful ? List.of(new PCEPStatefulCapability(active, instant, false, false, false, false)) : List.of(),
             maxUnknownMessages, null)).get();
     }
 }
index 0eb551b022c6c4fee34b05dafded5b89a9a87e46..d17d9e8197bcb56f1aba67afc578935fe9195de8 100644 (file)
@@ -89,7 +89,7 @@ final class PCEPTopologyConfiguration implements Immutable {
         }
         final var capabilityAug = topologyPcep.augmentation(TopologyPcep1.class);
         final var capabilities = capabilityAug != null ? capabilityAug.getCapabilities() : null;
-        if (capabilities != null && !capabilities.nonnullStateful().requireStateful()) {
+        if (capabilities != null && !capabilities.nonnullStateful().requireEnabled()) {
             return null;
         }
 
index 4400a0679fc2bbd20b5315b541137a5706b5cd9a..a43686f5d7f336b52b098f48a2ac26db0d724033 100644 (file)
@@ -24,6 +24,11 @@ module odl-pcep-topology-provider {
     augment "/nt:network-topology/nt:topology/nt:topology-types/pn:topology-pcep" {
         container capabilities {
             container stateful {
+                leaf enabled {
+                    type boolean;
+                    default true;
+                }
+
                 uses opisc:stateful-capabilities;
             }
             leaf p2mp {