Remove neutron post project split 64/15264/5
authorRyan Moats <rmoats@us.ibm.com>
Fri, 13 Feb 2015 16:19:49 +0000 (10:19 -0600)
committerTony Tkacik <ttkacik@cisco.com>
Wed, 25 Feb 2015 09:39:00 +0000 (10:39 +0100)
Now that neutron code has been split into own repo, clean up here

Change-Id: I6529bedf160c1e1d0ba2c35a37a9b01284fe03a3
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
120 files changed:
opendaylight/adsal/northbound/swagger-ui/pom.xml
opendaylight/networkconfiguration/neutron/features/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/features/src/main/resources/features.xml [deleted file]
opendaylight/networkconfiguration/neutron/implementation/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallPolicyInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallRuleInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerHealthMonitorInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerListenerInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolMemberInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityGroupInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityRuleInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/enunciate.xml [deleted file]
opendaylight/networkconfiguration/neutron/northbound/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/BadRequestException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/INeutronRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/InternalServerErrorException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRuleRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMemberRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMembersNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworkRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPageLink.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRouterRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRuleRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRulesNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronUtil.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/PaginatedRequestFactory.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceConflictException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceNotFoundException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/RestMessages.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ServiceUnavailableException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/resources/org/opendaylight/controller/networkconfig/neutron/northbound/jaxb.properties [deleted file]
opendaylight/networkconfiguration/neutron/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronObject.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronCRUDInterfaces.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewall.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallPolicy.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallRule.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFloatingIP.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancer.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerHealthMonitor.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerListener.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPool.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPoolMember.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronNetwork.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_Interface.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_NetworkReference.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityGroup.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityRule.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_HostRoute.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/Neutron_IPs.java [deleted file]
pom.xml

index ba1e5c0..8c1c8a1 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>usermanager.northbound</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron.northbound</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
                   </fileset>
                   <mapper>
                     <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*Northbound).*$$" to="\3"></regexpmapper>
-                    <regexpmapper from="^(.*)/neutron/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="neutron-\3"></regexpmapper>
                     <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="\2-\3"></regexpmapper>
                   </mapper>
                 </copy>
                   <path>
                     <fileset dir="${api.dir}">
                       <include name="**/*resource-list.json"></include>
-                      <exclude name="**/neutron*"></exclude>
                     </fileset>
                   </path>
                   <sequential>
                     <var name="jsoncontent" unset="true"></var>
                   </sequential>
                 </for>
-                <sequential>
-                  <loadfile property="jsoncontent" srcfile="${api.dir}/neutron-resource-list.json">
-                    <filterchain>
-                      <headfilter lines="46"></headfilter>
-                      <tailfilter lines="42"></tailfilter>
-                    </filterchain>
-                  </loadfile>
-                  <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
-                  <var name="jsoncontent" unset="true"></var>
-                </sequential>
                 <echo append="true" file="${resource.dir}/apilist.json">{ }
   ]
 }</echo>
diff --git a/opendaylight/networkconfiguration/neutron/features/pom.xml b/opendaylight/networkconfiguration/neutron/features/pom.xml
deleted file mode 100644 (file)
index cd7dce5..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.opendaylight</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../opendaylight/commons/opendaylight</relativePath>
-  </parent>
-  <artifactId>features-neutron</artifactId>
-  <version>${networkconfig.neutron.version}</version>
-  <packaging>jar</packaging>
-
-  <properties>
-    <features.file>features.xml</features.file>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.aaa</groupId>
-      <artifactId>features-aaa</artifactId>
-      <version>${aaa.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.moxy</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-net</groupId>
-      <artifactId>commons-net</artifactId>
-    </dependency>
-    <!-- test to validate features.xml -->
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>features-test</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <resources>
-      <resource>
-        <filtering>true</filtering>
-        <directory>src/main/resources</directory>
-      </resource>
-    </resources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-resources-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>filter</id>
-            <goals>
-              <goal>resources</goal>
-            </goals>
-            <phase>generate-resources</phase>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>attach-artifacts</id>
-            <goals>
-              <goal>attach-artifact</goal>
-            </goals>
-            <phase>package</phase>
-            <configuration>
-              <artifacts>
-                <artifact>
-                  <file>${project.build.directory}/classes/${features.file}</file>
-                  <type>xml</type>
-                  <classifier>features</classifier>
-                </artifact>
-              </artifacts>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
-            <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
-            <karaf.distro.version>${commons.opendaylight.version}</karaf.distro.version>
-          </systemPropertyVariables>
-          <dependenciesToScan>
-           <dependency>org.opendaylight.yangtools:features-test</dependency>
-          </dependenciesToScan>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
-  </scm>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/features/src/main/resources/features.xml b/opendaylight/networkconfiguration/neutron/features/src/main/resources/features.xml
deleted file mode 100644 (file)
index b244d4d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<features name="odl-neutron-${networkconfig.neutron.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-   <repository>mvn:org.opendaylight.aaa/features-aaa/${aaa.version}/xml/features</repository>
-   <feature name='odl-neutron-all' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: API">
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-api</feature>
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-northbound</feature>
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-implementation</feature>
-  </feature>
-  <feature name='odl-neutron-northbound' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: Northbound">
-    <feature version='${aaa.version}'>odl-aaa-authn</feature>
-    <feature>war</feature>
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-api</feature>
-    <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.moxy/${eclipse.persistence.version}</bundle>
-    <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.core/${eclipse.persistence.version}</bundle>
-    <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.antlr/${eclipse.persistence.version}</bundle>
-    <bundle>mvn:org.opendaylight.controller/networkconfig.neutron.northbound/${networkconfig.neutron.northbound.version}</bundle>
-    <bundle>mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
-    <bundle>mvn:com.sun.jersey/jersey-server/${jersey.version}</bundle>
-    <bundle>mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
-  </feature>
-
-  <feature name='odl-neutron-api' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: API">
-    <bundle>mvn:org.opendaylight.controller/networkconfig.neutron/${networkconfig.neutron.version}</bundle>
-    <bundle>mvn:commons-net/commons-net/${commons.net.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
-  </feature>
-  <feature name='odl-neutron-implementation' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: Implementation">
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-api</feature>
-    <feature>war</feature>
-    <bundle>mvn:org.opendaylight.controller/networkconfig.neutron.implementation/${networkconfig.neutron.implementation.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
-  </feature>
-</features>
diff --git a/opendaylight/networkconfiguration/neutron/implementation/pom.xml b/opendaylight/networkconfiguration/neutron/implementation/pom.xml
deleted file mode 100644 (file)
index 9eaebb2..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.opendaylight</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../../commons/opendaylight</relativePath>
-  </parent>
-  <artifactId>networkconfig.neutron.implementation</artifactId>
-  <version>0.5.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>*</Import-Package>
-            <Bundle-Activator>org.opendaylight.controller.networkconfig.neutron.implementation.Activator</Bundle-Activator>
-          </instructions>
-          <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-  </scm>
-
-  <distributionManagement>
-    <!-- OpenDayLight Released artifact -->
-    <repository>
-      <id>opendaylight-release</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.release}/</url>
-    </repository>
-    <!-- OpenDayLight Snapshot artifact -->
-    <snapshotRepository>
-      <id>opendaylight-snapshot</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.snapshot}/</url>
-    </snapshotRepository>
-    <!-- Site deployment -->
-    <site>
-      <id>website</id>
-      <url>${sitedeploy}</url>
-    </site>
-  </distributionManagement>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java
deleted file mode 100644 (file)
index 0fbf933..0000000
+++ /dev/null
@@ -1,135 +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.implementation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolMemberCRUD;
-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.INeutronSecurityGroupCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Activator implements BundleActivator {
-    protected static final Logger logger = LoggerFactory
-    .getLogger(Activator.class);
-    private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
-
-    @Override
-    public void start(BundleContext context) throws Exception {
-        NeutronRouterInterface neutronRouterInterface = new NeutronRouterInterface();
-        ServiceRegistration<INeutronRouterCRUD> neutronRouterInterfaceRegistration = context.registerService(INeutronRouterCRUD.class, neutronRouterInterface, null);
-        if(neutronRouterInterfaceRegistration != null) {
-            registrations.add(neutronRouterInterfaceRegistration);
-        }
-        NeutronPortInterface neutronPortInterface = new NeutronPortInterface();
-        ServiceRegistration<INeutronPortCRUD> neutronPortInterfaceRegistration = context.registerService(INeutronPortCRUD.class, neutronPortInterface, null);
-        if(neutronPortInterfaceRegistration != null) {
-            registrations.add(neutronPortInterfaceRegistration);
-        }
-
-        NeutronSubnetInterface neutronSubnetInterface = new NeutronSubnetInterface();
-        ServiceRegistration<INeutronSubnetCRUD> neutronSubnetInterfaceRegistration = context.registerService(INeutronSubnetCRUD.class, neutronSubnetInterface, null);
-        if(neutronSubnetInterfaceRegistration != null) {
-            registrations.add(neutronSubnetInterfaceRegistration);
-        }
-
-        NeutronNetworkInterface neutronNetworkInterface = new NeutronNetworkInterface();
-        ServiceRegistration<INeutronNetworkCRUD> neutronNetworkInterfaceRegistration = context.registerService(INeutronNetworkCRUD.class, neutronNetworkInterface, null);
-        if(neutronNetworkInterfaceRegistration != null) {
-            registrations.add(neutronNetworkInterfaceRegistration);
-        }
-
-        NeutronSecurityGroupInterface neutronSecurityGroupInterface = new NeutronSecurityGroupInterface();
-        ServiceRegistration<INeutronSecurityGroupCRUD> neutronSecurityGroupInterfaceRegistration = context.registerService(INeutronSecurityGroupCRUD.class, neutronSecurityGroupInterface, null);
-        if(neutronSecurityGroupInterfaceRegistration != null) {
-            registrations.add(neutronSecurityGroupInterfaceRegistration);
-        }
-
-        NeutronSecurityRuleInterface neutronSecurityRuleInterface = new NeutronSecurityRuleInterface();
-        ServiceRegistration<INeutronSecurityRuleCRUD> neutronSecurityRuleInterfaceRegistration = context.registerService(INeutronSecurityRuleCRUD.class, neutronSecurityRuleInterface, null);
-        if(neutronSecurityRuleInterfaceRegistration != null) {
-            registrations.add(neutronSecurityRuleInterfaceRegistration);
-        }
-
-        NeutronFirewallInterface neutronFirewallInterface = new NeutronFirewallInterface();
-        ServiceRegistration<INeutronFirewallCRUD> neutronFirewallInterfaceRegistration = context.registerService(INeutronFirewallCRUD.class, neutronFirewallInterface, null);
-        if(neutronFirewallInterfaceRegistration != null) {
-            registrations.add(neutronFirewallInterfaceRegistration);
-        }
-
-        NeutronFirewallPolicyInterface neutronFirewallPolicyInterface = new NeutronFirewallPolicyInterface();
-        ServiceRegistration<INeutronFirewallPolicyCRUD> neutronFirewallPolicyInterfaceRegistration = context.registerService(INeutronFirewallPolicyCRUD.class, neutronFirewallPolicyInterface, null);
-        if(neutronFirewallPolicyInterfaceRegistration != null) {
-            registrations.add(neutronFirewallPolicyInterfaceRegistration);
-        }
-
-        NeutronFirewallRuleInterface neutronFirewallRuleInterface = new NeutronFirewallRuleInterface();
-        ServiceRegistration<INeutronFirewallRuleCRUD> neutronFirewallRuleInterfaceRegistration = context.registerService(INeutronFirewallRuleCRUD.class, neutronFirewallRuleInterface, null);
-        if(neutronFirewallRuleInterfaceRegistration != null) {
-            registrations.add(neutronFirewallRuleInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerInterface neutronLoadBalancerInterface = new NeutronLoadBalancerInterface();
-        ServiceRegistration<INeutronLoadBalancerCRUD> neutronLoadBalancerInterfaceRegistration = context.registerService(INeutronLoadBalancerCRUD.class, neutronLoadBalancerInterface, null);
-        if(neutronFirewallInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerPoolInterface neutronLoadBalancerPoolInterface = new NeutronLoadBalancerPoolInterface();
-        ServiceRegistration<INeutronLoadBalancerPoolCRUD> neutronLoadBalancerPoolInterfaceRegistration = context.registerService(INeutronLoadBalancerPoolCRUD.class, neutronLoadBalancerPoolInterface, null);
-        if(neutronLoadBalancerPoolInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerPoolInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerListenerInterface neutronLoadBalancerListenerInterface = new NeutronLoadBalancerListenerInterface();
-        ServiceRegistration<INeutronLoadBalancerListenerCRUD> neutronLoadBalancerListenerInterfaceRegistration = context.registerService(INeutronLoadBalancerListenerCRUD.class, neutronLoadBalancerListenerInterface, null);
-        if(neutronLoadBalancerListenerInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerListenerInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerHealthMonitorInterface neutronLoadBalancerHealthMonitorInterface = new NeutronLoadBalancerHealthMonitorInterface();
-        ServiceRegistration<INeutronLoadBalancerHealthMonitorCRUD> neutronLoadBalancerHealthMonitorInterfaceRegistration = context.registerService(INeutronLoadBalancerHealthMonitorCRUD.class, neutronLoadBalancerHealthMonitorInterface, null);
-        if(neutronLoadBalancerHealthMonitorInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerHealthMonitorInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerPoolMemberInterface neutronLoadBalancerPoolMemberInterface = new NeutronLoadBalancerPoolMemberInterface();
-        ServiceRegistration<INeutronLoadBalancerPoolMemberCRUD> neutronLoadBalancerPoolMemberInterfaceRegistration = context.registerService(INeutronLoadBalancerPoolMemberCRUD.class, neutronLoadBalancerPoolMemberInterface, null);
-        if(neutronLoadBalancerPoolMemberInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerPoolMemberInterfaceRegistration);
-        }
-
-    }
-
-    @Override
-    public void stop(BundleContext context) throws Exception {
-       for(ServiceRegistration registration : registrations) {
-           if(registration != null) {
-               registration.unregister();
-           }
-       }
-
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallInterface.java
deleted file mode 100644 (file)
index 421f850..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewall;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronFirewallInterface implements INeutronFirewallCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFirewallInterface.class);
-
-    private ConcurrentMap<String, NeutronFirewall> firewallDB  = new ConcurrentHashMap<String, NeutronFirewall>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronFirewallExists(String uuid) {
-        return firewallDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFirewall getNeutronFirewall(String uuid) {
-        if (!neutronFirewallExists(uuid)) {
-            logger.debug("No Firewall Have Been Defined");
-            return null;
-        }
-        return firewallDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFirewall> getAllNeutronFirewalls() {
-        Set<NeutronFirewall> allFirewalls = new HashSet<NeutronFirewall>();
-        for (Entry<String, NeutronFirewall> entry : firewallDB.entrySet()) {
-            NeutronFirewall firewall = entry.getValue();
-            allFirewalls.add(firewall);
-        }
-        logger.debug("Exiting getFirewalls, Found {} OpenStackFirewall", allFirewalls.size());
-        List<NeutronFirewall> ans = new ArrayList<NeutronFirewall>();
-        ans.addAll(allFirewalls);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronFirewall(NeutronFirewall input) {
-        if (neutronFirewallExists(input.getFirewallUUID())) {
-            return false;
-        }
-        firewallDB.putIfAbsent(input.getFirewallUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronFirewall(String uuid) {
-        if (!neutronFirewallExists(uuid)) {
-            return false;
-        }
-        firewallDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronFirewall(String uuid, NeutronFirewall delta) {
-        if (!neutronFirewallExists(uuid)) {
-            return false;
-        }
-        NeutronFirewall target = firewallDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronFirewallInUse(String firewallUUID) {
-        return !neutronFirewallExists(firewallUUID);
-    }
-
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallPolicyInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallPolicyInterface.java
deleted file mode 100644 (file)
index 886d7fd..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallPolicy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronFirewallPolicyInterface implements INeutronFirewallPolicyCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFirewallPolicyInterface.class);
-
-    private ConcurrentMap<String, NeutronFirewallPolicy> firewallPolicyDB  = new ConcurrentHashMap<String, NeutronFirewallPolicy>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronFirewallPolicyExists(String uuid) {
-        return firewallPolicyDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFirewallPolicy getNeutronFirewallPolicy(String uuid) {
-        if (!neutronFirewallPolicyExists(uuid)) {
-            logger.debug("No Firewall Rule Have Been Defined");
-            return null;
-        }
-        return firewallPolicyDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFirewallPolicy> getAllNeutronFirewallPolicies() {
-        Set<NeutronFirewallPolicy> allFirewallPolicies = new HashSet<NeutronFirewallPolicy>();
-        for (Entry<String, NeutronFirewallPolicy> entry : firewallPolicyDB.entrySet()) {
-            NeutronFirewallPolicy firewallPolicy = entry.getValue();
-            allFirewallPolicies.add(firewallPolicy);
-        }
-        logger.debug("Exiting getFirewallPolicies, Found {} OpenStackFirewallPolicy", allFirewallPolicies.size());
-        List<NeutronFirewallPolicy> ans = new ArrayList<NeutronFirewallPolicy>();
-        ans.addAll(allFirewallPolicies);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronFirewallPolicy(NeutronFirewallPolicy input) {
-        if (neutronFirewallPolicyExists(input.getFirewallPolicyUUID())) {
-            return false;
-        }
-        firewallPolicyDB.putIfAbsent(input.getFirewallPolicyUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronFirewallPolicy(String uuid) {
-        if (!neutronFirewallPolicyExists(uuid)) {
-            return false;
-        }
-        firewallPolicyDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronFirewallPolicy(String uuid, NeutronFirewallPolicy delta) {
-        if (!neutronFirewallPolicyExists(uuid)) {
-            return false;
-        }
-        NeutronFirewallPolicy target = firewallPolicyDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronFirewallPolicyInUse(String firewallPolicyUUID) {
-        return !neutronFirewallPolicyExists(firewallPolicyUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallRuleInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallRuleInterface.java
deleted file mode 100644 (file)
index cd0f39a..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronFirewallRuleInterface implements INeutronFirewallRuleCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFirewallRuleInterface.class);
-
-    private ConcurrentMap<String, NeutronFirewallRule> firewallRuleDB = new ConcurrentHashMap<String, NeutronFirewallRule>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronFirewallRuleExists(String uuid) {
-        return firewallRuleDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFirewallRule getNeutronFirewallRule(String uuid) {
-        if (!neutronFirewallRuleExists(uuid)) {
-            logger.debug("No Firewall Rule Have Been Defined");
-            return null;
-        }
-        return firewallRuleDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFirewallRule> getAllNeutronFirewallRules() {
-        Set<NeutronFirewallRule> allFirewallRules = new HashSet<NeutronFirewallRule>();
-        for (Entry<String, NeutronFirewallRule> entry : firewallRuleDB.entrySet()) {
-            NeutronFirewallRule firewallRule = entry.getValue();
-            allFirewallRules.add(firewallRule);
-        }
-        logger.debug("Exiting getFirewallRules, Found {} OpenStackFirewallRule", allFirewallRules.size());
-        List<NeutronFirewallRule> ans = new ArrayList<NeutronFirewallRule>();
-        ans.addAll(allFirewallRules);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronFirewallRule(NeutronFirewallRule input) {
-        if (neutronFirewallRuleExists(input.getFirewallRuleUUID())) {
-            return false;
-        }
-        firewallRuleDB.putIfAbsent(input.getFirewallRuleUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronFirewallRule(String uuid) {
-        if (!neutronFirewallRuleExists(uuid)) {
-            return false;
-        }
-        firewallRuleDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronFirewallRule(String uuid, NeutronFirewallRule delta) {
-        if (!neutronFirewallRuleExists(uuid)) {
-            return false;
-        }
-        NeutronFirewallRule target = firewallRuleDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronFirewallRuleInUse(String firewallRuleUUID) {
-        return !neutronFirewallRuleExists(firewallRuleUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java
deleted file mode 100644 (file)
index 51824d6..0000000
+++ /dev/null
@@ -1,162 +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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-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.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFloatingIPInterface.class);
-
-    private ConcurrentMap<String, NeutronFloatingIP> floatingIPDB  = new ConcurrentHashMap<String, NeutronFloatingIP>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    @SuppressWarnings("unused")
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // IfNBFloatingIPCRUD interface methods
-
-    @Override
-    public boolean floatingIPExists(String uuid) {
-        return floatingIPDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFloatingIP getFloatingIP(String uuid) {
-        if (!floatingIPExists(uuid)) {
-            return null;
-        }
-        return floatingIPDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFloatingIP> getAllFloatingIPs() {
-        Set<NeutronFloatingIP> allIPs = new HashSet<NeutronFloatingIP>();
-        for (Entry<String, NeutronFloatingIP> entry : floatingIPDB.entrySet()) {
-            NeutronFloatingIP floatingip = entry.getValue();
-            allIPs.add(floatingip);
-        }
-        logger.debug("Exiting getAllFloatingIPs, Found {} FloatingIPs", allIPs.size());
-        List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
-        ans.addAll(allIPs);
-        return ans;
-    }
-
-    @Override
-    public boolean addFloatingIP(NeutronFloatingIP input) {
-        INeutronNetworkCRUD networkCRUD = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        INeutronSubnetCRUD subnetCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-
-        if (floatingIPExists(input.getID())) {
-            return false;
-        }
-        //if floating_ip_address isn't there, allocate from the subnet pool
-        NeutronSubnet subnet = subnetCRUD.getSubnet(networkCRUD.getNetwork(input.getFloatingNetworkUUID()).getSubnets().get(0));
-        if (input.getFloatingIPAddress() == null) {
-            input.setFloatingIPAddress(subnet.getLowAddr());
-        }
-        subnet.allocateIP(input.getFloatingIPAddress());
-
-        //if port_id is there, bind port to this floating ip
-        if (input.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(input.getPortUUID());
-            port.addFloatingIP(input.getFixedIPAddress(), input);
-        }
-
-        floatingIPDB.putIfAbsent(input.getID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeFloatingIP(String uuid) {
-        INeutronNetworkCRUD networkCRUD = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        INeutronSubnetCRUD subnetCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-
-        if (!floatingIPExists(uuid)) {
-            return false;
-        }
-        NeutronFloatingIP floatIP = getFloatingIP(uuid);
-        //if floating_ip_address isn't there, allocate from the subnet pool
-        NeutronSubnet subnet = subnetCRUD.getSubnet(networkCRUD.getNetwork(floatIP.getFloatingNetworkUUID()).getSubnets().get(0));
-        subnet.releaseIP(floatIP.getFloatingIPAddress());
-        if (floatIP.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(floatIP.getPortUUID());
-            port.removeFloatingIP(floatIP.getFixedIPAddress());
-        }
-        floatingIPDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateFloatingIP(String uuid, NeutronFloatingIP delta) {
-        INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-
-        if (!floatingIPExists(uuid)) {
-            return false;
-        }
-        NeutronFloatingIP target = floatingIPDB.get(uuid);
-        if (target.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(target.getPortUUID());
-            port.removeFloatingIP(target.getFixedIPAddress());
-        }
-
-        //if port_id is there, bind port to this floating ip
-        if (delta.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(delta.getPortUUID());
-            port.addFloatingIP(delta.getFixedIPAddress(), delta);
-        }
-
-        target.setPortUUID(delta.getPortUUID());
-        target.setFixedIPAddress(delta.getFixedIPAddress());
-        return true;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerHealthMonitorInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerHealthMonitorInterface.java
deleted file mode 100644 (file)
index ecf3994..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerHealthMonitor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerHealthMonitorInterface implements INeutronLoadBalancerHealthMonitorCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerHealthMonitorInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerHealthMonitor> loadBalancerHealthMonitorDB = new ConcurrentHashMap<String, NeutronLoadBalancerHealthMonitor>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerHealthMonitorExists(String uuid) {
-        return loadBalancerHealthMonitorDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerHealthMonitor getNeutronLoadBalancerHealthMonitor(String uuid) {
-        if (!neutronLoadBalancerHealthMonitorExists(uuid)) {
-            logger.debug("No LoadBalancerHealthMonitor has Been Defined");
-            return null;
-        }
-        return loadBalancerHealthMonitorDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerHealthMonitor> getAllNeutronLoadBalancerHealthMonitors() {
-        Set<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = new HashSet<NeutronLoadBalancerHealthMonitor>();
-        for (Entry<String, NeutronLoadBalancerHealthMonitor> entry : loadBalancerHealthMonitorDB.entrySet()) {
-            NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor = entry.getValue();
-            allLoadBalancerHealthMonitors.add(loadBalancerHealthMonitor);
-        }
-        logger.debug("Exiting getLoadBalancerHealthMonitors, Found {} OpenStackLoadBalancerHealthMonitor", allLoadBalancerHealthMonitors.size());
-        List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<NeutronLoadBalancerHealthMonitor>();
-        ans.addAll(allLoadBalancerHealthMonitors);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerHealthMonitor(NeutronLoadBalancerHealthMonitor input) {
-        if (neutronLoadBalancerHealthMonitorExists(input.getLoadBalancerHealthMonitorID())) {
-            return false;
-        }
-        loadBalancerHealthMonitorDB.putIfAbsent(input.getLoadBalancerHealthMonitorID(), input);
-        //TODO: add code to find INeutronLoadBalancerHealthMonitorAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerHealthMonitor(String uuid) {
-        if (!neutronLoadBalancerHealthMonitorExists(uuid)) {
-            return false;
-        }
-        loadBalancerHealthMonitorDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerHealthMonitorAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerHealthMonitor(String uuid, NeutronLoadBalancerHealthMonitor delta) {
-        if (!neutronLoadBalancerHealthMonitorExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerHealthMonitor target = loadBalancerHealthMonitorDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerHealthMonitorInUse(String loadBalancerHealthMonitorUUID) {
-        return !neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorUUID);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerInterface.java
deleted file mode 100644 (file)
index 472de90..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerInterface implements INeutronLoadBalancerCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancer> loadBalancerDB  = new ConcurrentHashMap<String, NeutronLoadBalancer>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerExists(String uuid) {
-        return loadBalancerDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancer getNeutronLoadBalancer(String uuid) {
-        if (!neutronLoadBalancerExists(uuid)) {
-            logger.debug("No LoadBalancer Have Been Defined");
-            return null;
-        }
-        return loadBalancerDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancer> getAllNeutronLoadBalancers() {
-        Set<NeutronLoadBalancer> allLoadBalancers = new HashSet<NeutronLoadBalancer>();
-        for (Entry<String, NeutronLoadBalancer> entry : loadBalancerDB.entrySet()) {
-            NeutronLoadBalancer loadBalancer = entry.getValue();
-            allLoadBalancers.add(loadBalancer);
-        }
-        logger.debug("Exiting getLoadBalancers, Found {} OpenStackLoadBalancer", allLoadBalancers.size());
-        List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
-        ans.addAll(allLoadBalancers);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancer(NeutronLoadBalancer input) {
-        if (neutronLoadBalancerExists(input.getLoadBalancerID())) {
-            return false;
-        }
-        loadBalancerDB.putIfAbsent(input.getLoadBalancerID(), input);
-        //TODO: add code to find INeutronLoadBalancerAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancer(String uuid) {
-        if (!neutronLoadBalancerExists(uuid)) {
-            return false;
-        }
-        loadBalancerDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancer(String uuid, NeutronLoadBalancer delta) {
-        if (!neutronLoadBalancerExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancer target = loadBalancerDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerInUse(String loadBalancerUUID) {
-        return !neutronLoadBalancerExists(loadBalancerUUID);
-    }
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerListenerInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerListenerInterface.java
deleted file mode 100644 (file)
index 6acc06d..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerListenerInterface implements INeutronLoadBalancerListenerCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerListenerInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerListener> loadBalancerListenerDB  = new ConcurrentHashMap<String, NeutronLoadBalancerListener>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerListenerExists(String uuid) {
-        return loadBalancerListenerDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerListener getNeutronLoadBalancerListener(String uuid) {
-        if (!neutronLoadBalancerListenerExists(uuid)) {
-            logger.debug("No LoadBalancerListener Have Been Defined");
-            return null;
-        }
-        return loadBalancerListenerDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerListener> getAllNeutronLoadBalancerListeners() {
-        Set<NeutronLoadBalancerListener> allLoadBalancerListeners = new HashSet<NeutronLoadBalancerListener>();
-        for (Entry<String, NeutronLoadBalancerListener> entry : loadBalancerListenerDB.entrySet()) {
-            NeutronLoadBalancerListener loadBalancerListener = entry.getValue();
-            allLoadBalancerListeners.add(loadBalancerListener);
-        }
-        logger.debug("Exiting getLoadBalancerListeners, Found {} OpenStackLoadBalancerListener", allLoadBalancerListeners.size());
-        List<NeutronLoadBalancerListener> ans = new ArrayList<NeutronLoadBalancerListener>();
-        ans.addAll(allLoadBalancerListeners);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerListener(NeutronLoadBalancerListener input) {
-        if (neutronLoadBalancerListenerExists(input.getLoadBalancerListenerID())) {
-            return false;
-        }
-        loadBalancerListenerDB.putIfAbsent(input.getLoadBalancerListenerID(), input);
-        //TODO: add code to find INeutronLoadBalancerListenerAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerListener(String uuid) {
-        if (!neutronLoadBalancerListenerExists(uuid)) {
-            return false;
-        }
-        loadBalancerListenerDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerListenerAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerListener(String uuid, NeutronLoadBalancerListener delta) {
-        if (!neutronLoadBalancerListenerExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerListener target = loadBalancerListenerDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerListenerInUse(String loadBalancerListenerUUID) {
-        return !neutronLoadBalancerListenerExists(loadBalancerListenerUUID);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolInterface.java
deleted file mode 100644 (file)
index 03c9cd9..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerPoolInterface implements INeutronLoadBalancerPoolCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerPoolInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerPool> loadBalancerPoolDB = new ConcurrentHashMap<String, NeutronLoadBalancerPool>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolExists(String uuid) {
-        return loadBalancerPoolDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerPool getNeutronLoadBalancerPool(String uuid) {
-        if (!neutronLoadBalancerPoolExists(uuid)) {
-            logger.debug("No LoadBalancerPool has Been Defined");
-            return null;
-        }
-        return loadBalancerPoolDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerPool> getAllNeutronLoadBalancerPools() {
-        Set<NeutronLoadBalancerPool> allLoadBalancerPools = new HashSet<NeutronLoadBalancerPool>();
-        for (Entry<String, NeutronLoadBalancerPool> entry : loadBalancerPoolDB.entrySet()) {
-            NeutronLoadBalancerPool loadBalancerPool = entry.getValue();
-            allLoadBalancerPools.add(loadBalancerPool);
-        }
-        logger.debug("Exiting getLoadBalancerPools, Found {} OpenStackLoadBalancerPool", allLoadBalancerPools.size());
-        List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
-        ans.addAll(allLoadBalancerPools);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerPool(NeutronLoadBalancerPool input) {
-        if (neutronLoadBalancerPoolExists(input.getLoadBalancerPoolID())) {
-            return false;
-        }
-        loadBalancerPoolDB.putIfAbsent(input.getLoadBalancerPoolID(), input);
-        //TODO: add code to find INeutronLoadBalancerPoolAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerPool(String uuid) {
-        if (!neutronLoadBalancerPoolExists(uuid)) {
-            return false;
-        }
-        loadBalancerPoolDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerPoolAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerPool(String uuid, NeutronLoadBalancerPool delta) {
-        if (!neutronLoadBalancerPoolExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerPool target = loadBalancerPoolDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolInUse(String loadBalancerPoolUUID) {
-        return !neutronLoadBalancerPoolExists(loadBalancerPoolUUID);
-    }
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolMemberInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolMemberInterface.java
deleted file mode 100644 (file)
index 8ed3a36..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolMemberCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerPoolMemberInterface
-        implements INeutronLoadBalancerPoolMemberCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerPoolMemberInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerPoolMember> loadBalancerPoolMemberDB  = new ConcurrentHashMap<String, NeutronLoadBalancerPoolMember>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch(Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolMemberExists(String uuid) {
-        return loadBalancerPoolMemberDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerPoolMember getNeutronLoadBalancerPoolMember(String uuid) {
-        if (!neutronLoadBalancerPoolMemberExists(uuid)) {
-            logger.debug("No LoadBalancerPoolMember Have Been Defined");
-            return null;
-        }
-        return loadBalancerPoolMemberDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerPoolMember> getAllNeutronLoadBalancerPoolMembers() {
-        Set<NeutronLoadBalancerPoolMember> allLoadBalancerPoolMembers = new HashSet<NeutronLoadBalancerPoolMember>();
-        for (Map.Entry<String, NeutronLoadBalancerPoolMember> entry : loadBalancerPoolMemberDB.entrySet()) {
-            NeutronLoadBalancerPoolMember loadBalancerPoolMember = entry.getValue();
-            allLoadBalancerPoolMembers.add(loadBalancerPoolMember);
-        }
-        logger.debug("Exiting getLoadBalancerPoolMembers, Found {} OpenStackLoadBalancerPoolMember",
-                allLoadBalancerPoolMembers.size());
-        List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
-        ans.addAll(allLoadBalancerPoolMembers);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerPoolMember(NeutronLoadBalancerPoolMember input) {
-        if (neutronLoadBalancerPoolMemberExists(input.getPoolMemberID())) {
-            return false;
-        }
-        loadBalancerPoolMemberDB.putIfAbsent(input.getPoolMemberID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerPoolMember(String uuid) {
-        if (!neutronLoadBalancerPoolMemberExists(uuid)) {
-            return false;
-        }
-        loadBalancerPoolMemberDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerPoolMember(String uuid, NeutronLoadBalancerPoolMember delta) {
-        if (!neutronLoadBalancerPoolMemberExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerPoolMember target = loadBalancerPoolMemberDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolMemberInUse(String loadBalancerPoolMemberID) {
-        return !neutronLoadBalancerPoolMemberExists(loadBalancerPoolMemberID);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java
deleted file mode 100644 (file)
index c9e1549..0000000
+++ /dev/null
@@ -1,127 +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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronNetworkInterface implements INeutronNetworkCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronNetworkInterface.class);
-    private ConcurrentMap<String, NeutronNetwork> networkDB = new ConcurrentHashMap<String, NeutronNetwork>();
-
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // IfNBNetworkCRUD methods
-
-    @Override
-    public boolean networkExists(String uuid) {
-        return networkDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronNetwork getNetwork(String uuid) {
-        if (!networkExists(uuid)) {
-            return null;
-        }
-        return networkDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronNetwork> getAllNetworks() {
-        Set<NeutronNetwork> allNetworks = new HashSet<NeutronNetwork>();
-        for (Entry<String, NeutronNetwork> entry : networkDB.entrySet()) {
-            NeutronNetwork network = entry.getValue();
-            allNetworks.add(network);
-        }
-        logger.debug("Exiting getAllNetworks, Found {} OpenStackNetworks", allNetworks.size());
-        List<NeutronNetwork> ans = new ArrayList<NeutronNetwork>();
-        ans.addAll(allNetworks);
-        return ans;
-    }
-
-    @Override
-    public boolean addNetwork(NeutronNetwork input) {
-        if (networkExists(input.getID())) {
-            return false;
-        }
-        networkDB.putIfAbsent(input.getID(), input);
-      //TODO: add code to find INeutronNetworkAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNetwork(String uuid) {
-        if (!networkExists(uuid)) {
-            return false;
-        }
-        networkDB.remove(uuid);
-      //TODO: add code to find INeutronNetworkAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNetwork(String uuid, NeutronNetwork delta) {
-        if (!networkExists(uuid)) {
-            return false;
-        }
-        NeutronNetwork target = networkDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean networkInUse(String netUUID) {
-        if (!networkExists(netUUID)) {
-            return true;
-        }
-        NeutronNetwork target = networkDB.get(netUUID);
-        if (target.getPortsOnNetwork().size() > 0) {
-            return true;
-        }
-        return false;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java
deleted file mode 100644 (file)
index 5c87800..0000000
+++ /dev/null
@@ -1,219 +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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-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.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronPortInterface implements INeutronPortCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronPortInterface.class);
-    private ConcurrentMap<String, NeutronPort> portDB = new ConcurrentHashMap<String, NeutronPort>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // IfNBPortCRUD methods
-
-    @Override
-    public boolean portExists(String uuid) {
-        return portDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronPort getPort(String uuid) {
-        if (!portExists(uuid)) {
-            return null;
-        }
-        return portDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronPort> getAllPorts() {
-        Set<NeutronPort> allPorts = new HashSet<NeutronPort>();
-        for (Entry<String, NeutronPort> entry : portDB.entrySet()) {
-            NeutronPort port = entry.getValue();
-            allPorts.add(port);
-        }
-        logger.debug("Exiting getAllPorts, Found {} OpenStackPorts", allPorts.size());
-        List<NeutronPort> ans = new ArrayList<NeutronPort>();
-        ans.addAll(allPorts);
-        return ans;
-    }
-
-    @Override
-    public boolean addPort(NeutronPort input) {
-        if (portExists(input.getID())) {
-            return false;
-        }
-        portDB.putIfAbsent(input.getID(), input);
-        // if there are no fixed IPs, allocate one for each subnet in the network
-        INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (input.getFixedIPs() == null){
-           input.setFixedIPs(new ArrayList<Neutron_IPs>());
-        }
-        if (input.getFixedIPs().size() == 0) {
-            List<Neutron_IPs> list = input.getFixedIPs();
-            Iterator<NeutronSubnet> subnetIterator = systemCRUD.getAllSubnets().iterator();
-            while (subnetIterator.hasNext()) {
-                NeutronSubnet subnet = subnetIterator.next();
-                if (subnet.getNetworkUUID().equals(input.getNetworkUUID())) {
-                    list.add(new Neutron_IPs(subnet.getID()));
-                }
-            }
-        }
-        Iterator<Neutron_IPs> fixedIPIterator = input.getFixedIPs().iterator();
-        while (fixedIPIterator.hasNext()) {
-            Neutron_IPs ip = fixedIPIterator.next();
-            NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-            if (ip.getIpAddress() == null) {
-                ip.setIpAddress(subnet.getLowAddr());
-            }
-            if (!ip.getIpAddress().equals(subnet.getGatewayIP())) {
-                subnet.allocateIP(ip.getIpAddress());
-            }
-            else {
-                subnet.setGatewayIPAllocated();
-            }
-            subnet.addPort(input);
-        }
-        INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-
-        NeutronNetwork network = networkIf.getNetwork(input.getNetworkUUID());
-        network.addPort(input);
-        return true;
-    }
-
-    @Override
-    public boolean removePort(String uuid) {
-        if (!portExists(uuid)) {
-            return false;
-        }
-        NeutronPort port = getPort(uuid);
-        portDB.remove(uuid);
-        INeutronNetworkCRUD networkCRUD = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-
-        NeutronNetwork network = networkCRUD.getNetwork(port.getNetworkUUID());
-        network.removePort(port);
-        Iterator<Neutron_IPs> fixedIPIterator = port.getFixedIPs().iterator();
-        while (fixedIPIterator.hasNext()) {
-            Neutron_IPs ip = fixedIPIterator.next();
-            NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-            if (!ip.getIpAddress().equals(subnet.getGatewayIP())) {
-                subnet.releaseIP(ip.getIpAddress());
-            }
-            else {
-                subnet.resetGatewayIPAllocated();
-            }
-            subnet.removePort(port);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean updatePort(String uuid, NeutronPort delta) {
-        if (!portExists(uuid)) {
-            return false;
-        }
-        NeutronPort target = portDB.get(uuid);
-        // remove old Fixed_IPs
-        if (delta.getFixedIPs() != null) {
-            NeutronPort port = getPort(uuid);
-            INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-            for (Neutron_IPs ip: port.getFixedIPs()) {
-                NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-                subnet.releaseIP(ip.getIpAddress());
-            }
-
-            // allocate new Fixed_IPs
-            for (Neutron_IPs ip: delta.getFixedIPs()) {
-                NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-                if (ip.getIpAddress() == null) {
-                    ip.setIpAddress(subnet.getLowAddr());
-                }
-                subnet.allocateIP(ip.getIpAddress());
-            }
-        }
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean macInUse(String macAddress) {
-        List<NeutronPort> ports = getAllPorts();
-        Iterator<NeutronPort> portIterator = ports.iterator();
-        while (portIterator.hasNext()) {
-            NeutronPort port = portIterator.next();
-            if (macAddress.equalsIgnoreCase(port.getMacAddress())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public NeutronPort getGatewayPort(String subnetUUID) {
-        INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        NeutronSubnet subnet = systemCRUD.getSubnet(subnetUUID);
-        Iterator<NeutronPort> portIterator = getAllPorts().iterator();
-        while (portIterator.hasNext()) {
-            NeutronPort port = portIterator.next();
-            List<Neutron_IPs> fixedIPs = port.getFixedIPs();
-            if (fixedIPs.size() == 1) {
-                if (subnet.getGatewayIP().equals(fixedIPs.get(0).getIpAddress())) {
-                    return port;
-                }
-            }
-        }
-        return null;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java
deleted file mode 100644 (file)
index 5e4c5a4..0000000
+++ /dev/null
@@ -1,124 +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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronRouterInterface implements INeutronRouterCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronRouterInterface.class);
-    private ConcurrentMap<String, NeutronRouter> routerDB  = new ConcurrentHashMap<String, NeutronRouter>();
-    // methods needed for creating caches
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-
-    // IfNBRouterCRUD Interface methods
-
-    @Override
-    public boolean routerExists(String uuid) {
-        return routerDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronRouter getRouter(String uuid) {
-        if (!routerExists(uuid)) {
-            return null;
-        }
-        return routerDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronRouter> getAllRouters() {
-        Set<NeutronRouter> allRouters = new HashSet<NeutronRouter>();
-        for (Entry<String, NeutronRouter> entry : routerDB.entrySet()) {
-            NeutronRouter router = entry.getValue();
-            allRouters.add(router);
-        }
-        logger.debug("Exiting getAllRouters, Found {} Routers", allRouters.size());
-        List<NeutronRouter> ans = new ArrayList<NeutronRouter>();
-        ans.addAll(allRouters);
-        return ans;
-    }
-
-    @Override
-    public boolean addRouter(NeutronRouter input) {
-        if (routerExists(input.getID())) {
-            return false;
-        }
-        routerDB.putIfAbsent(input.getID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeRouter(String uuid) {
-        if (!routerExists(uuid)) {
-            return false;
-        }
-        routerDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateRouter(String uuid, NeutronRouter delta) {
-        if (!routerExists(uuid)) {
-            return false;
-        }
-        NeutronRouter target = routerDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean routerInUse(String routerUUID) {
-        if (!routerExists(routerUUID)) {
-            return true;
-        }
-        NeutronRouter target = routerDB.get(routerUUID);
-        return (target.getInterfaces().size() > 0);
-    }
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityGroupInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityGroupInterface.java
deleted file mode 100644 (file)
index d59bf9e..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Map.Entry;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityGroupCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityGroup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class NeutronSecurityGroupInterface implements INeutronSecurityGroupCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronSecurityGroupInterface.class);
-    private ConcurrentMap<String, NeutronSecurityGroup> securityGroupDB  = new ConcurrentHashMap<String, NeutronSecurityGroup>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronSecurityGroupExists(String uuid) {
-        return securityGroupDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronSecurityGroup getNeutronSecurityGroup(String uuid) {
-        if (!neutronSecurityGroupExists(uuid)) {
-            logger.debug("No Security Groups Have Been Defined");
-            return null;
-        }
-        return securityGroupDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronSecurityGroup> getAllNeutronSecurityGroups() {
-        Set<NeutronSecurityGroup> allSecurityGroups = new HashSet<NeutronSecurityGroup>();
-        for (Entry<String, NeutronSecurityGroup> entry : securityGroupDB.entrySet()) {
-            NeutronSecurityGroup securityGroup = entry.getValue();
-            allSecurityGroups.add(securityGroup);
-        }
-        logger.debug("Exiting getSecurityGroups, Found {} OpenStackSecurityGroup", allSecurityGroups.size());
-        List<NeutronSecurityGroup> ans = new ArrayList<NeutronSecurityGroup>();
-        ans.addAll(allSecurityGroups);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronSecurityGroup(NeutronSecurityGroup input) {
-        if (neutronSecurityGroupExists(input.getSecurityGroupUUID())) {
-            return false;
-        }
-        securityGroupDB.putIfAbsent(input.getSecurityGroupUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronSecurityGroup(String uuid) {
-        if (!neutronSecurityGroupExists(uuid)) {
-            return false;
-        }
-        securityGroupDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronSecurityGroup(String uuid, NeutronSecurityGroup delta) {
-        if (!neutronSecurityGroupExists(uuid)) {
-            return false;
-        }
-        NeutronSecurityGroup target = securityGroupDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronSecurityGroupInUse(String securityGroupUUID) {
-        return !neutronSecurityGroupExists(securityGroupUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityRuleInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityRuleInterface.java
deleted file mode 100644 (file)
index 884d15f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Map.Entry;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityRule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class NeutronSecurityRuleInterface implements INeutronSecurityRuleCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronSecurityRuleInterface.class);
-    private ConcurrentMap<String, NeutronSecurityRule> securityRuleDB  = new ConcurrentHashMap<String, NeutronSecurityRule>();
-
-    // this method uses reflection to update an object from it's delta.
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronSecurityRuleExists(String uuid) {
-        return securityRuleDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronSecurityRule getNeutronSecurityRule(String uuid) {
-        if (!neutronSecurityRuleExists(uuid)) {
-            logger.debug("No Security Rules Have Been Defined");
-            return null;
-        }
-        return securityRuleDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronSecurityRule> getAllNeutronSecurityRules() {
-        Set<NeutronSecurityRule> allSecurityRules = new HashSet<NeutronSecurityRule>();
-        for (Entry<String, NeutronSecurityRule> entry : securityRuleDB.entrySet()) {
-            NeutronSecurityRule securityRule = entry.getValue();
-            allSecurityRules.add(securityRule);
-        }
-        logger.debug("Exiting getSecurityRule, Found {} OpenStackSecurityRule", allSecurityRules.size());
-        List<NeutronSecurityRule> ans = new ArrayList<NeutronSecurityRule>();
-        ans.addAll(allSecurityRules);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronSecurityRule(NeutronSecurityRule input) {
-        if (neutronSecurityRuleExists(input.getSecurityRuleUUID())) {
-            return false;
-        }
-        securityRuleDB.putIfAbsent(input.getSecurityRuleUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronSecurityRule(String uuid) {
-        if (!neutronSecurityRuleExists(uuid)) {
-            return false;
-        }
-        securityRuleDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronSecurityRule(String uuid, NeutronSecurityRule delta) {
-        if (!neutronSecurityRuleExists(uuid)) {
-            return false;
-        }
-        NeutronSecurityRule target = securityRuleDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronSecurityRuleInUse(String securityRuleUUID) {
-        return !neutronSecurityRuleExists(securityRuleUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java
deleted file mode 100644 (file)
index 81fa107..0000000
+++ /dev/null
@@ -1,135 +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.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-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.NeutronSubnet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronSubnetInterface implements INeutronSubnetCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronSubnetInterface.class);
-    private ConcurrentMap<String, NeutronSubnet> subnetDB  = new ConcurrentHashMap<String, NeutronSubnet>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-
-    // IfNBSubnetCRUD methods
-
-    @Override
-    public boolean subnetExists(String uuid) {
-        return subnetDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronSubnet getSubnet(String uuid) {
-        if (!subnetExists(uuid)) {
-            return null;
-        }
-        return subnetDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronSubnet> getAllSubnets() {
-        Set<NeutronSubnet> allSubnets = new HashSet<NeutronSubnet>();
-        for (Entry<String, NeutronSubnet> entry : subnetDB.entrySet()) {
-            NeutronSubnet subnet = entry.getValue();
-            allSubnets.add(subnet);
-        }
-        logger.debug("Exiting getAllSubnets, Found {} OpenStackSubnets", allSubnets.size());
-        List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>();
-        ans.addAll(allSubnets);
-        return ans;
-    }
-
-    @Override
-    public boolean addSubnet(NeutronSubnet input) {
-        String id = input.getID();
-        if (subnetExists(id)) {
-            return false;
-        }
-        subnetDB.putIfAbsent(id, input);
-        INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-
-        NeutronNetwork targetNet = networkIf.getNetwork(input.getNetworkUUID());
-        targetNet.addSubnet(id);
-        return true;
-    }
-
-    @Override
-    public boolean removeSubnet(String uuid) {
-        if (!subnetExists(uuid)) {
-            return false;
-        }
-        NeutronSubnet target = subnetDB.get(uuid);
-        INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-
-        NeutronNetwork targetNet = networkIf.getNetwork(target.getNetworkUUID());
-        targetNet.removeSubnet(uuid);
-        subnetDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateSubnet(String uuid, NeutronSubnet delta) {
-        if (!subnetExists(uuid)) {
-            return false;
-        }
-        NeutronSubnet target = subnetDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean subnetInUse(String subnetUUID) {
-        if (!subnetExists(subnetUUID)) {
-            return true;
-        }
-        NeutronSubnet target = subnetDB.get(subnetUUID);
-        return (target.getPortsInSubnet().size() > 0);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/enunciate.xml b/opendaylight/networkconfiguration/neutron/northbound/enunciate.xml
deleted file mode 100644 (file)
index 6616025..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.28.xsd">
-
-  <services>
-    <rest defaultRestSubcontext="/controller/nb/v2/neutron"/>
-  </services>
-
-  <modules>
-    <docs docsDir="rest" title="OpenStack Neutron REST API" includeExampleXml="false" includeExampleJson="true"/>
-   </modules>
-</enunciate>
diff --git a/opendaylight/networkconfiguration/neutron/northbound/pom.xml b/opendaylight/networkconfiguration/neutron/northbound/pom.xml
deleted file mode 100644 (file)
index 1e7bcf0..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>enunciate-parent</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../../commons/enunciate-parent</relativePath>
-  </parent>
-  <artifactId>networkconfig.neutron.northbound</artifactId>
-  <version>0.5.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.enunciate</groupId>
-      <artifactId>enunciate-core-annotations</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.moxy</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>org.opendaylight.controller.networkconfig.neutron,
-                            org.eclipse.persistence.jaxb.rs,
-                            com.sun.jersey.spi.container.servlet,
-                            javax.ws.rs,
-                            javax.ws.rs.ext,
-                            javax.ws.rs.core,
-                            javax.xml.bind.annotation,
-                            javax.xml.bind,
-                            org.slf4j,
-                            org.osgi.framework,
-                            !org.codehaus.enunciate.jaxrs</Import-Package>
-            <Web-ContextPath>/controller/nb/v2/neutron</Web-ContextPath>
-          </instructions>
-          <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-  </scm>
-
-  <distributionManagement>
-    <!-- OpenDayLight Released artifact -->
-    <repository>
-      <id>opendaylight-release</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.release}/</url>
-    </repository>
-    <!-- OpenDayLight Snapshot artifact -->
-    <snapshotRepository>
-      <id>opendaylight-snapshot</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.snapshot}/</url>
-    </snapshotRepository>
-    <!-- Site deployment -->
-    <site>
-      <id>website</id>
-      <url>${sitedeploy}</url>
-    </site>
-  </distributionManagement>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/BadRequestException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/BadRequestException.java
deleted file mode 100644 (file)
index 9db8633..0000000
+++ /dev/null
@@ -1,27 +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.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 400 (Bad Request)
- *
- * The request could not be understood by the server due to malformed syntax.
- * The client SHOULD NOT repeat the request without modifications.
- */
-public class BadRequestException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    public BadRequestException(String string) {
-        super(Response.status(Response.Status.BAD_REQUEST).entity(string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/INeutronRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/INeutronRequest.java
deleted file mode 100644 (file)
index 8325d84..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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
- *
- *  Authors : Dave Tucker
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronObject;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for Neutron Requests
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.northbound.api.INeutronRequest}
- */
-@Deprecated
-public interface INeutronRequest<T extends INeutronObject> {
-    public T getSingleton();
-    public boolean isSingleton();
-    public List<T> getBulk();
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/InternalServerErrorException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/InternalServerErrorException.java
deleted file mode 100644 (file)
index 5a40a18..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.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Status Code 500 (Internal Server Error)
- *
- * 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());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallNorthbound.java
deleted file mode 100644 (file)
index b97a554..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewall;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Neutron Northbound REST APIs for Firewall.<br>
- * This class provides REST APIs for managing neutron Firewall
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/fw/firewalls")
-public class NeutronFirewallNorthbound {
-
-    private NeutronFirewall extractFields(NeutronFirewall o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Firewalls */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack firewall attributes
-            @QueryParam("id") String queryFirewallUUID,
-            @QueryParam("tenant_id") String queryFirewallTenantID,
-            @QueryParam("name") String queryFirewallName,
-            @QueryParam("description") String queryFirewallDescription,
-            @QueryParam("shared") Boolean queryFirewallAdminStateIsUp,
-            @QueryParam("status") String queryFirewallStatus,
-            @QueryParam("shared") Boolean queryFirewallIsShared,
-            @QueryParam("firewall_policy_id") String queryFirewallPolicyID,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFirewall> allFirewalls = firewallInterface.getAllNeutronFirewalls();
-        List<NeutronFirewall> ans = new ArrayList<NeutronFirewall>();
-        Iterator<NeutronFirewall> i = allFirewalls.iterator();
-        while (i.hasNext()) {
-            NeutronFirewall nsg = i.next();
-            if ((queryFirewallUUID == null ||
-                queryFirewallUUID.equals(nsg.getFirewallUUID())) &&
-                (queryFirewallTenantID == null ||
-                    queryFirewallTenantID.equals(nsg.getFirewallTenantID())) &&
-                (queryFirewallName == null ||
-                    queryFirewallName.equals(nsg.getFirewallName())) &&
-                (queryFirewallDescription == null ||
-                    queryFirewallDescription.equals(nsg.getFirewallDescription())) &&
-                (queryFirewallAdminStateIsUp == null ||
-                    queryFirewallAdminStateIsUp.equals(nsg.getFirewallAdminStateIsUp())) &&
-                (queryFirewallStatus == null ||
-                    queryFirewallStatus.equals(nsg.getFirewallStatus())) &&
-                (queryFirewallIsShared == null ||
-                    queryFirewallIsShared.equals(nsg.getFirewallIsShared())) &&
-                (queryFirewallPolicyID == null ||
-                    queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFirewallRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Firewall */
-
-    @Path("{firewallUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showFirewall(@PathParam("firewallUUID") String firewallUUID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!firewallInterface.neutronFirewallExists(firewallUUID)) {
-            throw new ResourceNotFoundException("Firewall UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronFirewall ans = firewallInterface.getNeutronFirewall(firewallUUID);
-            return Response.status(200).entity(
-                    new NeutronFirewallRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronFirewallRequest(firewallInterface.getNeutronFirewall(firewallUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Firewall */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createFirewalls(final NeutronFirewallRequest input) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronFirewall singleton = input.getSingleton();
-
-            /*
-             *  Verify that the Firewall doesn't already exist.
-             */
-            if (firewallInterface.neutronFirewallExists(singleton.getFirewallUUID())) {
-                throw new BadRequestException("Firewall UUID already exists");
-            }
-            firewallInterface.addNeutronFirewall(singleton);
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                        int status = service.canCreateNeutronFirewall(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            firewallInterface.addNeutronFirewall(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                    service.neutronFirewallCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronFirewall> bulk = input.getBulk();
-            Iterator<NeutronFirewall> i = bulk.iterator();
-            HashMap<String, NeutronFirewall> testMap = new HashMap<String, NeutronFirewall>();
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-            while (i.hasNext()) {
-                NeutronFirewall test = i.next();
-
-                /*
-                 *  Verify that the secruity group doesn't already exist
-                 */
-                if (firewallInterface.neutronFirewallExists(test.getFirewallUUID())) {
-                    throw new BadRequestException("Firewall UUID already is already created");
-                }
-                if (testMap.containsKey(test.getFirewallUUID())) {
-                    throw new BadRequestException("Firewall UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                            int status = service.canCreateNeutronFirewall(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronFirewall test = i.next();
-                firewallInterface.addNeutronFirewall(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                        service.neutronFirewallCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Firewall */
-
-    @Path("{firewallUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateFirewall(
-            @PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall exists and there is only one delta provided
-         */
-        if (!firewallInterface.neutronFirewallExists(firewallUUID)) {
-            throw new ResourceNotFoundException("Firewall UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronFirewall delta = input.getSingleton();
-        NeutronFirewall original = firewallInterface.getNeutronFirewall(firewallUUID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getFirewallUUID() != null ||
-                delta.getFirewallTenantID() != null ||
-                delta.getFirewallName() != null ||
-                delta.getFirewallDescription() != null ||
-                delta.getFirewallAdminStateIsUp() != null ||
-                delta.getFirewallStatus() != null ||
-                delta.getFirewallIsShared() != null ||
-                delta.getFirewallPolicyID() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                    int status = service.canUpdateNeutronFirewall(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        firewallInterface.updateNeutronFirewall(firewallUUID, delta);
-        NeutronFirewall updatedFirewall = firewallInterface.getNeutronFirewall(firewallUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                service.neutronFirewallUpdated(updatedFirewall);
-            }
-        }
-        return Response.status(200).entity(new NeutronFirewallRequest(firewallInterface.getNeutronFirewall(firewallUUID))).build();
-    }
-
-    /**
-     * Deletes a Firewall */
-
-    @Path("{firewallUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteFirewall(
-            @PathParam("firewallUUID") String firewallUUID) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall exists and it isn't currently in use
-         */
-        if (!firewallInterface.neutronFirewallExists(firewallUUID)) {
-            throw new ResourceNotFoundException("Firewall UUID does not exist.");
-        }
-        if (firewallInterface.neutronFirewallInUse(firewallUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronFirewall singleton = firewallInterface.getNeutronFirewall(firewallUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                    int status = service.canDeleteNeutronFirewall(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        firewallInterface.removeNeutronFirewall(firewallUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                service.neutronFirewallDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java
deleted file mode 100644 (file)
index e9b813d..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallPolicy;
-
-/**
- * Neutron Northbound REST APIs for Firewall Policies.<br>
- * This class provides REST APIs for managing neutron Firewall Policies
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/fw/firewalls_policies")
-public class NeutronFirewallPolicyNorthbound {
-
-    private NeutronFirewallPolicy extractFields(NeutronFirewallPolicy o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Firewall Policies */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack Firewall Policy attributes
-            @QueryParam("id") String queryFirewallPolicyUUID,
-            @QueryParam("tenant_id") String queryFirewallPolicyTenantID,
-            @QueryParam("name") String queryFirewallPolicyName,
-            @QueryParam("description") String querySecurityPolicyDescription,
-            @QueryParam("shared") String querySecurityPolicyIsShared,
-            @QueryParam("firewall_rules") List<String> querySecurityPolicyFirewallRules,
-            @QueryParam("audited") Boolean querySecurityPolicyIsAudited,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFirewallPolicy> allFirewallPolicies = firewallPolicyInterface.getAllNeutronFirewallPolicies();
-        List<NeutronFirewallPolicy> ans = new ArrayList<NeutronFirewallPolicy>();
-        Iterator<NeutronFirewallPolicy> i = allFirewallPolicies.iterator();
-        while (i.hasNext()) {
-            NeutronFirewallPolicy nsg = i.next();
-            if ((queryFirewallPolicyUUID == null ||
-                queryFirewallPolicyUUID.equals(nsg.getFirewallPolicyUUID())) &&
-                (queryFirewallPolicyTenantID == null ||
-                    queryFirewallPolicyTenantID.equals(nsg.getFirewallPolicyTenantID())) &&
-                (queryFirewallPolicyName == null ||
-                    queryFirewallPolicyName.equals(nsg.getFirewallPolicyName())) &&
-                (querySecurityPolicyDescription == null ||
-                    querySecurityPolicyDescription.equals(nsg.getFirewallPolicyDescription())) &&
-                (querySecurityPolicyIsShared == null ||
-                    querySecurityPolicyIsShared.equals(nsg.getFirewallPolicyIsShared())) &&
-                (querySecurityPolicyFirewallRules.size() == 0 ||
-                    querySecurityPolicyFirewallRules.equals(nsg.getFirewallPolicyRules())) &&
-                (querySecurityPolicyIsAudited == null ||
-                    querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        } // ans.add((NeutronFirewallPolicy) rules);
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFirewallPolicyRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Firewall Policy */
-
-    @Path("{firewallPolicyUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!firewallPolicyInterface.neutronFirewallPolicyExists(firewallPolicyUUID)) {
-            throw new ResourceNotFoundException("Firewall Policy UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronFirewallPolicy ans = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-            return Response.status(200).entity(
-                    new NeutronFirewallPolicyRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronFirewallPolicyRequest(firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Firewall Policy
-     * */
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createFirewallPolicies(final NeutronFirewallPolicyRequest input) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronFirewallPolicy singleton = input.getSingleton();
-
-            /*
-             *  Verify that the Firewall Policy doesn't already exist.
-             */
-            if (firewallPolicyInterface.neutronFirewallPolicyExists(singleton.getFirewallPolicyUUID())) {
-                throw new BadRequestException("Firewall Policy UUID already exists");
-            }
-            firewallPolicyInterface.addNeutronFirewallPolicy(singleton);
-
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                        int status = service.canCreateNeutronFirewallPolicy(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            firewallPolicyInterface.addNeutronFirewallPolicy(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                    service.neutronFirewallPolicyCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronFirewallPolicy> bulk = input.getBulk();
-            Iterator<NeutronFirewallPolicy> i = bulk.iterator();
-            HashMap<String, NeutronFirewallPolicy> testMap = new HashMap<String, NeutronFirewallPolicy>();
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-            while (i.hasNext()) {
-                NeutronFirewallPolicy test = i.next();
-
-                /*
-                 *  Verify that the firewall policy doesn't already exist
-                 */
-
-                if (firewallPolicyInterface.neutronFirewallPolicyExists(test.getFirewallPolicyUUID())) {
-                    throw new BadRequestException("Firewall Policy UUID already is already created");
-                }
-                if (testMap.containsKey(test.getFirewallPolicyUUID())) {
-                    throw new BadRequestException("Firewall Policy UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                            int status = service.canCreateNeutronFirewallPolicy(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronFirewallPolicy test = i.next();
-                firewallPolicyInterface.addNeutronFirewallPolicy(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                        service.neutronFirewallPolicyCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Firewall Policy
-     */
-    @Path("{firewallPolicyUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateFirewallPolicy(
-            @PathParam("firewallPolicyUUID") String firewallPolicyUUID, final NeutronFirewallPolicyRequest input) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall Policy exists and there is only one delta provided
-         */
-        if (!firewallPolicyInterface.neutronFirewallPolicyExists(firewallPolicyUUID)) {
-            throw new ResourceNotFoundException("Firewall Policy UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronFirewallPolicy delta = input.getSingleton();
-        NeutronFirewallPolicy original = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getFirewallPolicyUUID() != null ||
-                delta.getFirewallPolicyTenantID() != null ||
-                delta.getFirewallPolicyName() != null ||
-                delta.getFirewallPolicyDescription() != null ||
-                delta.getFirewallPolicyIsShared() != null ||
-                delta.getFirewallPolicyRules().size() > 0 ||
-                delta.getFirewallPolicyIsAudited() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                    int status = service.canUpdateNeutronFirewallPolicy(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        firewallPolicyInterface.updateNeutronFirewallPolicy(firewallPolicyUUID, delta);
-        NeutronFirewallPolicy updatedFirewallPolicy = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                service.neutronFirewallPolicyUpdated(updatedFirewallPolicy);
-            }
-        }
-        return Response.status(200).entity(new NeutronFirewallPolicyRequest(firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID))).build();
-    }
-
-    /**
-     * Deletes a Firewall Policy */
-
-    @Path("{firewallPolicyUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteFirewallPolicy(
-            @PathParam("firewallPolicyUUID") String firewallPolicyUUID) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall Policy exists and it isn't currently in use
-         */
-        if (!firewallPolicyInterface.neutronFirewallPolicyExists(firewallPolicyUUID)) {
-            throw new ResourceNotFoundException("Firewall Policy UUID does not exist.");
-        }
-        if (firewallPolicyInterface.neutronFirewallPolicyInUse(firewallPolicyUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronFirewallPolicy singleton = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                    int status = service.canDeleteNeutronFirewallPolicy(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        firewallPolicyInterface.removeNeutronFirewallPolicy(firewallPolicyUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                service.neutronFirewallPolicyDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyRequest.java
deleted file mode 100644 (file)
index 473846a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.opendaylight.controller.networkconfig.neutron.NeutronFirewallPolicy;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallPolicyRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="firewall_policy")
-    NeutronFirewallPolicy singletonFirewallPolicy;
-
-    @XmlElement(name="firewall_policies")
-    List<NeutronFirewallPolicy> bulkRequest;
-
-    NeutronFirewallPolicyRequest() {
-    }
-
-    NeutronFirewallPolicyRequest(List<NeutronFirewallPolicy> bulk) {
-        bulkRequest = bulk;
-        singletonFirewallPolicy = null;
-    }
-
-    NeutronFirewallPolicyRequest(NeutronFirewallPolicy group) {
-        singletonFirewallPolicy = group;
-    }
-
-    public List<NeutronFirewallPolicy> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewallPolicy getSingleton() {
-        return singletonFirewallPolicy;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewallPolicy != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRequest.java
deleted file mode 100644 (file)
index 11a7836..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.opendaylight.controller.networkconfig.neutron.NeutronFirewall;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="firewall")
-    NeutronFirewall singletonFirewall;
-
-    @XmlElement(name="firewalls")
-    List<NeutronFirewall> bulkRequest;
-
-    NeutronFirewallRequest() {
-    }
-
-    NeutronFirewallRequest(List<NeutronFirewall> bulk) {
-        bulkRequest = bulk;
-        singletonFirewall = null;
-    }
-
-    NeutronFirewallRequest(NeutronFirewall group) {
-        singletonFirewall = group;
-    }
-
-    public List<NeutronFirewall> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewall getSingleton() {
-        return singletonFirewall;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewall != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRuleRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRuleRequest.java
deleted file mode 100644 (file)
index 19e67dd..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallRuleRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="firewall_rule")
-    NeutronFirewallRule singletonFirewallRule;
-
-    @XmlElement(name="firewall_rules")
-    List<NeutronFirewallRule> bulkRequest;
-
-    NeutronFirewallRuleRequest() {
-    }
-
-    NeutronFirewallRuleRequest(List<NeutronFirewallRule> bulk) {
-        bulkRequest = bulk;
-        singletonFirewallRule = null;
-    }
-
-    NeutronFirewallRuleRequest(NeutronFirewallRule group) {
-        singletonFirewallRule = group;
-    }
-
-    public List<NeutronFirewallRule> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewallRule getSingleton() {
-        return singletonFirewallRule;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewallRule != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java
deleted file mode 100644 (file)
index 40b830d..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule;
-
-/**
- * Neutron Northbound REST APIs for Firewall Rule.<br>
- * This class provides REST APIs for managing neutron Firewall Rule
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- */
-
-@Path("fw/firewalls_rules")
-public class NeutronFirewallRulesNorthbound {
-
-    private NeutronFirewallRule extractFields(NeutronFirewallRule o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Firewall Rules
-     */
-    @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response listRules(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack firewall rule attributes
-            @QueryParam("id") String queryFirewallRuleUUID,
-            @QueryParam("tenant_id") String queryFirewallRuleTenantID,
-            @QueryParam("name") String queryFirewallRuleName,
-            @QueryParam("description") String queryFirewallRuleDescription,
-            @QueryParam("admin_state_up") Boolean queryFirewallRuleAdminStateIsUp,
-            @QueryParam("status") String queryFirewallRuleStatus,
-            @QueryParam("shared") Boolean queryFirewallRuleIsShared,
-            @QueryParam("firewall_policy_id") String queryFirewallRulePolicyID,
-            @QueryParam("protocol") String queryFirewallRuleProtocol,
-            @QueryParam("ip_version") Integer queryFirewallRuleIpVer,
-            @QueryParam("source_ip_address") String queryFirewallRuleSrcIpAddr,
-            @QueryParam("destination_ip_address") String queryFirewallRuleDstIpAddr,
-            @QueryParam("source_port") Integer queryFirewallRuleSrcPort,
-            @QueryParam("destination_port") Integer queryFirewallRuleDstPort,
-            @QueryParam("position") Integer queryFirewallRulePosition,
-            @QueryParam("action") String queryFirewallRuleAction,
-            @QueryParam("enabled") Boolean queryFirewallRuleIsEnabled,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFirewallRule> allFirewallRules = firewallRuleInterface.getAllNeutronFirewallRules();
-        List<NeutronFirewallRule> ans = new ArrayList<NeutronFirewallRule>();
-        Iterator<NeutronFirewallRule> i = allFirewallRules.iterator();
-        while (i.hasNext()) {
-            NeutronFirewallRule nsr = i.next();
-            if ((queryFirewallRuleUUID == null ||
-                    queryFirewallRuleUUID.equals(nsr.getFirewallRuleUUID())) &&
-                    (queryFirewallRuleTenantID == null ||
-                            queryFirewallRuleTenantID.equals(nsr.getFirewallRuleTenantID())) &&
-                    (queryFirewallRuleName == null ||
-                            queryFirewallRuleName.equals(nsr.getFirewallRuleName())) &&
-                    (queryFirewallRuleDescription == null ||
-                            queryFirewallRuleDescription.equals(nsr.getFirewallRuleDescription())) &&
-                    (queryFirewallRuleAdminStateIsUp == null ||
-                            queryFirewallRuleAdminStateIsUp.equals(nsr.getFirewallRuleAdminStateIsUp())) &&
-                    (queryFirewallRuleStatus == null ||
-                            queryFirewallRuleStatus.equals(nsr.getFirewallRuleStatus())) &&
-                    (queryFirewallRuleIsShared == null ||
-                            queryFirewallRuleIsShared.equals(nsr.getFirewallRuleIsShared())) &&
-                    (queryFirewallRulePolicyID == null ||
-                            queryFirewallRulePolicyID.equals(nsr.getFirewallRulePolicyID())) &&
-                    (queryFirewallRuleProtocol == null ||
-                            queryFirewallRuleProtocol.equals(nsr.getFirewallRuleProtocol())) &&
-                    (queryFirewallRuleIpVer == null ||
-                            queryFirewallRuleIpVer.equals(nsr.getFirewallRuleIpVer())) &&
-                    (queryFirewallRuleSrcIpAddr == null ||
-                            queryFirewallRuleSrcIpAddr.equals(nsr.getFirewallRuleSrcIpAddr())) &&
-                    (queryFirewallRuleDstIpAddr == null ||
-                            queryFirewallRuleDstIpAddr.equals(nsr.getFirewallRuleDstIpAddr())) &&
-                    (queryFirewallRuleSrcPort == null ||
-                            queryFirewallRuleSrcPort.equals(nsr.getFirewallRuleSrcPort())) &&
-                    (queryFirewallRuleDstPort == null ||
-                            queryFirewallRuleDstPort.equals(nsr.getFirewallRuleDstPort())) &&
-                    (queryFirewallRulePosition == null ||
-                            queryFirewallRulePosition.equals(nsr.getFirewallRulePosition())) &&
-                    (queryFirewallRuleAction == null ||
-                            queryFirewallRuleAction.equals(nsr.getFirewallRuleAction())) &&
-                    (queryFirewallRuleIsEnabled == null ||
-                            queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsr, fields));
-                } else {
-                    ans.add(nsr);
-                }
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFirewallRuleRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Firewall Rule
-     */
-
-    @Path("{firewallRuleUUID}")
-    @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response showFirewallRule(@PathParam("firewallRuleUUID") String firewallRuleUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!firewallRuleInterface.neutronFirewallRuleExists(firewallRuleUUID)) {
-            throw new ResourceNotFoundException("Firewall Rule UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronFirewallRule ans = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-            return Response.status(200).entity(
-                    new NeutronFirewallRuleRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200)
-                    .entity(new NeutronFirewallRuleRequest(
-                            firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID)))
-                    .build();
-        }
-    }
-
-    /**
-     * Creates new Firewall Rule
-     */
-
-    @POST
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response createFirewallRules(final NeutronFirewallRuleRequest input) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        if (input.isSingleton()) {
-            NeutronFirewallRule singleton = input.getSingleton();
-            if (firewallRuleInterface.neutronFirewallRuleExists(singleton.getFirewallRuleUUID())) {
-                throw new BadRequestException("Firewall Rule UUID already exists");
-            }
-            firewallRuleInterface.addNeutronFirewallRule(singleton);
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                        int status = service.canCreateNeutronFirewallRule(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            // add rule to cache
-            singleton.initDefaults();
-            firewallRuleInterface.addNeutronFirewallRule(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                    service.neutronFirewallRuleCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronFirewallRule> bulk = input.getBulk();
-            Iterator<NeutronFirewallRule> i = bulk.iterator();
-            HashMap<String, NeutronFirewallRule> testMap = new HashMap<String, NeutronFirewallRule>();
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-            while (i.hasNext()) {
-                NeutronFirewallRule test = i.next();
-
-                /*
-                 *  Verify that the Firewall rule doesn't already exist
-                 */
-
-                if (firewallRuleInterface.neutronFirewallRuleExists(test.getFirewallRuleUUID())) {
-                    throw new BadRequestException("Firewall Rule UUID already exists");
-                }
-                if (testMap.containsKey(test.getFirewallRuleUUID())) {
-                    throw new BadRequestException("Firewall Rule UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                            int status = service.canCreateNeutronFirewallRule(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronFirewallRule test = i.next();
-                firewallRuleInterface.addNeutronFirewallRule(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                        service.neutronFirewallRuleCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Firewall Rule
-     */
-    @Path("{firewallRuleUUID}")
-    @PUT
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response updateFirewallRule(
-            @PathParam("firewallRuleUUID") String firewallRuleUUID, final NeutronFirewallRuleRequest input) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        /*
-         * verify the Firewall Rule exists
-         */
-        if (!firewallRuleInterface.neutronFirewallRuleExists(firewallRuleUUID)) {
-            throw new ResourceNotFoundException("Firewall Rule UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronFirewallRule delta = input.getSingleton();
-        NeutronFirewallRule original = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-
-        /*
-         * updates restricted by Neutron
-         *
-         */
-        if (delta.getFirewallRuleUUID() != null ||
-                delta.getFirewallRuleTenantID() != null ||
-                delta.getFirewallRuleName() != null ||
-                delta.getFirewallRuleDescription() != null ||
-                delta.getFirewallRuleAdminStateIsUp() != null ||
-                delta.getFirewallRuleStatus() != null ||
-                delta.getFirewallRuleIsShared() != null ||
-                delta.getFirewallRulePolicyID() != null ||
-                delta.getFirewallRuleProtocol() != null ||
-                delta.getFirewallRuleIpVer() != null ||
-                delta.getFirewallRuleSrcIpAddr() != null ||
-                delta.getFirewallRuleDstIpAddr() != null ||
-                delta.getFirewallRuleSrcPort() != null ||
-                delta.getFirewallRuleDstPort() != null ||
-                delta.getFirewallRulePosition() != null ||
-                delta.getFirewallRuleAction() != null ||
-                delta.getFirewallRuleIsEnabled() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                    int status = service.canUpdateNeutronFirewallRule(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        firewallRuleInterface.updateNeutronFirewallRule(firewallRuleUUID, delta);
-        NeutronFirewallRule updatedFirewallRule = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                service.neutronFirewallRuleUpdated(updatedFirewallRule);
-            }
-        }
-        return Response.status(200)
-                .entity(new NeutronFirewallRuleRequest(firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID)))
-                .build();
-    }
-
-    /**
-     * Deletes a Firewall Rule
-     */
-
-    @Path("{firewallRuleUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response deleteFirewallRule(
-            @PathParam("firewallRuleUUID") String firewallRuleUUID) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall Rule exists and it isn't currently in use
-         */
-        if (!firewallRuleInterface.neutronFirewallRuleExists(firewallRuleUUID)) {
-            throw new ResourceNotFoundException("Firewall Rule UUID does not exist.");
-        }
-        if (firewallRuleInterface.neutronFirewallRuleInUse(firewallRuleUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronFirewallRule singleton = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                    int status = service.canDeleteNeutronFirewallRule(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        firewallRuleInterface.removeNeutronFirewallRule(firewallRuleUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                service.neutronFirewallRuleDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPRequest.java
deleted file mode 100644 (file)
index efb86e0..0000000
+++ /dev/null
@@ -1,52 +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 javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFloatingIPRequest {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="floatingip")
-    NeutronFloatingIP singletonFloatingIP;
-
-    @XmlElement(name="floatingips")
-    List<NeutronFloatingIP> bulkRequest;
-
-    NeutronFloatingIPRequest() {
-    }
-
-    NeutronFloatingIPRequest(List<NeutronFloatingIP> bulk) {
-        bulkRequest = bulk;
-        singletonFloatingIP = null;
-    }
-
-    NeutronFloatingIPRequest(NeutronFloatingIP singleton) {
-        bulkRequest = null;
-        singletonFloatingIP = singleton;
-    }
-
-    public NeutronFloatingIP getSingleton() {
-        return singletonFloatingIP;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFloatingIP != null);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java
deleted file mode 100644 (file)
index 3e6c2a4..0000000
+++ /dev/null
@@ -1,443 +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.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPAware;
-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;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;
-
-/**
- * Neutron Northbound REST APIs.<br>
- * This class provides REST APIs for managing Neutron Floating IPs
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-@Path("/floatingips")
-public class NeutronFloatingIPsNorthbound {
-
-    private NeutronFloatingIP extractFields(NeutronFloatingIP o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all FloatingIPs */
-
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response listFloatingIPs(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // note: openstack isn't clear about filtering on lists, so we aren't handling them
-            @QueryParam("id") String queryID,
-            @QueryParam("floating_network_id") String queryFloatingNetworkId,
-            @QueryParam("port_id") String queryPortId,
-            @QueryParam("fixed_ip_address") String queryFixedIPAddress,
-            @QueryParam("floating_ip_address") String queryFloatingIPAddress,
-            @QueryParam("tenant_id") String queryTenantID,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-            ) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFloatingIP> allFloatingIPs = floatingIPInterface.getAllFloatingIPs();
-        List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
-        Iterator<NeutronFloatingIP> i = allFloatingIPs.iterator();
-        while (i.hasNext()) {
-            NeutronFloatingIP oSS = i.next();
-            //match filters: TODO provider extension and router extension
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID())) &&
-                    (queryPortId == null || queryPortId.equals(oSS.getPortUUID())) &&
-                    (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress())) &&
-                    (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantUUID()))) {
-                if (fields.size() > 0)
-                    ans.add(extractFields(oSS,fields));
-                else
-                    ans.add(oSS);
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFloatingIPRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific FloatingIP */
-
-    @Path("{floatingipUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields ) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!floatingIPInterface.floatingIPExists(floatingipUUID))
-            throw new ResourceNotFoundException("Floating IP UUID doesn't exist.");
-        if (fields.size() > 0) {
-            NeutronFloatingIP ans = floatingIPInterface.getFloatingIP(floatingipUUID);
-            return Response.status(200).entity(
-                    new NeutronFloatingIPRequest(extractFields(ans, fields))).build();
-        } else
-            return Response.status(200).entity(
-                    new NeutronFloatingIPRequest(floatingIPInterface.getFloatingIP(floatingipUUID))).build();
-
-    }
-
-    /**
-     * Creates new FloatingIPs */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = 201, condition = "Created"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 409, condition = "Conflict"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createFloatingIPs(final NeutronFloatingIPRequest input) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD( this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronFloatingIP singleton = input.getSingleton();
-            // check existence of id in cache and return badrequest if exists
-            if (floatingIPInterface.floatingIPExists(singleton.getID()))
-                throw new BadRequestException("Floating IP UUID already exists.");
-            // check if the external network is specified, exists, and is an external network
-            String externalNetworkUUID = singleton.getFloatingNetworkUUID();
-            if (externalNetworkUUID == null)
-                throw new BadRequestException("external network UUID doesn't exist.");
-            if (!networkInterface.networkExists(externalNetworkUUID))
-                throw new BadRequestException("external network UUID doesn't exist.");
-            NeutronNetwork externNetwork = networkInterface.getNetwork(externalNetworkUUID);
-            if (!externNetwork.isRouterExternal())
-                throw new BadRequestException("external network isn't marked router:external");
-            // if floating IP is specified, make sure it can come from the network
-            String floatingIP = singleton.getFloatingIPAddress();
-            if (floatingIP != null) {
-                if (externNetwork.getSubnets().size() != 1)
-                    throw new BadRequestException("external network doesn't have a subnet");
-                NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0));
-                if (!externSubnet.isValidIP(floatingIP))
-                    throw new BadRequestException("external IP isn't valid for the specified subnet.");
-                if (externSubnet.isIPInUse(floatingIP))
-                    throw new ResourceConflictException("floating IP is in use.");
-            }
-            // if port_id is specified, then check that the port exists and has at least one IP
-            String port_id = singleton.getPortUUID();
-            if (port_id != null) {
-                String fixedIP = null;        // used for the fixedIP calculation
-                if (!portInterface.portExists(port_id))
-                    throw new ResourceNotFoundException("Port UUID doesn't exist.");
-                NeutronPort port = portInterface.getPort(port_id);
-                if (port.getFixedIPs().size() < 1)
-                    throw new BadRequestException("port UUID doesn't have an IP address.");
-                // if there is more than one fixed IP then check for fixed_ip_address
-                // and that it is in the list of port addresses
-                if (port.getFixedIPs().size() > 1) {
-                    fixedIP = singleton.getFixedIPAddress();
-                    if (fixedIP == null)
-                        throw new BadRequestException("fixed IP address doesn't exist.");
-                    Iterator<Neutron_IPs> i = port.getFixedIPs().iterator();
-                    boolean validFixedIP = false;
-                    while (i.hasNext() && !validFixedIP) {
-                        Neutron_IPs ip = i.next();
-                        if (ip.getIpAddress().equals(fixedIP))
-                            validFixedIP = true;
-                    }
-                    if (!validFixedIP)
-                        throw new BadRequestException("can't find a valid fixed IP address");
-                } else {
-                    fixedIP = port.getFixedIPs().get(0).getIpAddress();
-                    if (singleton.getFixedIPAddress() != null && !fixedIP.equalsIgnoreCase(singleton.getFixedIPAddress()))
-                        throw new BadRequestException("mismatched fixed IP address in request");
-                }
-                //lastly check that this fixed IP address isn't already used
-                if (port.isBoundToFloatingIP(fixedIP))
-                    throw new ResourceConflictException("fixed IP is in use.");
-                singleton.setFixedIPAddress(fixedIP);
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronFloatingIPAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                        int status = service.canCreateFloatingIP(singleton);
-                        if (status < 200 || status > 299)
-                            return Response.status(status).build();
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            floatingIPInterface.addFloatingIP(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                    service.neutronFloatingIPCreated(singleton);
-                }
-            }
-        } else {
-            throw new BadRequestException("only singleton requests allowed.");
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a FloatingIP */
-
-    @Path("{floatingipUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID,
-            NeutronFloatingIPRequest input
-            ) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD( this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!floatingIPInterface.floatingIPExists(floatingipUUID))
-            throw new ResourceNotFoundException("Floating IP UUID doesn't exist.");
-
-        NeutronFloatingIP sourceFloatingIP = floatingIPInterface.getFloatingIP(floatingipUUID);
-        if (!input.isSingleton())
-            throw new BadRequestException("only singleton requests allowed.");
-        NeutronFloatingIP singleton = input.getSingleton();
-        if (singleton.getID() == null)
-            throw new BadRequestException("singleton UUID doesn't exist.");
-
-        NeutronNetwork externNetwork = networkInterface.getNetwork(
-                sourceFloatingIP.getFloatingNetworkUUID());
-
-        // if floating IP is specified, make sure it can come from the network
-        String floatingIP = singleton.getFloatingIPAddress();
-        if (floatingIP != null) {
-            if (externNetwork.getSubnets().size() != 1)
-                throw new BadRequestException("external network doesn't have a subnet.");
-            NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0));
-            if (!externSubnet.isValidIP(floatingIP))
-                throw new BadRequestException("floating IP not valid for external subnet");
-            if (externSubnet.isIPInUse(floatingIP))
-                throw new ResourceConflictException("floating IP is in use.");
-        }
-
-        // if port_id is specified, then check that the port exists and has at least one IP
-        String port_id = singleton.getPortUUID();
-        if (port_id != null) {
-            String fixedIP = null;        // used for the fixedIP calculation
-            if (!portInterface.portExists(port_id))
-                throw new ResourceNotFoundException("Port UUID doesn't exist.");
-            NeutronPort port = portInterface.getPort(port_id);
-            if (port.getFixedIPs().size() < 1)
-                throw new BadRequestException("port ID doesn't have a fixed IP address.");
-            // if there is more than one fixed IP then check for fixed_ip_address
-            // and that it is in the list of port addresses
-            if (port.getFixedIPs().size() > 1) {
-                fixedIP = singleton.getFixedIPAddress();
-                if (fixedIP == null)
-                    throw new BadRequestException("request doesn't have a fixed IP address");
-                Iterator<Neutron_IPs> i = port.getFixedIPs().iterator();
-                boolean validFixedIP = false;
-                while (i.hasNext() && !validFixedIP) {
-                    Neutron_IPs ip = i.next();
-                    if (ip.getIpAddress().equals(fixedIP))
-                        validFixedIP = true;
-                }
-                if (!validFixedIP)
-                    throw new BadRequestException("couldn't find a valid fixed IP address");
-            } else {
-                fixedIP = port.getFixedIPs().get(0).getIpAddress();
-                if (singleton.getFixedIPAddress() != null &&
-                        !fixedIP.equalsIgnoreCase(singleton.getFixedIPAddress()))
-                    throw new BadRequestException("mismatch in fixed IP addresses");
-            }
-            //lastly check that this fixed IP address isn't already used
-            if (port.isBoundToFloatingIP(fixedIP))
-                throw new ResourceConflictException("fixed IP is in use.");
-            singleton.setFixedIPAddress(fixedIP);
-        }
-        NeutronFloatingIP target = floatingIPInterface.getFloatingIP(floatingipUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFloatingIPAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                    int status = service.canUpdateFloatingIP(singleton, target);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        floatingIPInterface.updateFloatingIP(floatingipUUID, singleton);
-        target = floatingIPInterface.getFloatingIP(floatingipUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                service.neutronFloatingIPUpdated(target);
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronFloatingIPRequest(target)).build();
-
-    }
-
-    /**
-     * Deletes a FloatingIP */
-
-    @Path("{floatingipUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!floatingIPInterface.floatingIPExists(floatingipUUID))
-            throw new ResourceNotFoundException("Floating IP UUID doesn't exist.");
-        // TODO: need to undo port association if it exists
-        NeutronFloatingIP singleton = floatingIPInterface.getFloatingIP(floatingipUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFloatingIPAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                    int status = service.canDeleteFloatingIP(singleton);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        floatingIPInterface.removeFloatingIP(floatingipUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                service.neutronFloatingIPDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorNorthbound.java
deleted file mode 100644 (file)
index aa30e94..0000000
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerHealthMonitor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Neutron Northbound REST APIs for Load Balancer HealthMonitor.<br>
- * This class provides REST APIs for managing neutron LoadBalancerHealthMonitor
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/healthmonitors")
-public class NeutronLoadBalancerHealthMonitorNorthbound {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancer.class);
-
-    private NeutronLoadBalancerHealthMonitor extractFields(NeutronLoadBalancerHealthMonitor o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancerHealthMonitor */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancerHealthMonitor attributes
-            @QueryParam("id") String queryLoadBalancerHealthMonitorID,
-            @QueryParam("tenant_id") String queryLoadBalancerHealthMonitorTenantID,
-            // TODO "type" is being a property by the JSON parser.
-            @QueryParam("type") String queryLoadBalancerHealthMonitorType,
-            @QueryParam("delay") Integer queryLoadBalancerHealthMonitorDelay,
-            @QueryParam("timeout") Integer queryLoadBalancerHealthMonitorTimeout,
-            @QueryParam("max_retries") Integer queryLoadBalancerHealthMonitorMaxRetries,
-            @QueryParam("http_method") String queryLoadBalancerHealthMonitorHttpMethod,
-            @QueryParam("url_path") String queryLoadBalancerHealthMonitorUrlPath,
-            @QueryParam("expected_codes") String queryLoadBalancerHealthMonitorExpectedCodes,
-            @QueryParam("admin_state_up") Boolean queryLoadBalancerHealthMonitorIsAdminStateUp,
-            @QueryParam("status") String queryLoadBalancerHealthMonitorStatus,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces
-                .getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = loadBalancerHealthMonitorInterface.getAllNeutronLoadBalancerHealthMonitors();
-        List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<NeutronLoadBalancerHealthMonitor>();
-        Iterator<NeutronLoadBalancerHealthMonitor> i = allLoadBalancerHealthMonitors.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerHealthMonitor nsg = i.next();
-            if ((queryLoadBalancerHealthMonitorID == null ||
-                    queryLoadBalancerHealthMonitorID.equals(nsg.getLoadBalancerHealthMonitorID())) &&
-                    (queryLoadBalancerHealthMonitorTenantID == null ||
-                            queryLoadBalancerHealthMonitorTenantID.equals
-                                    (nsg.getLoadBalancerHealthMonitorTenantID())) &&
-                    (queryLoadBalancerHealthMonitorType == null ||
-                            queryLoadBalancerHealthMonitorType.equals
-                                    (nsg.getLoadBalancerHealthMonitorType())) &&
-                    (queryLoadBalancerHealthMonitorDelay == null ||
-                            queryLoadBalancerHealthMonitorDelay.equals
-                                    (nsg.getLoadBalancerHealthMonitorDelay())) &&
-                    (queryLoadBalancerHealthMonitorTimeout == null ||
-                            queryLoadBalancerHealthMonitorTimeout.equals
-                                    (nsg.getLoadBalancerHealthMonitorTimeout())) &&
-                    (queryLoadBalancerHealthMonitorMaxRetries == null ||
-                            queryLoadBalancerHealthMonitorMaxRetries.equals
-                                    (nsg.getLoadBalancerHealthMonitorMaxRetries())) &&
-                    (queryLoadBalancerHealthMonitorHttpMethod == null ||
-                            queryLoadBalancerHealthMonitorHttpMethod.equals
-                                    (nsg.getLoadBalancerHealthMonitorHttpMethod())) &&
-                    (queryLoadBalancerHealthMonitorUrlPath == null ||
-                            queryLoadBalancerHealthMonitorUrlPath.equals
-                                    (nsg.getLoadBalancerHealthMonitorUrlPath())) &&
-                    (queryLoadBalancerHealthMonitorExpectedCodes == null ||
-                            queryLoadBalancerHealthMonitorExpectedCodes.equals
-                                    (nsg.getLoadBalancerHealthMonitorExpectedCodes())) &&
-                    (queryLoadBalancerHealthMonitorIsAdminStateUp == null ||
-                            queryLoadBalancerHealthMonitorIsAdminStateUp.equals
-                                    (nsg.getLoadBalancerHealthMonitorAdminStateIsUp())) &&
-                    (queryLoadBalancerHealthMonitorStatus == null ||
-                            queryLoadBalancerHealthMonitorStatus.equals
-                                    (nsg.getLoadBalancerHealthMonitorStatus()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerHealthMonitorRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancerHealthMonitor */
-
-    @Path("{loadBalancerHealthMonitorID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancerHealthMonitor(@PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorID)) {
-            throw new ResourceNotFoundException("LoadBalancerHealthMonitor UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancerHealthMonitor ans = loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerHealthMonitorRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerHealthMonitorRequest(loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancerHealthMonitor */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancerHealthMonitors(final NeutronLoadBalancerHealthMonitorRequest input) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancerHealthMonitor singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancerHealthMonitor doesn't already exist.
-             */
-            if (loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(singleton.getLoadBalancerHealthMonitorID())) {
-                throw new BadRequestException("LoadBalancerHealthMonitor UUID already exists");
-            }
-            loadBalancerHealthMonitorInterface.addNeutronLoadBalancerHealthMonitor(singleton);
-
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerHealthMonitor(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            loadBalancerHealthMonitorInterface.addNeutronLoadBalancerHealthMonitor(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                    service.neutronLoadBalancerHealthMonitorCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancerHealthMonitor> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancerHealthMonitor> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancerHealthMonitor> testMap = new HashMap<String, NeutronLoadBalancerHealthMonitor>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancerHealthMonitor test = i.next();
-
-                /*
-                 *  Verify that the firewall policy doesn't already exist
-                 */
-
-                if (loadBalancerHealthMonitorInterface
-                        .neutronLoadBalancerHealthMonitorExists(test.getLoadBalancerHealthMonitorID())) {
-                    throw new BadRequestException("LoadBalancerHealthMonitor UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerHealthMonitorID())) {
-                    throw new BadRequestException("LoadBalancerHealthMonitor UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                            int status = service.canCreateNeutronLoadBalancerHealthMonitor(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancerHealthMonitor test = i.next();
-                loadBalancerHealthMonitorInterface.addNeutronLoadBalancerHealthMonitor(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                        service.neutronLoadBalancerHealthMonitorCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancerHealthMonitor Policy
-     */
-    @Path("{loadBalancerHealthMonitorID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancerHealthMonitor(
-            @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
-            final NeutronLoadBalancerHealthMonitorRequest input) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces
-                .getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerHealthMonitor exists and there is only one delta provided
-         */
-        if (!loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorID)) {
-            throw new ResourceNotFoundException("LoadBalancerHealthMonitor UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancerHealthMonitor delta = input.getSingleton();
-        NeutronLoadBalancerHealthMonitor original = loadBalancerHealthMonitorInterface
-                .getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerHealthMonitorID() != null ||
-                delta.getLoadBalancerHealthMonitorTenantID() != null ||
-                delta.getLoadBalancerHealthMonitorType() != null ||
-                delta.getLoadBalancerHealthMonitorDelay() != null ||
-                delta.getLoadBalancerHealthMonitorTimeout() != null ||
-                delta.getLoadBalancerHealthMonitorMaxRetries() != null ||
-                delta.getLoadBalancerHealthMonitorHttpMethod() != null ||
-                delta.getLoadBalancerHealthMonitorUrlPath() != null ||
-                delta.getLoadBalancerHealthMonitorExpectedCodes() != null ||
-                delta.getLoadBalancerHealthMonitorAdminStateIsUp() != null ||
-                delta.getLoadBalancerHealthMonitorStatus() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancerHealthMonitor(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerHealthMonitorInterface.updateNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID, delta);
-        NeutronLoadBalancerHealthMonitor updatedLoadBalancerHealthMonitor = loadBalancerHealthMonitorInterface
-                .getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                service.neutronLoadBalancerHealthMonitorUpdated(updatedLoadBalancerHealthMonitor);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerHealthMonitorRequest
-                (loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor
-                        (loadBalancerHealthMonitorID))).build();
-    }
-
-
-
-    /**
-     * Deletes a LoadBalancerHealthMonitor
-     * */
-    @Path("{loadBalancerHealthMonitorID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancerHealthMonitor(
-            @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        /*
-         * verify the LoadBalancerHealthMonitor exists and it isn't currently in use
-         */
-        if (!loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorID)) {
-            throw new ResourceNotFoundException("LoadBalancerHealthMonitor UUID does not exist.");
-        }
-        if (loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorInUse(loadBalancerHealthMonitorID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancerHealthMonitor singleton = loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancerHealthMonitor(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        loadBalancerHealthMonitorInterface.removeNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                service.neutronLoadBalancerHealthMonitorDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorRequest.java
deleted file mode 100644 (file)
index dc4af2f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerHealthMonitor;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerHealthMonitorRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="healthmonitor")
-    NeutronLoadBalancerHealthMonitor singletonLoadBalancerHealthMonitor;
-
-    @XmlElement(name="healthmonitors")
-    List<NeutronLoadBalancerHealthMonitor> bulkRequest;
-
-    NeutronLoadBalancerHealthMonitorRequest() {
-    }
-
-    NeutronLoadBalancerHealthMonitorRequest(List<NeutronLoadBalancerHealthMonitor> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerHealthMonitor = null;
-    }
-
-    NeutronLoadBalancerHealthMonitorRequest(NeutronLoadBalancerHealthMonitor group) {
-        singletonLoadBalancerHealthMonitor = group;
-    }
-
-    public List<NeutronLoadBalancerHealthMonitor> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerHealthMonitor getSingleton() {
-        return singletonLoadBalancerHealthMonitor;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerHealthMonitor != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerNorthbound.java
deleted file mode 100644 (file)
index 5d877c5..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerListener;
-
-/**
- * Neutron Northbound REST APIs for LoadBalancerListener Policies.<br>
- * This class provides REST APIs for managing neutron LoadBalancerListener Policies
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/listeners")
-public class NeutronLoadBalancerListenerNorthbound {
-
-    private NeutronLoadBalancerListener extractFields(NeutronLoadBalancerListener o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancerListener */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancerListener attributes
-            @QueryParam("id") String queryLoadBalancerListenerID,
-            @QueryParam("default_pool_id") String queryLoadBalancerListenerDefaultPoolID,
-            @QueryParam("tenant_id") String queryLoadBalancerListenerTenantID,
-            @QueryParam("name") String queryLoadBalancerListenerName,
-            @QueryParam("description") String queryLoadBalancerListenerDescription,
-            @QueryParam("shared") String queryLoadBalancerListenerIsShared,
-            @QueryParam("protocol") String queryLoadBalancerListenerProtocol,
-            @QueryParam("protocol_port") String queryLoadBalancerListenerProtocolPort,
-            @QueryParam("load_balancer_id") String queryLoadBalancerListenerLoadBalancerID,
-            @QueryParam("admin_state_up") String queryLoadBalancerListenerAdminIsUp,
-            @QueryParam("status") String queryLoadBalancerListenerStatus,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        //        INeutronLoadBalancerListenerRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerRuleCRUD(this);
-
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancerListener> allLoadBalancerListeners = loadBalancerListenerInterface.getAllNeutronLoadBalancerListeners();
-        //        List<NeutronLoadBalancerListenerRule> allLoadBalancerListenerRules = firewallRuleInterface.getAllNeutronLoadBalancerListenerRules();
-        List<NeutronLoadBalancerListener> ans = new ArrayList<NeutronLoadBalancerListener>();
-        //        List<NeutronLoadBalancerListenerRule> rules = new ArrayList<NeutronLoadBalancerListenerRule>();
-        Iterator<NeutronLoadBalancerListener> i = allLoadBalancerListeners.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerListener nsg = i.next();
-            if ((queryLoadBalancerListenerID == null ||
-                    queryLoadBalancerListenerID.equals(nsg.getLoadBalancerListenerID())) &&
-                    (queryLoadBalancerListenerDefaultPoolID == null ||
-                            queryLoadBalancerListenerDefaultPoolID.equals(nsg.getNeutronLoadBalancerListenerDefaultPoolID())) &&
-                    (queryLoadBalancerListenerTenantID == null ||
-                            queryLoadBalancerListenerTenantID.equals(nsg.getLoadBalancerListenerTenantID())) &&
-                    (queryLoadBalancerListenerName == null ||
-                            queryLoadBalancerListenerName.equals(nsg.getLoadBalancerListenerName())) &&
-                    (queryLoadBalancerListenerDescription == null ||
-                            queryLoadBalancerListenerDescription.equals(nsg.getLoadBalancerListenerDescription())) &&
-                    (queryLoadBalancerListenerIsShared == null ||
-                            queryLoadBalancerListenerIsShared.equals(nsg.getLoadBalancerListenerIsShared())) &&
-                    (queryLoadBalancerListenerProtocol == null ||
-                            queryLoadBalancerListenerProtocol.equals(nsg.getNeutronLoadBalancerListenerProtocol())) &&
-                    (queryLoadBalancerListenerProtocolPort == null ||
-                            queryLoadBalancerListenerProtocolPort.equals(nsg.getNeutronLoadBalancerListenerProtocolPort())) &&
-                    (queryLoadBalancerListenerLoadBalancerID == null ||
-                            queryLoadBalancerListenerLoadBalancerID.equals(nsg.getNeutronLoadBalancerListenerLoadBalancerID())) &&
-                    (queryLoadBalancerListenerAdminIsUp == null ||
-                            queryLoadBalancerListenerAdminIsUp.equals(nsg.getLoadBalancerListenerAdminStateIsUp())) &&
-                    (queryLoadBalancerListenerStatus == null ||
-                            queryLoadBalancerListenerStatus.equals(nsg.getLoadBalancerListenerStatus()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerListenerRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancerListener */
-
-    @Path("{loadBalancerListenerID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancerListener(@PathParam("loadBalancerListenerID") String loadBalancerListenerID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerListenerInterface.neutronLoadBalancerListenerExists(loadBalancerListenerID)) {
-            throw new ResourceNotFoundException("LoadBalancerListener UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancerListener ans = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerListenerRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerListenerRequest(loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancerListener */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancerListeners(final NeutronLoadBalancerListenerRequest input) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancerListener singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancerListener doesn't already exist.
-             */
-            if (loadBalancerListenerInterface.neutronLoadBalancerListenerExists(singleton.getLoadBalancerListenerID())) {
-                throw new BadRequestException("LoadBalancerListener UUID already exists");
-            }
-            loadBalancerListenerInterface.addNeutronLoadBalancerListener(singleton);
-
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerListener(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            loadBalancerListenerInterface.addNeutronLoadBalancerListener(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                    service.neutronLoadBalancerListenerCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancerListener> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancerListener> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancerListener> testMap = new HashMap<String, NeutronLoadBalancerListener>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancerListener test = i.next();
-
-                /*
-                 *  Verify that the firewall policy doesn't already exist
-                 */
-
-                if (loadBalancerListenerInterface.neutronLoadBalancerListenerExists(test.getLoadBalancerListenerID())) {
-                    throw new BadRequestException("LoadBalancerListener UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerListenerID())) {
-                    throw new BadRequestException("LoadBalancerListener UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                            int status = service.canCreateNeutronLoadBalancerListener(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancerListener test = i.next();
-                loadBalancerListenerInterface.addNeutronLoadBalancerListener(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                        service.neutronLoadBalancerListenerCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancerListener Policy
-     */
-    @Path("{loadBalancerListenerID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancerListener(
-            @PathParam("loadBalancerListenerID") String loadBalancerListenerID, final NeutronLoadBalancerListenerRequest input) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerListener exists and there is only one delta provided
-         */
-        if (!loadBalancerListenerInterface.neutronLoadBalancerListenerExists(loadBalancerListenerID)) {
-            throw new ResourceNotFoundException("LoadBalancerListener UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancerListener delta = input.getSingleton();
-        NeutronLoadBalancerListener original = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerListenerID() != null ||
-                delta.getNeutronLoadBalancerListenerDefaultPoolID() != null ||
-                delta.getLoadBalancerListenerTenantID() != null ||
-                delta.getLoadBalancerListenerName() != null ||
-                delta.getLoadBalancerListenerDescription() != null ||
-                delta.getLoadBalancerListenerIsShared() != null ||
-                delta.getNeutronLoadBalancerListenerProtocol() != null ||
-                delta.getNeutronLoadBalancerListenerProtocolPort() != null ||
-                delta.getNeutronLoadBalancerListenerLoadBalancerID() != null ||
-                delta.getLoadBalancerListenerAdminStateIsUp() != null ||
-                delta.getLoadBalancerListenerStatus() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancerListener(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerListenerInterface.updateNeutronLoadBalancerListener(loadBalancerListenerID, delta);
-        NeutronLoadBalancerListener updatedLoadBalancerListener = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                service.neutronLoadBalancerListenerUpdated(updatedLoadBalancerListener);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerListenerRequest(loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID))).build();
-    }
-
-    /**
-     * Deletes a LoadBalancerListener */
-
-    @Path("{loadBalancerListenerID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancerListener(
-            @PathParam("loadBalancerListenerID") String loadBalancerListenerID) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerListener exists and it isn't currently in use
-         */
-        if (!loadBalancerListenerInterface.neutronLoadBalancerListenerExists(loadBalancerListenerID)) {
-            throw new ResourceNotFoundException("LoadBalancerListener UUID does not exist.");
-        }
-        if (loadBalancerListenerInterface.neutronLoadBalancerListenerInUse(loadBalancerListenerID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancerListener singleton = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancerListener(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        loadBalancerListenerInterface.removeNeutronLoadBalancerListener(loadBalancerListenerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                service.neutronLoadBalancerListenerDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerRequest.java
deleted file mode 100644 (file)
index ba375af..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerListener;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerListenerRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="listener")
-    NeutronLoadBalancerListener singletonLoadBalancerListener;
-
-    @XmlElement(name="listeners")
-    List<NeutronLoadBalancerListener> bulkRequest;
-
-    NeutronLoadBalancerListenerRequest() {
-    }
-
-    NeutronLoadBalancerListenerRequest(List<NeutronLoadBalancerListener> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerListener = null;
-    }
-
-    NeutronLoadBalancerListenerRequest(NeutronLoadBalancerListener group) {
-        singletonLoadBalancerListener = group;
-    }
-
-    public List<NeutronLoadBalancerListener> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerListener getSingleton() {
-        return singletonLoadBalancerListener;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerListener != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerNorthbound.java
deleted file mode 100644 (file)
index 67557ce..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-
-/**
- * Neutron Northbound REST APIs for LoadBalancers.<br>
- * This class provides REST APIs for managing neutron LoadBalancers
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/loadbalancers")
-public class NeutronLoadBalancerNorthbound {
-
-    private NeutronLoadBalancer extractFields(NeutronLoadBalancer o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancer */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancer attributes
-            @QueryParam("id") String queryLoadBalancerID,
-            @QueryParam("tenant_id") String queryLoadBalancerTenantID,
-            @QueryParam("name") String queryLoadBalancerName,
-            @QueryParam("description") String queryLoadBalancerDescription,
-            @QueryParam("status") String queryLoadBalancerStatus,
-            @QueryParam("vip_address") String queryLoadBalancerVipAddress,
-            @QueryParam("vip_subnet") String queryLoadBalancerVipSubnet,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(this);
-
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancer> allLoadBalancers = loadBalancerInterface.getAllNeutronLoadBalancers();
-        //        List<NeutronLoadBalancerRule> allLoadBalancerRules = firewallRuleInterface.getAllNeutronLoadBalancerRules();
-        List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
-        //        List<NeutronLoadBalancerRule> rules = new ArrayList<NeutronLoadBalancerRule>();
-        Iterator<NeutronLoadBalancer> i = allLoadBalancers.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancer nsg = i.next();
-            if ((queryLoadBalancerID == null ||
-                    queryLoadBalancerID.equals(nsg.getLoadBalancerID())) &&
-                    (queryLoadBalancerTenantID == null ||
-                            queryLoadBalancerTenantID.equals(nsg.getLoadBalancerTenantID())) &&
-                    (queryLoadBalancerName == null ||
-                            queryLoadBalancerName.equals(nsg.getLoadBalancerName())) &&
-                    (queryLoadBalancerDescription == null ||
-                            queryLoadBalancerDescription.equals(nsg.getLoadBalancerDescription())) &&
-                    (queryLoadBalancerVipAddress == null ||
-                            queryLoadBalancerVipAddress.equals(nsg.getLoadBalancerVipAddress())) &&
-                    (queryLoadBalancerVipSubnet == null ||
-                            queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancer */
-
-    @Path("{loadBalancerID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerInterface.neutronLoadBalancerExists(loadBalancerID)) {
-            throw new ResourceNotFoundException("LoadBalancer UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancer ans = loadBalancerInterface.getNeutronLoadBalancer(loadBalancerID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerRequest(loadBalancerInterface.getNeutronLoadBalancer(
-                    loadBalancerID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancer */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancers(final NeutronLoadBalancerRequest input) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancer singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancer doesn't already exist.
-             */
-            if (loadBalancerInterface.neutronLoadBalancerExists(singleton.getLoadBalancerID())) {
-                throw new BadRequestException("LoadBalancer UUID already exists");
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                        int status = service.canCreateNeutronLoadBalancer(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            loadBalancerInterface.addNeutronLoadBalancer(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                    service.neutronLoadBalancerCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancer> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancer> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancer> testMap = new HashMap<String, NeutronLoadBalancer>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancer test = i.next();
-
-                /*
-                 *  Verify that the loadbalancer doesn't already exist
-                 */
-
-                if (loadBalancerInterface.neutronLoadBalancerExists(test.getLoadBalancerID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                            int status = service.canCreateNeutronLoadBalancer(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancer test = i.next();
-                loadBalancerInterface.addNeutronLoadBalancer(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                        service.neutronLoadBalancerCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancer Policy
-     */
-    @Path("{loadBalancerID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancer(
-            @PathParam("loadBalancerID") String loadBalancerID, final NeutronLoadBalancerRequest input) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancer exists and there is only one delta provided
-         */
-        if (!loadBalancerInterface.neutronLoadBalancerExists(loadBalancerID)) {
-            throw new ResourceNotFoundException("LoadBalancer UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancer delta = input.getSingleton();
-        NeutronLoadBalancer original = loadBalancerInterface.getNeutronLoadBalancer(loadBalancerID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerID() != null ||
-                delta.getLoadBalancerTenantID() != null ||
-                delta.getLoadBalancerName() != null ||
-                delta.getLoadBalancerDescription() != null ||
-                delta.getLoadBalancerStatus() != null ||
-                delta.getLoadBalancerVipAddress() != null ||
-                delta.getLoadBalancerVipSubnetID() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancer(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerInterface.updateNeutronLoadBalancer(loadBalancerID, delta);
-        NeutronLoadBalancer updatedLoadBalancer = loadBalancerInterface.getNeutronLoadBalancer(
-                loadBalancerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                service.neutronLoadBalancerUpdated(updatedLoadBalancer);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerRequest(loadBalancerInterface.getNeutronLoadBalancer(
-                loadBalancerID))).build();
-    }
-
-    /**
-     * Deletes a LoadBalancer */
-
-    @Path("{loadBalancerID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancer(
-            @PathParam("loadBalancerID") String loadBalancerID) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancer exists and it isn't currently in use
-         */
-        if (!loadBalancerInterface.neutronLoadBalancerExists(loadBalancerID)) {
-            throw new ResourceNotFoundException("LoadBalancer UUID does not exist.");
-        }
-        if (loadBalancerInterface.neutronLoadBalancerInUse(loadBalancerID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancer singleton = loadBalancerInterface.getNeutronLoadBalancer(loadBalancerID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancer(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-
-        loadBalancerInterface.removeNeutronLoadBalancer(loadBalancerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                service.neutronLoadBalancerDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMemberRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMemberRequest.java
deleted file mode 100644 (file)
index 9b949da..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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 org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-
-import javax.xml.bind.annotation.XmlElement;
-import java.util.List;
-
-public class NeutronLoadBalancerPoolMemberRequest {
-
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="member")
-    NeutronLoadBalancerPoolMember singletonLoadBalancerPoolMember;
-
-    @XmlElement(name="members")
-    List<NeutronLoadBalancerPoolMember> bulkRequest;
-
-    NeutronLoadBalancerPoolMemberRequest() {
-    }
-
-    NeutronLoadBalancerPoolMemberRequest(List<NeutronLoadBalancerPoolMember> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerPoolMember = null;
-    }
-
-    NeutronLoadBalancerPoolMemberRequest(NeutronLoadBalancerPoolMember group) {
-        singletonLoadBalancerPoolMember = group;
-    }
-
-    public List<NeutronLoadBalancerPoolMember> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerPoolMember getSingleton() {
-        return singletonLoadBalancerPoolMember;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerPoolMember != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMembersNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMembersNorthbound.java
deleted file mode 100644 (file)
index 22d118a..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (C) 2014 SDN Hub, LLC.
- *
- * 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
- *
- * Authors : Srini Seetharaman
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolMemberAware;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-
-@Path("/pools/{loadBalancerPoolUUID}/members")
-public class NeutronLoadBalancerPoolMembersNorthbound {
-    private NeutronLoadBalancerPoolMember extractFields(NeutronLoadBalancerPoolMember o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-/**
- * Returns a list of all LoadBalancerPoolMembers in specified pool
- */
-@GET
-@Produces({MediaType.APPLICATION_JSON})
-@StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 501, condition = "Not Implemented")})
-
-public Response listMembers(
-        //Path param
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-
-        // return fields
-        @QueryParam("fields") List<String> fields,
-
-        // OpenStack LoadBalancerPool attributes
-        @QueryParam("id") String queryLoadBalancerPoolMemberID,
-        @QueryParam("tenant_id") String queryLoadBalancerPoolMemberTenantID,
-        @QueryParam("address") String queryLoadBalancerPoolMemberAddress,
-        @QueryParam("protocol_port") String queryLoadBalancerPoolMemberProtoPort,
-        @QueryParam("admin_state_up") String queryLoadBalancerPoolMemberAdminStateUp,
-        @QueryParam("weight") String queryLoadBalancerPoolMemberWeight,
-        @QueryParam("subnet_id") String queryLoadBalancerPoolMemberSubnetID,
-        @QueryParam("status") String queryLoadBalancerPoolMemberStatus,
-
-        // pagination
-        @QueryParam("limit") String limit,
-        @QueryParam("marker") String marker,
-        @QueryParam("page_reverse") String pageReverse
-        // sorting not supported
-) {
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces
-            .getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-    List<NeutronLoadBalancerPoolMember> members =
-                loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-    List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
-    Iterator<NeutronLoadBalancerPoolMember> i = members.iterator();
-    while (i.hasNext()) {
-        NeutronLoadBalancerPoolMember nsg = i.next();
-        if ((queryLoadBalancerPoolMemberID == null ||
-                queryLoadBalancerPoolMemberID.equals(nsg.getPoolMemberID())) &&
-                loadBalancerPoolUUID.equals(nsg.getPoolID()) &&
-                (queryLoadBalancerPoolMemberTenantID == null ||
-                        queryLoadBalancerPoolMemberTenantID.equals(nsg.getPoolMemberTenantID())) &&
-                (queryLoadBalancerPoolMemberAddress == null ||
-                        queryLoadBalancerPoolMemberAddress.equals(nsg.getPoolMemberAddress())) &&
-                (queryLoadBalancerPoolMemberAdminStateUp == null ||
-                        queryLoadBalancerPoolMemberAdminStateUp.equals(nsg.getPoolMemberAdminStateIsUp())) &&
-                (queryLoadBalancerPoolMemberWeight == null ||
-                        queryLoadBalancerPoolMemberWeight.equals(nsg.getPoolMemberWeight())) &&
-                (queryLoadBalancerPoolMemberSubnetID == null ||
-                        queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID())) &&
-                (queryLoadBalancerPoolMemberStatus == null ||
-                        queryLoadBalancerPoolMemberStatus.equals(nsg.getPoolMemberStatus()))) {
-            if (fields.size() > 0) {
-                ans.add(extractFields(nsg, fields));
-            } else {
-                ans.add(nsg);
-            }
-        }
-    }
-    return Response.status(200).entity(
-            new NeutronLoadBalancerPoolMemberRequest(ans)).build();
-}
-
-/**
- * Returns a specific LoadBalancerPoolMember
- */
-
-@Path("{loadBalancerPoolMemberUUID}")
-@GET
-@Produces({ MediaType.APPLICATION_JSON })
-//@TypeHint(OpenStackLoadBalancerPoolMembers.class)
-@StatusCodes({
-    @ResponseCode(code = 200, condition = "Operation successful"),
-    @ResponseCode(code = 401, condition = "Unauthorized"),
-    @ResponseCode(code = 404, condition = "Not Found"),
-    @ResponseCode(code = 501, condition = "Not Implemented") })
-public Response showLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
-        // return fields
-        @QueryParam("fields") List<String> fields ) {
-
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces
-            .getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-    List<NeutronLoadBalancerPoolMember> members =
-                loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-    for (NeutronLoadBalancerPoolMember ans: members) {
-        if (!ans.getPoolMemberID().equals(loadBalancerPoolMemberUUID))
-            continue;
-
-        if (fields.size() > 0) {
-            return Response.status(200).entity(
-                new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(
-                new NeutronLoadBalancerPoolMemberRequest(ans)).build();
-        }
-    }
-    return Response.status(204).build();
-}
-
-/**
- * Adds a Member to an LBaaS Pool member
- */
-@PUT
-@Produces({MediaType.APPLICATION_JSON})
-@Consumes({MediaType.APPLICATION_JSON})
-@StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 501, condition = "Not Implemented")})
-public Response createLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        final NeutronLoadBalancerPoolMemberRequest input) {
-
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-    // Verify that the loadBalancerPool exists, for the member to be added to its cache
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-    NeutronLoadBalancerPool singletonPool = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID);
-
-    if (input.isSingleton()) {
-        NeutronLoadBalancerPoolMember singleton = input.getSingleton();
-        singleton.setPoolID(loadBalancerPoolUUID);
-        String loadBalancerPoolMemberUUID = singleton.getPoolMemberID();
-
-        /*
-         *  Verify that the LoadBalancerPoolMember doesn't already exist.
-         */
-        List<NeutronLoadBalancerPoolMember> members = singletonPool.getLoadBalancerPoolMembers();
-        for (NeutronLoadBalancerPoolMember member: members) {
-            if (member.getPoolMemberID().equals(loadBalancerPoolMemberUUID))
-                throw new BadRequestException("LoadBalancerPoolMember UUID already exists");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolMemberAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                    int status = service.canCreateNeutronLoadBalancerPoolMember(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                service.neutronLoadBalancerPoolMemberCreated(singleton);
-            }
-        }
-
-        /**
-         * Add the member from the neutron load balancer pool as well
-         */
-        singletonPool.addLoadBalancerPoolMember(singleton);
-
-    } else {
-        List<NeutronLoadBalancerPoolMember> bulk = input.getBulk();
-        Iterator<NeutronLoadBalancerPoolMember> i = bulk.iterator();
-        HashMap<String, NeutronLoadBalancerPoolMember> testMap = new HashMap<String, NeutronLoadBalancerPoolMember>();
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolMemberAware.class, this);
-        while (i.hasNext()) {
-            NeutronLoadBalancerPoolMember test = i.next();
-            String loadBalancerPoolMemberUUID = test.getPoolMemberID();
-
-            /*
-             *  Verify that the LoadBalancerPoolMember doesn't already exist.
-             */
-            List<NeutronLoadBalancerPoolMember> members = singletonPool.getLoadBalancerPoolMembers();
-            for (NeutronLoadBalancerPoolMember member: members) {
-                if (member.getPoolMemberID().equals(loadBalancerPoolMemberUUID))
-                    throw new BadRequestException("LoadBalancerPoolMember UUID already exists");
-            }
-
-            if (testMap.containsKey(test.getPoolMemberID())) {
-                throw new BadRequestException("Load Balancer PoolMember UUID already exists");
-            }
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerPoolMember(test);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-        }
-        /*
-         * now, each element of the bulk request can be added to the cache
-         */
-        i = bulk.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerPoolMember test = i.next();
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                    service.neutronLoadBalancerPoolMemberCreated(test);
-                }
-            }
-            singletonPool.addLoadBalancerPoolMember(test);
-        }
-    }
-    return Response.status(201).entity(input).build();
-}
-
-/**
- * Updates a LB member pool
- */
-
-@Path("{loadBalancerPoolMemberUUID}")
-@PUT
-@Produces({ MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_JSON })
-@StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 403, condition = "Forbidden"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-public Response updateLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
-        final NeutronLoadBalancerPoolMemberRequest input) {
-
-    //TODO: Implement update LB member pool
-    return Response.status(501).entity(input).build();
-}
-
-/**
- * Deletes a LoadBalancerPoolMember
- */
-
-@Path("{loadBalancerPoolMemberUUID}")
-@DELETE
-@StatusCodes({
-    @ResponseCode(code = 204, condition = "No Content"),
-    @ResponseCode(code = 401, condition = "Unauthorized"),
-    @ResponseCode(code = 403, condition = "Forbidden"),
-    @ResponseCode(code = 404, condition = "Not Found"),
-    @ResponseCode(code = 501, condition = "Not Implemented") })
-public Response deleteLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID) {
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-
-    // Verify that the loadBalancerPool exists, for the member to be removed from its cache
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-
-    //Verify that the LB pool member exists
-    NeutronLoadBalancerPoolMember singleton = null;
-    List<NeutronLoadBalancerPoolMember> members =
-            loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-    for (NeutronLoadBalancerPoolMember member: members) {
-        if (member.getPoolMemberID().equals(loadBalancerPoolMemberUUID)) {
-            singleton = member;
-            break;
-        }
-    }
-    if (singleton == null)
-        throw new BadRequestException("LoadBalancerPoolMember UUID does not exist.");
-
-    Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolMemberAware.class, this);
-    if (instances != null) {
-        if (instances.length > 0) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                int status = service.canDeleteNeutronLoadBalancerPoolMember(singleton);
-                if (status < 200 || status > 299) {
-                    return Response.status(status).build();
-                }
-            }
-        } else {
-            throw new ServiceUnavailableException("No providers registered.  Please try again later");
-        }
-    } else {
-        throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-    }
-
-    if (instances != null) {
-        for (Object instance : instances) {
-            INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-            service.neutronLoadBalancerPoolMemberDeleted(singleton);
-        }
-    }
-
-    /**
-     * Remove the member from the neutron load balancer pool
-     */
-    NeutronLoadBalancerPool singletonPool = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID);
-    singletonPool.removeLoadBalancerPoolMember(singleton);
-
-    return Response.status(204).build();
-}
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolNorthbound.java
deleted file mode 100644 (file)
index ea4e2d1..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (C) 2014 SDN Hub, LLC.
- *
- * 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
- *
- * Authors : Srini Seetharaman
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-
-/**
- * Neutron Northbound REST APIs for LoadBalancerPool Policies.<br>
- * This class provides REST APIs for managing neutron LoadBalancerPool Policies
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-/**
- * For now, the LB pool member data is maintained with the INeutronLoadBalancerPoolCRUD,
- * and not duplicated within the INeutronLoadBalancerPoolMemberCRUD's cache.
- */
-
-@Path("/pools")
-public class NeutronLoadBalancerPoolNorthbound {
-
-    private NeutronLoadBalancerPool extractFields(NeutronLoadBalancerPool o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancerPool
-     * */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancerPool attributes
-            @QueryParam("id") String queryLoadBalancerPoolID,
-            @QueryParam("tenant_id") String queryLoadBalancerPoolTenantID,
-            @QueryParam("name") String queryLoadBalancerPoolName,
-            @QueryParam("description") String queryLoadBalancerDescription,
-            @QueryParam("protocol") String queryLoadBalancerProtocol,
-            @QueryParam("lb_algorithm") String queryLoadBalancerPoolLbAlgorithm,
-            @QueryParam("healthmonitor_id") String queryLoadBalancerPoolHealthMonitorID,
-            @QueryParam("admin_state_up") String queryLoadBalancerIsAdminStateUp,
-            @QueryParam("status") String queryLoadBalancerPoolStatus,
-            @QueryParam("members") List<NeutronLoadBalancerPoolMember> queryLoadBalancerPoolMembers,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancerPool> allLoadBalancerPools = loadBalancerPoolInterface.getAllNeutronLoadBalancerPools();
-        List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
-        Iterator<NeutronLoadBalancerPool> i = allLoadBalancerPools.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerPool nsg = i.next();
-            if ((queryLoadBalancerPoolID == null ||
-                    queryLoadBalancerPoolID.equals(nsg.getLoadBalancerPoolID())) &&
-                    (queryLoadBalancerPoolTenantID == null ||
-                            queryLoadBalancerPoolTenantID.equals(nsg.getLoadBalancerPoolTenantID())) &&
-                    (queryLoadBalancerPoolName == null ||
-                            queryLoadBalancerPoolName.equals(nsg.getLoadBalancerPoolName())) &&
-                    (queryLoadBalancerDescription == null ||
-                            queryLoadBalancerDescription.equals(nsg.getLoadBalancerPoolDescription())) &&
-                    (queryLoadBalancerPoolLbAlgorithm == null ||
-                            queryLoadBalancerPoolLbAlgorithm.equals(nsg.getLoadBalancerPoolLbAlgorithm())) &&
-                    (queryLoadBalancerPoolHealthMonitorID == null ||
-                            queryLoadBalancerPoolHealthMonitorID.equals(nsg.getNeutronLoadBalancerPoolHealthMonitorID())) &&
-                    (queryLoadBalancerIsAdminStateUp == null ||
-                            queryLoadBalancerIsAdminStateUp.equals(nsg.getLoadBalancerPoolAdminIsStateIsUp())) &&
-                    (queryLoadBalancerPoolStatus == null ||
-                            queryLoadBalancerPoolStatus.equals(nsg.getLoadBalancerPoolStatus())) &&
-                    (queryLoadBalancerPoolMembers.size() == 0 ||
-                            queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerPoolRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancerPool */
-
-    @Path("{loadBalancerPoolID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancerPool(@PathParam("loadBalancerPoolID") String loadBalancerPoolID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolID)) {
-            throw new ResourceNotFoundException("LoadBalancerPool UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancerPool ans = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerPoolRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerPoolRequest(loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancerPool */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancerPools(final NeutronLoadBalancerPoolRequest input) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancerPool singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancerPool doesn't already exist.
-             */
-            if (loadBalancerPoolInterface.neutronLoadBalancerPoolExists(singleton.getLoadBalancerPoolID())) {
-                throw new BadRequestException("LoadBalancerPool UUID already exists");
-            }
-
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerPool(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            loadBalancerPoolInterface.addNeutronLoadBalancerPool(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                    service.neutronLoadBalancerPoolCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancerPool> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancerPool> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancerPool> testMap = new HashMap<String, NeutronLoadBalancerPool>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancerPool test = i.next();
-
-                /*
-                 *  Verify that the loadBalancerPool doesn't already exist
-                 */
-
-                if (loadBalancerPoolInterface.neutronLoadBalancerPoolExists(test.getLoadBalancerPoolID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerPoolID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                            int status = service.canCreateNeutronLoadBalancerPool(test);
-              &nb