clean-up to remove un-used three WebApplicationException subclasses 16/73416/1
authorMichael Vorburger <vorburger@redhat.com>
Mon, 25 Jun 2018 16:40:38 +0000 (18:40 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Mon, 25 Jun 2018 16:40:58 +0000 (18:40 +0200)
and minor JavaDoc clean up in the two remaining ones

The removed null check in NeutronRoutersNorthbound is (now) pointless.

Change-Id: If3bfac610b1dc9563651ac8bba3513e58637265f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/BadRequestException.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/InternalServerErrorException.java [deleted file]
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRoutersNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ResourceConflictException.java [deleted file]
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ResourceNotFoundException.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ServiceUnavailableException.java [deleted file]
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/UnimplementedException.java [deleted file]

index 7e1e036683b9aba55a0405ed30ebae9bdb236f0c..b4d302d25a70cf97f0eea6b00c9412155757d86c 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.neutron.northbound.api;
 
 import javax.ws.rs.WebApplicationException;
@@ -13,7 +12,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 /**
- * Status Code 400 (Bad Request)
+ * Status Code 400 = Bad Request.
  *
  * <p>
  * The request could not be understood by the server due to malformed syntax.
diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/InternalServerErrorException.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/InternalServerErrorException.java
deleted file mode 100644 (file)
index 3ca7b9a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2013 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,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 500 (Internal Server Error)
- *
- * <p>
- * The server encountered an unexpected condition which prevented
- * it from fulfilling the request.
- *
- *
- *
- */
-public class InternalServerErrorException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Constructor for the INTERNAL_SERVER_ERROR custom handler.
-     *
-     * @param string Error message to specify further the
-     *            INTERNAL_SERVER_ERROR response
-     *
-     */
-    public InternalServerErrorException(String string) {
-        super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
index 66b68253c378a92b6d07eb92289c0bf7170d5ff4..38510aa53530f38bb582ddf7e4311004c82cb7fd 100644 (file)
@@ -77,9 +77,6 @@ public final class NeutronRoutersNorthbound
     // sorting not supported
     ) {
         INeutronRouterCRUD routerInterface = getNeutronCRUD();
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
         List<NeutronRouter> allRouters = routerInterface.getAll();
         List<NeutronRouter> ans = new ArrayList<>();
         for (NeutronRouter router : allRouters) {
diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ResourceConflictException.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ResourceConflictException.java
deleted file mode 100644 (file)
index b2af963..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2013 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,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 409 (Conflict)
- *
- * <p>
- * The request could not be completed due to a conflict with the
- * current state of the resource. This code is only allowed in
- * situations where it is expected that the user might be able to
- * resolve the conflict and resubmit the request. The response body
- * SHOULD include enough information for the user to recognize the
- * source of the conflict. Ideally, the response entity would include
- * enough information for the user or user agent to fix the problem;
- * however, that might not be possible and is not required.
- *
- *
- *
- */
-public class ResourceConflictException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    public ResourceConflictException(String string) {
-        super(Response.status(Response.Status.CONFLICT).entity(string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
index 5a075451277cfb50ca3be0b0a5ab95470284d98e..770b4be62798403ceadb7f4079725029dc49a67a 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.neutron.northbound.api;
 
 import javax.ws.rs.WebApplicationException;
@@ -13,7 +12,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 /**
- * Status Code 404 (Not Found)
+ * Status Code 404 = Not Found.
  *
  * <p>
  * The server has not found anything matching the Request-URI.
@@ -24,9 +23,6 @@ import javax.ws.rs.core.Response;
  * This status code is commonly used when the server does not wish to
  * reveal exactly why the request has been refused, or when no other
  * response is applicable.
- *
- *
- *
  */
 public class ResourceNotFoundException extends WebApplicationException {
     private static final long serialVersionUID = 1L;
diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ServiceUnavailableException.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ServiceUnavailableException.java
deleted file mode 100644 (file)
index abddc94..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2013 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,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 503 (Service Unavailable Error)
- *
- * <p>
- * 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.
- *
- *
- */
-public class ServiceUnavailableException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Constructor for the SERVICE_UNAVAILABLE custom handler.
-     *
-     * @param string Error message to specify further the
-     *            SERVICE_UNAVAILABLE response
-     *
-     */
-    public ServiceUnavailableException(String string) {
-        super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/UnimplementedException.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/UnimplementedException.java
deleted file mode 100644 (file)
index 9a75559..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2013 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,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import java.net.HttpURLConnection;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 501 (Not Implemented Error)
- *
- * <p>
- * The function is not implemented.
- *
- */
-public class UnimplementedException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 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(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(string).type(MediaType.TEXT_PLAIN)
-                .build());
-    }
-}