From 5961c8a1321aef9945a69677081f02a6b08edc18 Mon Sep 17 00:00:00 2001 From: Ryan Moats Date: Mon, 28 Oct 2013 08:25:24 -0500 Subject: [PATCH] Remove superfulous class from neutron NB bundle. Remove superfulous NeutronNBInterfaces class from neutron NB bundle and refactor other classes to use NeutronCRUDInterfaces methods Change-Id: I7ecccb220250f0038476aea138cf58801ecb3b24 Signed-off-by: Ryan Moats --- .../NeutronFloatingIPsNorthbound.java | 23 ++- .../northbound/NeutronNBInterfaces.java | 193 ------------------ .../northbound/NeutronNetworksNorthbound.java | 11 +- .../northbound/NeutronPortsNorthbound.java | 17 +- .../northbound/NeutronRoutersNorthbound.java | 27 +-- .../northbound/NeutronSubnetsNorthbound.java | 13 +- 6 files changed, 48 insertions(+), 236 deletions(-) delete mode 100644 opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNBInterfaces.java diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java index 6f3ed13c36..2b0ad45629 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java @@ -30,6 +30,7 @@ import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD; +import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP; import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork; import org.opendaylight.controller.networkconfig.neutron.NeutronPort; @@ -89,7 +90,7 @@ public class NeutronFloatingIPsNorthbound { @QueryParam("page_reverse") String pageReverse // sorting not supported ) { - INeutronFloatingIPCRUD floatingIPInterface = NeutronNBInterfaces.getIfNBFloatingIPCRUD("default",this); + INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this); if (floatingIPInterface == null) { throw new ServiceUnavailableException("Floating IP CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -132,7 +133,7 @@ public class NeutronFloatingIPsNorthbound { @PathParam("floatingipUUID") String floatingipUUID, // return fields @QueryParam("fields") List fields ) { - INeutronFloatingIPCRUD floatingIPInterface = NeutronNBInterfaces.getIfNBFloatingIPCRUD("default",this); + INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this); if (floatingIPInterface == null) { throw new ServiceUnavailableException("Floating IP CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -162,22 +163,22 @@ public class NeutronFloatingIPsNorthbound { @ResponseCode(code = 409, condition = "Conflict"), @ResponseCode(code = 501, condition = "Not Implemented") }) public Response createFloatingIPs(final NeutronFloatingIPRequest input) { - INeutronFloatingIPCRUD floatingIPInterface = NeutronNBInterfaces.getIfNBFloatingIPCRUD("default",this); + INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this); if (floatingIPInterface == null) { throw new ServiceUnavailableException("Floating IP CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default", this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD( this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -281,22 +282,22 @@ public class NeutronFloatingIPsNorthbound { @PathParam("floatingipUUID") String floatingipUUID, NeutronFloatingIPRequest input ) { - INeutronFloatingIPCRUD floatingIPInterface = NeutronNBInterfaces.getIfNBFloatingIPCRUD("default",this); + INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this); if (floatingIPInterface == null) { throw new ServiceUnavailableException("Floating IP CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default", this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD( this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -396,7 +397,7 @@ public class NeutronFloatingIPsNorthbound { @ResponseCode(code = 501, condition = "Not Implemented") }) public Response deleteFloatingIP( @PathParam("floatingipUUID") String floatingipUUID) { - INeutronFloatingIPCRUD floatingIPInterface = NeutronNBInterfaces.getIfNBFloatingIPCRUD("default",this); + INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this); if (floatingIPInterface == null) { throw new ServiceUnavailableException("Floating IP CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNBInterfaces.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNBInterfaces.java deleted file mode 100644 index 730fe2c3b7..0000000000 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNBInterfaces.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright IBM Corporation, 2013. 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.controller.networkconfig.neutron.northbound; - -import java.util.List; - -import org.opendaylight.controller.containermanager.IContainerManager; -import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPCRUD; -import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD; -import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD; -import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD; -import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD; -import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; -import org.opendaylight.controller.northbound.commons.RestMessages; -import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException; -import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException; -import org.opendaylight.controller.sal.utils.ServiceHelper; - -public class NeutronNBInterfaces { - - // return a class that implements the IfNBNetworkCRUD interface - static INeutronNetworkCRUD getIfNBNetworkCRUD(String containerName, Object o) { - /* IContainerManager containerManager = (IContainerManager) ServiceHelper - .getGlobalInstance(IContainerManager.class, o); - if (containerManager == null) { - throw new ServiceUnavailableException("Container " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - boolean found = false; - List containerNames = containerManager.getContainerNames(); - for (String cName : containerNames) { - if (cName.trim().equalsIgnoreCase(containerName.trim())) { - found = true; - } - } - - if (found == false) { - throw new ResourceNotFoundException(containerName + " " - + RestMessages.NOCONTAINER.toString()); - } - - IfNBNetworkCRUD answer = (IfNBNetworkCRUD) ServiceHelper.getInstance( - IfNBNetworkCRUD.class, containerName, o); */ - - INeutronNetworkCRUD answer = NeutronCRUDInterfaces.getINeutronNetworkCRUD(o); - - if (answer == null) { - throw new ServiceUnavailableException("Network CRUD Service " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - return answer; - } - - // return a class that implements the IfNBSubnetCRUD interface - static INeutronSubnetCRUD getIfNBSubnetCRUD(String containerName, Object o) { - IContainerManager containerManager = (IContainerManager) ServiceHelper - .getGlobalInstance(IContainerManager.class, o); - if (containerManager == null) { - throw new ServiceUnavailableException("Container " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - boolean found = false; - List containerNames = containerManager.getContainerNames(); - for (String cName : containerNames) { - if (cName.trim().equalsIgnoreCase(containerName.trim())) { - found = true; - } - } - - if (found == false) { - throw new ResourceNotFoundException(containerName + " " - + RestMessages.NOCONTAINER.toString()); - } - - INeutronSubnetCRUD answer = (INeutronSubnetCRUD) ServiceHelper.getInstance( - INeutronSubnetCRUD.class, containerName, o); - - if (answer == null) { - throw new ServiceUnavailableException("Network CRUD Service " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - return answer; - } - - // return a class that implements the IfNBPortCRUD interface - static INeutronPortCRUD getIfNBPortCRUD(String containerName, Object o) { - IContainerManager containerManager = (IContainerManager) ServiceHelper - .getGlobalInstance(IContainerManager.class, o); - if (containerManager == null) { - throw new ServiceUnavailableException("Container " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - boolean found = false; - List containerNames = containerManager.getContainerNames(); - for (String cName : containerNames) { - if (cName.trim().equalsIgnoreCase(containerName.trim())) { - found = true; - } - } - - if (found == false) { - throw new ResourceNotFoundException(containerName + " " - + RestMessages.NOCONTAINER.toString()); - } - - INeutronPortCRUD answer = (INeutronPortCRUD) ServiceHelper.getInstance( - INeutronPortCRUD.class, containerName, o); - - if (answer == null) { - throw new ServiceUnavailableException("Network CRUD Service " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - return answer; - } - - // return a class that implements the IfNBRouterCRUD interface - static INeutronRouterCRUD getIfNBRouterCRUD(String containerName, Object o) { - IContainerManager containerManager = (IContainerManager) ServiceHelper - .getGlobalInstance(IContainerManager.class, o); - if (containerManager == null) { - throw new ServiceUnavailableException("Container " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - boolean found = false; - List containerNames = containerManager.getContainerNames(); - for (String cName : containerNames) { - if (cName.trim().equalsIgnoreCase(containerName.trim())) { - found = true; - } - } - - if (found == false) { - throw new ResourceNotFoundException(containerName + " " - + RestMessages.NOCONTAINER.toString()); - } - - INeutronRouterCRUD answer = (INeutronRouterCRUD) ServiceHelper.getInstance( - INeutronRouterCRUD.class, containerName, o); - - if (answer == null) { - throw new ServiceUnavailableException("Network CRUD Service " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - return answer; - } - - // return a class that implements the IfNBFloatingIPCRUD interface - static INeutronFloatingIPCRUD getIfNBFloatingIPCRUD(String containerName, Object o) { - IContainerManager containerManager = (IContainerManager) ServiceHelper - .getGlobalInstance(IContainerManager.class, o); - if (containerManager == null) { - throw new ServiceUnavailableException("Container " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - boolean found = false; - List containerNames = containerManager.getContainerNames(); - for (String cName : containerNames) { - if (cName.trim().equalsIgnoreCase(containerName.trim())) { - found = true; - } - } - - if (found == false) { - throw new ResourceNotFoundException(containerName + " " - + RestMessages.NOCONTAINER.toString()); - } - - INeutronFloatingIPCRUD answer = (INeutronFloatingIPCRUD) ServiceHelper.getInstance( - INeutronFloatingIPCRUD.class, containerName, o); - - if (answer == null) { - throw new ServiceUnavailableException("Network CRUD Service " - + RestMessages.SERVICEUNAVAILABLE.toString()); - } - - return answer; - } -} diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java index b77536b8db..383009b9d5 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java @@ -29,6 +29,7 @@ import org.codehaus.enunciate.jaxrs.StatusCodes; import org.codehaus.enunciate.jaxrs.TypeHint; import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkAware; import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD; +import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork; import org.opendaylight.controller.northbound.commons.RestMessages; import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException; @@ -88,7 +89,7 @@ public class NeutronNetworksNorthbound { @QueryParam("page_reverse") String pageReverse // sorting not supported ) { - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -142,7 +143,7 @@ public class NeutronNetworksNorthbound { // return fields @QueryParam("fields") List fields ) { - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -169,7 +170,7 @@ public class NeutronNetworksNorthbound { @ResponseCode(code = 400, condition = "Bad Request"), @ResponseCode(code = 401, condition = "Unauthorized") }) public Response createNetworks(final NeutronNetworkRequest input) { - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -261,7 +262,7 @@ public class NeutronNetworksNorthbound { public Response updateNetwork( @PathParam("netUUID") String netUUID, final NeutronNetworkRequest input ) { - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -319,7 +320,7 @@ public class NeutronNetworksNorthbound { @ResponseCode(code = 409, condition = "Network In Use") }) public Response deleteNetwork( @PathParam("netUUID") String netUUID) { - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java index 78646a6383..f48a70d9d7 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java @@ -31,6 +31,7 @@ import org.opendaylight.controller.networkconfig.neutron.INeutronPortAware; import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetAware; import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD; +import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; import org.opendaylight.controller.networkconfig.neutron.NeutronPort; import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs; @@ -92,7 +93,7 @@ public class NeutronPortsNorthbound { @QueryParam("page_reverse") String pageReverse // sorting not supported ) { - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -138,7 +139,7 @@ public class NeutronPortsNorthbound { @PathParam("portUUID") String portUUID, // return fields @QueryParam("fields") List fields ) { - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -171,17 +172,17 @@ public class NeutronPortsNorthbound { @ResponseCode(code = 501, condition = "Not Implemented"), @ResponseCode(code = 503, condition = "MAC generation failure") }) public Response createPorts(final NeutronPortRequest input) { - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -356,12 +357,12 @@ public class NeutronPortsNorthbound { @PathParam("portUUID") String portUUID, NeutronPortRequest input ) { - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -441,7 +442,7 @@ public class NeutronPortsNorthbound { @ResponseCode(code = 501, condition = "Not Implemented") }) public Response deletePort( @PathParam("portUUID") String portUUID) { - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java index e83d1fe51b..df2009ed2b 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java @@ -30,6 +30,7 @@ import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronRouterAware; import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD; +import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork; import org.opendaylight.controller.networkconfig.neutron.NeutronPort; import org.opendaylight.controller.networkconfig.neutron.NeutronRouter; @@ -91,7 +92,7 @@ public class NeutronRoutersNorthbound { @QueryParam("page_reverse") String pageReverse // sorting not supported ) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -135,7 +136,7 @@ public class NeutronRoutersNorthbound { @PathParam("routerUUID") String routerUUID, // return fields @QueryParam("fields") List fields) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -164,12 +165,12 @@ public class NeutronRoutersNorthbound { @ResponseCode(code = 401, condition = "Unauthorized"), @ResponseCode(code = 501, condition = "Not Implemented") }) public Response createRouters(final NeutronRouterRequest input) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -240,12 +241,12 @@ public class NeutronRoutersNorthbound { @PathParam("routerUUID") String routerUUID, NeutronRouterRequest input ) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -319,7 +320,7 @@ public class NeutronRoutersNorthbound { @ResponseCode(code = 501, condition = "Not Implemented") }) public Response deleteRouter( @PathParam("routerUUID") String routerUUID) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -371,17 +372,17 @@ public class NeutronRoutersNorthbound { @PathParam("routerUUID") String routerUUID, NeutronRouter_Interface input ) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default",this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -456,17 +457,17 @@ public class NeutronRoutersNorthbound { @PathParam("routerUUID") String routerUUID, NeutronRouter_Interface input ) { - INeutronRouterCRUD routerInterface = NeutronNBInterfaces.getIfNBRouterCRUD("default",this); + INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this); if (routerInterface == null) { throw new ServiceUnavailableException("Router CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronPortCRUD portInterface = NeutronNBInterfaces.getIfNBPortCRUD("default",this); + INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this); if (portInterface == null) { throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default",this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java index e73afb8a99..d2d7a5a671 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java @@ -30,6 +30,7 @@ import org.codehaus.enunciate.jaxrs.StatusCodes; import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetAware; import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD; +import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; import org.opendaylight.controller.northbound.commons.RestMessages; import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException; @@ -88,7 +89,7 @@ public class NeutronSubnetsNorthbound { @QueryParam("page_reverse") String pageReverse // sorting not supported ) { - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -133,7 +134,7 @@ public class NeutronSubnetsNorthbound { @PathParam("subnetUUID") String subnetUUID, // return fields @QueryParam("fields") List fields) { - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default",this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -165,12 +166,12 @@ public class NeutronSubnetsNorthbound { @ResponseCode(code = 409, condition = "Conflict"), @ResponseCode(code = 501, condition = "Not Implemented") }) public Response createSubnets(final NeutronSubnetRequest input) { - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default",this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } - INeutronNetworkCRUD networkInterface = NeutronNBInterfaces.getIfNBNetworkCRUD("default", this); + INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this); if (networkInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -282,7 +283,7 @@ public class NeutronSubnetsNorthbound { public Response updateSubnet( @PathParam("subnetUUID") String subnetUUID, final NeutronSubnetRequest input ) { - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); @@ -344,7 +345,7 @@ public class NeutronSubnetsNorthbound { @ResponseCode(code = 501, condition = "Not Implemented") }) public Response deleteSubnet( @PathParam("subnetUUID") String subnetUUID) { - INeutronSubnetCRUD subnetInterface = NeutronNBInterfaces.getIfNBSubnetCRUD("default", this); + INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this); if (subnetInterface == null) { throw new ServiceUnavailableException("Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); -- 2.36.6