if (portInterface.macInUse(singleton.getMacAddress())) {
throw new ResourceConflictException("MAC Address is in use.");
}
- Object[] instances = ServiceHelper.getGlobalInstances(INeutronPortAware.class, this, null);
- if (instances != null) {
- for (Object instance : instances) {
- INeutronPortAware service = (INeutronPortAware) instance;
- int status = service.canCreatePort(singleton);
- if (status < 200 || status > 299) {
- return Response.status(status).build();
- }
- }
- }
/*
* if fixed IPs are specified, each one has to have an existing subnet ID
* that is in the same scoping network as the port. In addition, if an IP
}
}
+ Object[] instances = ServiceHelper.getGlobalInstances(INeutronPortAware.class, this, null);
+ if (instances != null) {
+ for (Object instance : instances) {
+ INeutronPortAware service = (INeutronPortAware) instance;
+ int status = service.canCreatePort(singleton);
+ if (status < 200 || status > 299) {
+ return Response.status(status).build();
+ }
+ }
+ }
+
+
// add the port to the cache
portInterface.addPort(singleton);
if (instances != null) {
if (portInterface.macInUse(test.getMacAddress())) {
throw new ResourceConflictException("MAC address in use");
}
- if (instances != null) {
- for (Object instance : instances) {
- INeutronPortAware service = (INeutronPortAware) instance;
- int status = service.canCreatePort(test);
- if (status < 200 || status > 299) {
- return Response.status(status).build();
- }
- }
- }
+
/*
* if fixed IPs are specified, each one has to have an existing subnet ID
* that is in the same scoping network as the port. In addition, if an IP
}
}
}
+ if (instances != null) {
+ for (Object instance : instances) {
+ INeutronPortAware service = (INeutronPortAware) instance;
+ int status = service.canCreatePort(test);
+ if (status < 200 || status > 299) {
+ return Response.status(status).build();
+ }
+ }
+ }
}
//once everything has passed, then we can add to the cache