summaryrefslogtreecommitdiffstats
path: root/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-05-02 10:41:35 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-05-02 11:31:10 +0000
commit9faea02da937dc9468f557a00ed5c9dacec7f2e2 (patch)
tree08d7ee5d4ce09d0d5669cd04eacd7c17f3f6f9c7 /lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
parentd8b2e9bf2db11dec21a8ebd27c038c4ab6bd1473 (diff)
HC2VPP-131 - checking of lisp state before/after according to operation
Change-Id: I190562527c68d022a9b16fc76ad6a011161f4308 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java')
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
index a93f08349..65e409d53 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
@@ -52,7 +52,15 @@ public final class LispStateCheckServiceImpl implements LispStateCheckService, J
.build();
}
- public void checkLispEnabled(@Nonnull final WriteContext ctx) {
+ @Override
+ public void checkLispEnabledBefore(@Nonnull final WriteContext ctx) {
+ // no need to dump here, can be read directly from context
+ checkState(ctx.readBefore(InstanceIdentifier.create(Lisp.class))
+ .or(STATIC_LISP_INSTANCE).isEnable(), "Lisp feature not enabled");
+ }
+
+ @Override
+ public void checkLispEnabledAfter(@Nonnull final WriteContext ctx) {
// no need to dump here, can be read directly from context
checkState(ctx.readAfter(InstanceIdentifier.create(Lisp.class))
.or(STATIC_LISP_INSTANCE).isEnable(), "Lisp feature not enabled");