*/\r
public void neutronRouterDeleted(NeutronRouter router);\r
\r
+ /**\r
+ * Services provide this interface method to indicate if the specified interface can be attached to the specified route\r
+ *\r
+ * @param router\r
+ * instance of the base Neutron Router object\r
+ * @param routerInterface\r
+ * instance of the NeutronRouter_Interface to be attached to the router\r
+ * @return integer\r
+ * the return value is understood to be a HTTP status code. A return value outside of 200 through 299\r
+ * results in the attach operation being interrupted and the returned status value reflected in the\r
+ * HTTP response.\r
+ */\r
+ public int canAttachInterface(NeutronRouter router, NeutronRouter_Interface routerInterface);\r
+\r
/**\r
* Services provide this interface method for taking action after an interface has been added to a router\r
*\r
*/\r
public void neutronRouterInterfaceAttached(NeutronRouter router, NeutronRouter_Interface routerInterface);\r
\r
+ /**\r
+ * Services provide this interface method to indicate if the specified interface can be detached from the specified router\r
+ *\r
+ * @param router\r
+ * instance of the base Neutron Router object\r
+ * @param routerInterface\r
+ * instance of the NeutronRouter_Interface to be detached to the router\r
+ * @return integer\r
+ * the return value is understood to be a HTTP status code. A return value outside of 200 through 299\r
+ * results in the detach operation being interrupted and the returned status value reflected in the\r
+ * HTTP response.\r
+ */\r
+ public int canDetachInterface(NeutronRouter router, NeutronRouter_Interface routerInterface);\r
+\r
/**\r
* Services provide this interface method for taking action after an interface has been removed from a router\r
*\r
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