Pay down technical debt: close remaining minor items 80/23280/2
authorRyan Moats <rmoats@us.ibm.com>
Thu, 25 Jun 2015 16:25:49 +0000 (11:25 -0500)
committerRyan Moats <rmoats@us.ibm.com>
Mon, 29 Jun 2015 14:27:03 +0000 (09:27 -0500)
Change-Id: I754748b54819dcecf98fe7df1ef7cb12c7a980bd
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
16 files changed:
dummyprovider/src/main/java/org/opendaylight/neutron/dummyprovider/Activator.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork_Segment.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerHealthMonitorNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRulesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/UnimplementedException.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSecurityGroupInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSubnetInterface.java

index 31b7c751c56236023d657b5dc3f280c770e259e7..2becb07ba9f3b8387d7b255b3ad54c79ea2bf776 100644 (file)
@@ -8,9 +8,6 @@
 
 package org.opendaylight.neutron.dummyprovider;
 
-import java.util.Hashtable;
-import java.util.Dictionary;
-
 import org.apache.felix.dm.DependencyActivatorBase;
 import org.apache.felix.dm.DependencyManager;
 
@@ -43,8 +40,6 @@ import org.slf4j.LoggerFactory;
 
 public class Activator extends DependencyActivatorBase {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class);
-
     @Override
     public void init(BundleContext context, DependencyManager manager) throws Exception {
        manager.add(createComponent().setInterface(new String[] {
index f0c025a50a96b0d76051bc7bda4b4645341d8a2b..d2f4ad2c88f31929ed202f9a2c04f4b9c0df91ab 100644 (file)
@@ -9,9 +9,6 @@
 package org.opendaylight.neutron.spi;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
index d825d1662e2b94e82883b7dd498e4b2526168a78..d59caed094043b2b6b9976fb4a06146ce296c509 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.neutron.spi;
 
 import java.io.Serializable;
-import java.lang.Exception;
 import java.math.BigInteger;
 import java.net.InetAddress;
 import java.net.Inet6Address;
index eeb33bde569c8c76dcafe20f7073d84d3a8f96af..d421fa69c041be631d068c93f3f66fc950d2b934 100644 (file)
@@ -32,7 +32,6 @@ import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerHealthMonitorAware;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerHealthMonitorCRUD;
 import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
-import org.opendaylight.neutron.spi.NeutronLoadBalancer;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerHealthMonitor;
 
 /**
index de3f59655634fa3bb9010ac9de49d3a62701f294..fe6928b58e43aefbe03989b7583c072b4c0ed089 100644 (file)
@@ -11,13 +11,11 @@ package org.opendaylight.neutron.northbound.api;
 import java.net.HttpURLConnection;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
index 99d95bb10cdf8673e92a728376a229b995d21561..216fa52fa8d19d496666f045cdabff89f85479b7 100644 (file)
@@ -11,13 +11,11 @@ package org.opendaylight.neutron.northbound.api;
 import java.net.HttpURLConnection;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
index db8509663b94f0569150e3b1b84adbe1d5e90aa5..8ae85f033ab434c786dfafb5896a179bf477bc4c 100644 (file)
@@ -24,6 +24,8 @@ import java.util.Set;
  *
  */
 public class NeutronNorthboundRSApplication extends Application {
+    private static final int HASHMAP_SIZE = 3;
+
     @Override
     public Set<Class<?>> getClasses() {
         Set<Class<?>> classes = new HashSet<Class<?>>();
@@ -64,7 +66,7 @@ public class NeutronNorthboundRSApplication extends Application {
         moxyJsonProvider.setMarshalEmptyCollections(true);
         moxyJsonProvider.setValueWrapper("$");
 
-        Map<String, String> namespacePrefixMapper = new HashMap<String, String>(3);
+        Map<String, String> namespacePrefixMapper = new HashMap<String, String>(HASHMAP_SIZE);
         namespacePrefixMapper.put("router", "router");        // FIXME: fill in with XSD
         namespacePrefixMapper.put("provider", "provider");    // FIXME: fill in with XSD
         namespacePrefixMapper.put("binding", "binding");
index d1cb1af4b85c7451b05334d2daa577f307ca047d..2d0d71c4ef81e98f5841963fa7d91fd270446afb 100644 (file)
@@ -62,10 +62,8 @@ import org.opendaylight.neutron.spi.Neutron_IPs;
 @Path("/ports")
 public class NeutronPortsNorthbound {
 
-    final String mac_regex="^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$";
-
-    static private final int HTTP_OK_BOTTOM = 200;
-    static private final int HTTP_OK_TOP = 299;
+    private static final int HTTP_OK_BOTTOM = 200;
+    private static final int HTTP_OK_TOP = 299;
     private static final String INTERFACE_NAME = "Port CRUD Interface";
     private static final String UUID_NO_EXIST = "Port UUID does not exist.";
     private static final String UUID_EXISTS = "Port UUID already exists.";
@@ -73,6 +71,8 @@ public class NeutronPortsNorthbound {
     private static final String NO_PROVIDER_LIST = "Couldn't get providers list.  Please try again later";
     private static final String NET_UUID_MATCH = "Network UUID must match that of subnet";
 
+    final String mac_regex="^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$";
+
     private NeutronPort extractFields(NeutronPort o, List<String> fields) {
         return o.extractFields(fields);
     }
index a6352292a66f265bfe5092f49b385f777acc5c8b..ba1a08d06955a939aebe4c3e190853365d94d2bb 100644 (file)
@@ -11,13 +11,11 @@ package org.opendaylight.neutron.northbound.api;
 import java.net.HttpURLConnection;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
index 6d2a12c18f3f3fc82d13aceb5d992d852bb7cf12..08c564fd84312bd72d94097a0e60ab81e6e36366 100644 (file)
@@ -11,13 +11,11 @@ package org.opendaylight.neutron.northbound.api;
 import java.net.HttpURLConnection;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
index 26a957872dc35b1c16be192b1a9d15eac838265c..070775eed0e2ab30ca18123601487abcdcde027f 100644 (file)
@@ -11,13 +11,11 @@ package org.opendaylight.neutron.northbound.api;
 import java.net.HttpURLConnection;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
index f2a5ae7d6fc05aa9e2c1b1b449a7877adf418606..35aac7f280913e7c7d6b49bcc5a6fc07634073b1 100644 (file)
@@ -17,7 +17,6 @@ import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
index 0d14d0e141d2cc22bc65f10f08f80ae95de20f0e..7b0a9b5a272cba4011ea84976fcacc5740a81ae2 100644 (file)
@@ -8,32 +8,30 @@
 
 package org.opendaylight.neutron.northbound.api;
 
+import java.net.HttpURLConnection;
+
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.MediaType;
 
 /**
- * Status Code 503 (Service Unavailable Error)
- *
- * The server is currently unable to handle the request due to a temporary
- * overloading or maintenance of the server.
- * The implication is that this is a temporary condition which will be alleviated
- * after some delay.
+ * Status Code 501 (Not Implemented Error)
  *
+ * The function is not implemented.
  *
  */
 public class UnimplementedException extends WebApplicationException {
     private static final long serialVersionUID = 1L;
 
     /**
-     * Constructor for the SERVICE_UNAVAILABLE custom handler
+     * Constructor for the NOT_IMPLEMENTED custom handler
      *
      * @param string Error message to specify further the
      * SERVICE_UNAVAILABLE response
      *
      */
     public UnimplementedException(String string) {
-        super(Response.status(501).entity(
+        super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(
                 string).type(MediaType.TEXT_PLAIN).build());
     }
 }
index 111cfd5398214393ceef492ce2e3da248740dd05..df468bb82826afc25dd316fc0f6ff6d1c54d5567 100644 (file)
@@ -14,7 +14,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Preconditions;
-import com.google.common.base.Predicates;
 import com.google.common.util.concurrent.CheckedFuture;
 
 public abstract class AbstractNeutronInterface<T extends DataObject,S> implements AutoCloseable {
@@ -26,12 +25,9 @@ public abstract class AbstractNeutronInterface<T extends DataObject,S> implement
     private static final int DEDASHED_UUID_DIV3 = 16;
     private static final int DEDASHED_UUID_DIV4 = 20;
 
-
-    private ProviderContext providerContext;
     private DataBroker db;
 
     AbstractNeutronInterface(ProviderContext providerContext) {
-        this.providerContext = providerContext;
         this.db = providerContext.getSALService(DataBroker.class);
     }
 
index 05619a229242248f8bdacd0031cb2529faaf7517..9ef6f3a6fa4a25caf0a39db3cb76af8003d07373 100644 (file)
@@ -29,7 +29,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150325.Neutron;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev141002.security.groups.attributes.SecurityGroups;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev141002.security.groups.attributes.security.groups.SecurityGroup;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev141002.security.groups.attributes.security.groups.SecurityGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev141002.security.groups.attributes.security.groups.SecurityGroupKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 7d974d323c83e9a08316a948e3f044c7e4a1fea4..85bfe7e7b649a628bd0c618d24361ce63fff9b54 100644 (file)
@@ -23,24 +23,15 @@ import org.opendaylight.neutron.spi.INeutronSubnetCRUD;
 import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronNetwork;
 import org.opendaylight.neutron.spi.NeutronSubnet;
-import org.opendaylight.neutron.spi.NeutronSubnet_HostRoute;
 import org.opendaylight.neutron.spi.NeutronSubnet_IPAllocationPool;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefixBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpVersion;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150325.Neutron;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.SubnetAttrs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnet.attrs.AllocationPools;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnet.attrs.AllocationPoolsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnet.attrs.HostRoutes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnet.attrs.HostRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnets.attributes.Subnets;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnets.attributes.subnets.Subnet;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev141002.subnets.attributes.subnets.SubnetBuilder;
-import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;