Bug 5054: Fix for switch restart
[vpnservice.git] / vpnmanager / vpnmanager-impl / src / main / java / org / opendaylight / vpnservice / VpnUtil.java
index 10d69f961627900d630cd67991a9532e2e4c2914..cbd29917a46ed52e834626f5f12beef070773bd7 100644 (file)
@@ -83,10 +83,11 @@ public class VpnUtil {
                 .child(VpnInstance.class, new VpnInstanceKey(vpnName)).build();
     }
 
-    static VpnInterface getVpnInterface(String intfName, String vpnName, Adjacencies aug) {
-        return new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(intfName)).setVpnInstanceName(
-            vpnName)
-                .addAugmentation(Adjacencies.class, aug).build();
+    static VpnInterface getVpnInterface(String intfName, String vpnName, Adjacencies aug, boolean opState) {
+        return new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(intfName)).setVpnInstanceName(vpnName)
+                .addAugmentation(Adjacencies.class, aug)
+                .addAugmentation(OpState.class, new OpStateBuilder().setStateUp(opState).build())
+                .build();
     }
 
     static InstanceIdentifier<Prefixes> getPrefixToInterfaceIdentifier(long vpnId, String ipPrefix) {