import org.codehaus.enunciate.jaxrs.ResponseCode;\r
import org.codehaus.enunciate.jaxrs.StatusCodes;\r
import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;\r
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortAware;\r
import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;\r
import org.opendaylight.controller.networkconfig.neutron.INeutronRouterAware;\r
import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD;\r
import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;\r
import org.opendaylight.controller.networkconfig.neutron.NeutronRouter_Interface;\r
import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;\r
-import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;\r
import org.opendaylight.controller.northbound.commons.RestMessages;\r
import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;\r
import org.opendaylight.controller.sal.utils.ServiceHelper;\r
targetPort.getDeviceOwner() != null)\r
return Response.status(409).build();\r
\r
+ Object[] instances = ServiceHelper.getGlobalInstances(INeutronRouterAware.class, this, null);\r
+ if (instances != null) {\r
+ for (Object instance : instances) {\r
+ INeutronRouterAware service = (INeutronRouterAware) instance;\r
+ service.canAttachInterface(target, input);\r
+ }\r
+ }\r
+\r
//mark the port device id and device owner fields\r
targetPort.setDeviceOwner("network:router_interface");\r
targetPort.setDeviceID(routerUUID);\r
\r
target.addInterface(input.getPortUUID(), input);\r
- Object[] instances = ServiceHelper.getGlobalInstances(INeutronRouterAware.class, this, null);\r
if (instances != null) {\r
for (Object instance : instances) {\r
INeutronRouterAware service = (INeutronRouterAware) instance;\r
input.setID(target.getID());\r
input.setTenantID(target.getTenantID());\r
\r
+ Object[] instances = ServiceHelper.getGlobalInstances(INeutronRouterAware.class, this, null);\r
+ if (instances != null) {\r
+ for (Object instance : instances) {\r
+ INeutronRouterAware service = (INeutronRouterAware) instance;\r
+ service.canDetachInterface(target, input);\r
+ }\r
+ }\r
+\r
// reset the port ownership\r
port.setDeviceID(null);\r
port.setDeviceOwner(null);\r
\r
target.removeInterface(input.getPortUUID());\r
- Object[] instances = ServiceHelper.getGlobalInstances(INeutronRouterAware.class, this, null);\r
if (instances != null) {\r
for (Object instance : instances) {\r
INeutronRouterAware service = (INeutronRouterAware) instance;\r
return Response.status(409).build();\r
input.setID(target.getID());\r
input.setTenantID(target.getTenantID());\r
+ Object[] instances = ServiceHelper.getGlobalInstances(INeutronRouterAware.class, this, null);\r
+ if (instances != null) {\r
+ for (Object instance : instances) {\r
+ INeutronRouterAware service = (INeutronRouterAware) instance;\r
+ service.canDetachInterface(target, input);\r
+ }\r
+ }\r
port.setDeviceID(null);\r
port.setDeviceOwner(null);\r
target.removeInterface(input.getPortUUID());\r
- Object[] instances = ServiceHelper.getGlobalInstances(INeutronRouterAware.class, this, null);\r
for (Object instance : instances) {\r
INeutronRouterAware service = (INeutronRouterAware) instance;\r
service.neutronRouterInterfaceDetached(target, input);\r