apply checkstyle check during build for neutron-ovsdb
[groupbasedpolicy.git] / neutron-ovsdb / src / main / java / org / opendaylight / groupbasedpolicy / neutron / ovsdb / util / NeutronHelper.java
index 2b83098651f28fe1261ccd47a95ad9da337794f2..6c7de96f041966db8b8323f6c0a53c60895f23f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,13 +8,14 @@
 
 package org.opendaylight.groupbasedpolicy.neutron.ovsdb.util;
 
-import static org.opendaylight.groupbasedpolicy.neutron.ovsdb.util.DataStore.readFromDs;
+import static org.opendaylight.groupbasedpolicy.util.DataStoreHelper.readFromDs;
+
+import com.google.common.base.Optional;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.UniqueId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.Uuid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.Mappings;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.GbpByNeutronMappings;
@@ -23,27 +24,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gb
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.ports.EndpointByPortKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-import com.google.common.base.Optional;
-
 public class NeutronHelper {
 
     /**
      * This looks up the Endpoint L2 key from an
-     * operational data store kept in neutron-mapper
+     * operational data store kept in neutron-mapper.
      *
      * @param externalId The neutron port UUID
      * @param dataBroker {@link DataBroker} to use for the transaction
      * @return {@link EndpointKey} of the matching Endpoint, null if not found
      */
-    public static EndpointKey getEpKeyFromNeutronMapper(Uuid externalId, DataBroker dataBroker) {
+    public static EndpointKey getEpKeyFromNeutronMapper(UniqueId externalId, DataBroker dataBroker) {
 
         ReadWriteTransaction transaction = dataBroker.newReadWriteTransaction();
-        InstanceIdentifier<EndpointByPort> iid = InstanceIdentifier
-                .create(Mappings.class)
-                .child(GbpByNeutronMappings.class)
-                .child(EndpointsByPorts.class)
-                .child(EndpointByPort.class, new EndpointByPortKey(new UniqueId(externalId)));
-        Optional<EndpointByPort> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, iid, transaction );
+        InstanceIdentifier<EndpointByPort> iid = InstanceIdentifier.create(Mappings.class)
+            .child(GbpByNeutronMappings.class)
+            .child(EndpointsByPorts.class)
+            .child(EndpointByPort.class, new EndpointByPortKey(externalId));
+        Optional<EndpointByPort> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, iid, transaction);
         if (optionalEp.isPresent()) {
             EndpointByPort epByPort = optionalEp.get();
             return new EndpointKey(epByPort.getL2Context(), epByPort.getMacAddress());
@@ -51,5 +49,4 @@ public class NeutronHelper {
         return null;
     }
 
-
 }