Add INFO.yaml for GBP
[groupbasedpolicy.git] / neutron-ovsdb / src / main / java / org / opendaylight / groupbasedpolicy / neutron / ovsdb / util / EndpointHelper.java
index f4a5865278620887553684d097d7b5fb18a4c503..abf16694df6532b5cc655d44cc3c59773e6f8983 100755 (executable)
@@ -10,6 +10,7 @@ package org.opendaylight.groupbasedpolicy.neutron.ovsdb.util;
 import static org.opendaylight.groupbasedpolicy.util.DataStoreHelper.readFromDs;
 import static org.opendaylight.groupbasedpolicy.util.IidFactory.endpointIid;
 
+import com.google.common.base.Optional;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -23,10 +24,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 
-import com.google.common.base.Optional;
-
 
-public class EndpointHelper {
+public final class EndpointHelper {
+    private EndpointHelper() {
+    }
 
     /**
      * Look up the {@link Endpoint} from the Endpoint Registry.
@@ -37,7 +38,9 @@ public class EndpointHelper {
      */
     public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) {
 
-        Optional<Endpoint> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(),epKey.getMacAddress()), transaction );
+        Optional<Endpoint> optionalEp =
+            readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()),
+                transaction);
         if (optionalEp.isPresent()) {
             return optionalEp.get();
         }
@@ -46,7 +49,6 @@ public class EndpointHelper {
 
     /**
      * Updates an {@link Endpoint} location based on OVSDB Termination point notification.
-     *
      * Note this updates the datastore directly. It does not use the Endpoint RPC, as this has
      * unfortunate side-effects on EndpointL3 augmentations.
      *
@@ -70,7 +72,8 @@ public class EndpointHelper {
         EndpointBuilder epBuilder = new EndpointBuilder(endpoint);
         Endpoint newEp = epBuilder.build();
         epBuilder.removeAugmentation(OfOverlayContext.class);
-        rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.endpointIid(newEp.getL2Context(), newEp.getMacAddress()), newEp);
+        rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.endpointIid(newEp.getL2Context(), newEp.getMacAddress()),
+            newEp);
         DataStoreHelper.submitToDs(rwTx);
     }