Use ActionableResourceImpl for setter access 11/85411/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 28 Oct 2019 13:42:24 +0000 (14:42 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 28 Oct 2019 13:43:44 +0000 (14:43 +0100)
We really do not allow ActionableResource to be modifiable once
built. This uses ActionableResourceImpl instead of the bare interface.

JIRA: GENIUS-281
Change-Id: I35a475b0b3936b303e5e9542216b3d7e2a793ab3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpUtil.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/BgpRouteVrfEntryHandler.java

index f373f107c73365c3e26d8ef0ea78c3fcdf2bb05b..cfa929003dbb29e225357a1a9d01c29827095482 100755 (executable)
@@ -8,7 +8,6 @@
 package org.opendaylight.netvirt.bgpmanager;
 
 import com.google.common.base.Optional;
-
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
@@ -140,7 +139,7 @@ public class BgpUtil implements AutoCloseable {
     }
 
     public <T extends DataObject> void update(final InstanceIdentifier<T> path, final T data) {
-        ActionableResource actResource = new ActionableResourceImpl(path.toString());
+        ActionableResourceImpl actResource = new ActionableResourceImpl(path.toString());
         actResource.setAction(ActionableResource.UPDATE);
         actResource.setInstanceIdentifier(path);
         actResource.setInstance(data);
@@ -148,7 +147,7 @@ public class BgpUtil implements AutoCloseable {
     }
 
     public <T extends DataObject> void write(final InstanceIdentifier<T> path, final T data) {
-        ActionableResource actResource = new ActionableResourceImpl(path.toString());
+        ActionableResourceImpl actResource = new ActionableResourceImpl(path.toString());
         actResource.setAction(ActionableResource.CREATE);
         actResource.setInstanceIdentifier(path);
         actResource.setInstance(data);
@@ -156,7 +155,7 @@ public class BgpUtil implements AutoCloseable {
     }
 
     public <T extends DataObject> void delete(final InstanceIdentifier<T> path) {
-        ActionableResource actResource = new ActionableResourceImpl(path.toString());
+        ActionableResourceImpl actResource = new ActionableResourceImpl(path.toString());
         actResource.setAction(ActionableResource.DELETE);
         actResource.setInstanceIdentifier(path);
         actResource.setInstance(null);
index 0199e05be38aca2ce7cb7a0d759a7eeb8782fdf8..5a45eb526b4bc7d7a703df131063cd66350d6eb4 100644 (file)
@@ -147,7 +147,7 @@ public class BgpRouteVrfEntryHandler extends BaseVrfEntryHandler implements Reso
     }
 
     void createFlows(InstanceIdentifier<VrfEntry> identifier, VrfEntry vrfEntry, String rd) {
-        ActionableResource actResource = new ActionableResourceImpl(rd + vrfEntry.getDestPrefix());
+        ActionableResourceImpl actResource = new ActionableResourceImpl(rd + vrfEntry.getDestPrefix());
         actResource.setAction(ActionableResource.CREATE);
         actResource.setInstanceIdentifier(identifier);
         actResource.setInstance(vrfEntry);
@@ -155,7 +155,7 @@ public class BgpRouteVrfEntryHandler extends BaseVrfEntryHandler implements Reso
     }
 
     void removeFlows(InstanceIdentifier<VrfEntry> identifier, VrfEntry vrfEntry, String rd) {
-        ActionableResource actResource = new ActionableResourceImpl(rd + vrfEntry.getDestPrefix());
+        ActionableResourceImpl actResource = new ActionableResourceImpl(rd + vrfEntry.getDestPrefix());
         actResource.setAction(ActionableResource.DELETE);
         actResource.setInstanceIdentifier(identifier);
         actResource.setInstance(vrfEntry);
@@ -163,7 +163,7 @@ public class BgpRouteVrfEntryHandler extends BaseVrfEntryHandler implements Reso
     }
 
     void updateFlows(InstanceIdentifier<VrfEntry> identifier, VrfEntry original, VrfEntry update, String rd) {
-        ActionableResource actResource = new ActionableResourceImpl(rd + update.getDestPrefix());
+        ActionableResourceImpl actResource = new ActionableResourceImpl(rd + update.getDestPrefix());
         actResource.setAction(ActionableResource.UPDATE);
         actResource.setInstanceIdentifier(identifier);
         actResource.setInstance(update);