consolidate NeturonCRUDInterface.fetchNeturonCRUD logic 18/45118/1
authorIsaku Yamahata <isaku.yamahata@intel.com>
Sat, 3 Sep 2016 00:02:55 +0000 (17:02 -0700)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Sat, 3 Sep 2016 00:09:57 +0000 (17:09 -0700)
The logic are mostly same, consolidate them by generics.

Change-Id: I4a38de02b2a11f355581702a711fe9244d835701
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
27 files changed:
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronCRUDInterfaces.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallPolicyNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRulesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayConnectionNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerHealthMonitorNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRulesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNetworksNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronQosPolicyNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifiersNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRulesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java

index 26db8833f1215fe2f5bfc8f255f2a0934727fc7f..7a30d2230c29c079076aabe33b7e896172c1945e 100644 (file)
@@ -21,30 +21,6 @@ public class NeutronCRUDInterfaces {
     private INeutronSubnetCRUD subnetInterface;
     private INeutronPortCRUD portInterface;
     private INeutronRouterCRUD routerInterface;
-    private INeutronFloatingIPCRUD fipInterface;
-    private INeutronSecurityGroupCRUD sgInterface;
-    private INeutronSecurityRuleCRUD srInterface;
-    private INeutronFirewallCRUD fwInterface;
-    private INeutronFirewallPolicyCRUD fwpInterface;
-    private INeutronFirewallRuleCRUD fwrInterface;
-    private INeutronLoadBalancerCRUD lbInterface;
-    private INeutronLoadBalancerPoolCRUD lbpInterface;
-    private INeutronLoadBalancerListenerCRUD lblInterface;
-    private INeutronLoadBalancerHealthMonitorCRUD lbhmInterface;
-    private INeutronMeteringLabelCRUD mlInterface;
-    private INeutronMeteringLabelRuleCRUD mlrInterface;
-    private INeutronVPNIKEPolicyCRUD ikepInterface;
-    private INeutronVPNIPSECPolicyCRUD ipsecpInterface;
-    private INeutronVPNServiceCRUD vpnInterface;
-    private INeutronVPNIPSECSiteConnectionsCRUD ipsecScInterface;
-    private INeutronBgpvpnCRUD bgpvpnInterface;
-    private INeutronL2gatewayCRUD l2gatewayInterface;
-    private INeutronL2gatewayConnectionCRUD l2gatewayConnectionInterface;
-    private INeutronSFCFlowClassifierCRUD sfcFlowClassifierInterface;
-    private INeutronSFCPortPairCRUD sfcPortPairInterface;
-    private INeutronSFCPortPairGroupCRUD sfcPortPairGroupInterface;
-    private INeutronSFCPortChainCRUD sfcPortChainInterface;
-    private INeutronQosPolicyCRUD qospInterface;
 
     public NeutronCRUDInterfaces() {
     }
@@ -65,106 +41,6 @@ public class NeutronCRUDInterfaces {
         return routerInterface;
     }
 
-    public INeutronFloatingIPCRUD getFloatingIPInterface() {
-        return fipInterface;
-    }
-
-    public INeutronSecurityGroupCRUD getSecurityGroupInterface() {
-        return sgInterface;
-    }
-
-    public INeutronSecurityRuleCRUD getSecurityRuleInterface() {
-        return srInterface;
-    }
-
-    public INeutronFirewallCRUD getFirewallInterface() {
-        return fwInterface;
-    }
-
-    public INeutronFirewallPolicyCRUD getFirewallPolicyInterface() {
-        return fwpInterface;
-    }
-
-    public INeutronFirewallRuleCRUD getFirewallRuleInterface() {
-        return fwrInterface;
-    }
-
-    public INeutronLoadBalancerCRUD getLoadBalancerInterface() {
-        return lbInterface;
-    }
-
-    public INeutronLoadBalancerPoolCRUD getLoadBalancerPoolInterface() {
-        return lbpInterface;
-    }
-
-    public INeutronLoadBalancerListenerCRUD getLoadBalancerListenerInterface() {
-        return lblInterface;
-    }
-
-    public INeutronLoadBalancerHealthMonitorCRUD getLoadBalancerHealthMonitorInterface() {
-        return lbhmInterface;
-    }
-
-    public INeutronMeteringLabelCRUD getMeteringLabelInterface() {
-        return mlInterface;
-    }
-
-    public INeutronMeteringLabelRuleCRUD getMeteringLabelRuleInterface() {
-        return mlrInterface;
-    }
-
-    public INeutronVPNIKEPolicyCRUD getVPNIKEPolicyInterface() {
-        return ikepInterface;
-    }
-
-    public INeutronVPNIPSECPolicyCRUD getVPNIPSECPolicyInterface() {
-        return ipsecpInterface;
-    }
-
-    public INeutronL2gatewayCRUD getL2gatewayInterface() {
-        return l2gatewayInterface;
-    }
-
-    public INeutronL2gatewayConnectionCRUD getL2gatewayConnectionInterface() {
-        return l2gatewayConnectionInterface;
-    }
-
-    public void setVPNServiceInterface(INeutronVPNServiceCRUD iface) {
-        vpnInterface = iface;
-    }
-
-    public INeutronVPNServiceCRUD getVPNServiceInterface() {
-        return vpnInterface;
-    }
-
-    public INeutronVPNIPSECSiteConnectionsCRUD getVPNIPSECSiteConnectionsInterface() {
-        return ipsecScInterface;
-    }
-
-    public INeutronBgpvpnCRUD getBgpvpnInterface() {
-        return bgpvpnInterface;
-    }
-
-    public INeutronSFCFlowClassifierCRUD getSFCFlowClassifierInterface() {
-        return sfcFlowClassifierInterface;
-    }
-
-    public INeutronSFCPortPairCRUD getSFCPortPairInterface() {
-        return sfcPortPairInterface;
-    }
-
-    public INeutronSFCPortPairGroupCRUD getSFCPortPairGroupInterface() {
-        return sfcPortPairGroupInterface;
-    }
-
-    public INeutronSFCPortChainCRUD getSFCPortChainInterface() {
-        return sfcPortChainInterface;
-    }
-
-    public INeutronQosPolicyCRUD getQosPolicyInterface() {
-        return qospInterface;
-    }
-
     public NeutronCRUDInterfaces fetchINeutronNetworkCRUD(Object obj) {
         networkInterface = (INeutronNetworkCRUD) getInstances(INeutronNetworkCRUD.class, obj);
         return this;
@@ -185,132 +61,12 @@ public class NeutronCRUDInterfaces {
         return this;
     }
 
-    public NeutronCRUDInterfaces fetchINeutronFloatingIPCRUD(Object obj) {
-        fipInterface = (INeutronFloatingIPCRUD) getInstances(INeutronFloatingIPCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronSecurityGroupCRUD(Object obj) {
-        sgInterface = (INeutronSecurityGroupCRUD) getInstances(INeutronSecurityGroupCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronSecurityRuleCRUD(Object obj) {
-        srInterface = (INeutronSecurityRuleCRUD) getInstances(INeutronSecurityRuleCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronFirewallCRUD(Object obj) {
-        fwInterface = (INeutronFirewallCRUD) getInstances(INeutronFirewallCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronFirewallPolicyCRUD(Object obj) {
-        fwpInterface = (INeutronFirewallPolicyCRUD) getInstances(INeutronFirewallPolicyCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronFirewallRuleCRUD(Object obj) {
-        fwrInterface = (INeutronFirewallRuleCRUD) getInstances(INeutronFirewallRuleCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronLoadBalancerCRUD(Object obj) {
-        lbInterface = (INeutronLoadBalancerCRUD) getInstances(INeutronLoadBalancerCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronLoadBalancerPoolCRUD(Object obj) {
-        lbpInterface = (INeutronLoadBalancerPoolCRUD) getInstances(INeutronLoadBalancerPoolCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronLoadBalancerListenerCRUD(Object obj) {
-        lblInterface = (INeutronLoadBalancerListenerCRUD) getInstances(INeutronLoadBalancerListenerCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronLoadBalancerHealthMonitorCRUD(Object obj) {
-        lbhmInterface = (INeutronLoadBalancerHealthMonitorCRUD) getInstances(
-                INeutronLoadBalancerHealthMonitorCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronMeteringLabelCRUD(Object obj) {
-        mlInterface = (INeutronMeteringLabelCRUD) getInstances(INeutronMeteringLabelCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronMeteringLabelRuleCRUD(Object obj) {
-        mlrInterface = (INeutronMeteringLabelRuleCRUD) getInstances(INeutronMeteringLabelRuleCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronVPNIKEPolicyCRUD(Object obj) {
-        ikepInterface = (INeutronVPNIKEPolicyCRUD) getInstances(INeutronVPNIKEPolicyCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronVPNIPSECPolicyCRUD(Object obj) {
-        ipsecpInterface = (INeutronVPNIPSECPolicyCRUD) getInstances(INeutronVPNIPSECPolicyCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronVPNServiceCRUD(Object obj) {
-        vpnInterface = (INeutronVPNServiceCRUD) getInstances(INeutronVPNServiceCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronVPNIPSECSiteConnectionsCRUD(Object obj) {
-        ipsecScInterface = (INeutronVPNIPSECSiteConnectionsCRUD) getInstances(INeutronVPNIPSECSiteConnectionsCRUD.class,
-                obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronBgpvpnCRUD(Object obj) {
-        bgpvpnInterface = (INeutronBgpvpnCRUD) getInstances(INeutronBgpvpnCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronL2gatewayCRUD(Object obj) {
-        l2gatewayInterface = (INeutronL2gatewayCRUD) getInstances(INeutronL2gatewayCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronL2gatewayConnectionCRUD(Object obj) {
-        l2gatewayConnectionInterface = (INeutronL2gatewayConnectionCRUD) getInstances(
-                INeutronL2gatewayConnectionCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronSFCFlowClassifierCRUD(Object obj) {
-        sfcFlowClassifierInterface = (INeutronSFCFlowClassifierCRUD) getInstances(INeutronSFCFlowClassifierCRUD.class,
-                obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronSFCPortPairCRUD(Object obj) {
-        sfcPortPairInterface = (INeutronSFCPortPairCRUD) getInstances(INeutronSFCPortPairCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronSFCPortPairGroupCRUD(Object obj) {
-        sfcPortPairGroupInterface = (INeutronSFCPortPairGroupCRUD) getInstances(INeutronSFCPortPairGroupCRUD.class,
-                obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronSFCPortChainCRUD(Object obj) {
-        sfcPortChainInterface = (INeutronSFCPortChainCRUD) getInstances(INeutronSFCPortChainCRUD.class, obj);
-        return this;
-    }
-
-    public NeutronCRUDInterfaces fetchINeutronQosPolicyCRUD(Object obj) {
-        qospInterface = (INeutronQosPolicyCRUD) getInstances(INeutronQosPolicyCRUD.class, obj);
-        return this;
+    public static <T extends INeutronObject<T>, I extends INeutronCRUD<T>> I fetchINeutronCRUD(
+        Class<I> cls, Object obj) {
+        return (I) getInstances(cls, obj);
     }
 
-    public Object getInstances(Class<?> clazz, Object bundle) {
+    public static Object getInstances(Class<?> clazz, Object bundle) {
         try {
             BundleContext bCtx = FrameworkUtil.getBundle(bundle.getClass()).getBundleContext();
 
index c6102ca467cda6067e66dcbe9c3090cd1bb755c9..2bad42d3a041b1f06f48280fd69e61ff4ca02aed 100644 (file)
@@ -16,6 +16,7 @@ import java.util.List;
 import javax.ws.rs.core.Response;
 import org.opendaylight.neutron.spi.INeutronCRUD;
 import org.opendaylight.neutron.spi.INeutronObject;
+import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,7 +59,16 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, Neu
         }
     }
 
-    protected abstract I getNeutronCRUD();
+    protected I getNeutronCRUD() {
+        ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass();
+        // cls = I.class
+        Class<I> cls = (Class<I>) parameterizedType.getActualTypeArguments()[2];
+        I neutronCrud = NeutronCRUDInterfaces.fetchINeutronCRUD(cls, (Object) this);
+        if (neutronCrud == null) {
+            throw new ServiceUnavailableException(serviceUnavailable());
+        }
+        return neutronCrud;
+    }
 
     protected Response show(String uuid,
             // return fields
index 5a97a9a9c5d7c676e8abcc3a31343d634e6031c8..3d67412bffeedba1c6e8a66e04bcfdad0924bfd8 100644 (file)
@@ -31,7 +31,6 @@ import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.neutron.spi.INeutronBgpvpnCRUD;
 import org.opendaylight.neutron.spi.NeutronBgpvpn;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 
 /**
  * Neutron Northbound REST APIs for Bgpvpn.<br>
@@ -65,15 +64,6 @@ public class NeutronBgpvpnsNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronBgpvpnCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronBgpvpnCRUD(this);
-        if (answer.getBgpvpnInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getBgpvpnInterface();
-    }
-
     /**
      * Returns a list of all Bgpvpns */
 
index 05c79bb4df30c5a1f0f62efc746ce124868757d8..3d1600f636bcc9916048ae0866f5f6c681929957 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronFirewallCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronFirewall;
 
 /**
@@ -56,15 +55,6 @@ public class NeutronFirewallNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronFirewallCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronFirewallCRUD(this);
-        if (answer.getFirewallInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getFirewallInterface();
-    }
-
     /**
      * Returns a list of all Firewalls */
     @GET
index f88bcbb54b73e67e5fe2e83201b7c43dd73c4c4b..59e58b7d5d46b79d34291add1d5045b8577fac63 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronFirewallPolicyCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronFirewallPolicy;
 
 /**
@@ -56,15 +55,6 @@ public class NeutronFirewallPolicyNorthbound extends
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronFirewallPolicyCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronFirewallPolicyCRUD(this);
-        if (answer.getFirewallPolicyInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getFirewallPolicyInterface();
-    }
-
     /**
      * Returns a list of all Firewall Policies */
     @GET
index 98c0b56d5c10a48064d6cfeb710b4df6b2421ac6..bf76c4b45d3dcce2499a3c9da999b3853a408ad0 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronFirewallRuleCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronFirewallRule;
 
 /**
@@ -55,15 +54,6 @@ public class NeutronFirewallRulesNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronFirewallRuleCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronFirewallRuleCRUD(this);
-        if (answer.getFirewallRuleInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getFirewallRuleInterface();
-    }
-
     /**
      * Returns a list of all Firewall Rules
      */
index bea485d429f2b60856daeff30c5a93da558d979a..91d06ff83542db18ad6a5dfcc4a4d27e396debbd 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronFloatingIPCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronFloatingIP;
 
 /**
@@ -57,35 +56,6 @@ public class NeutronFloatingIPsNorthbound
         return RESOURCE_NAME;
     }
 
-    private NeutronCRUDInterfaces getNeutronInterfaces(boolean flag) {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronFloatingIPCRUD(this);
-        if (answer.getFloatingIPInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        if (flag) {
-            answer = answer.fetchINeutronNetworkCRUD(this).fetchINeutronSubnetCRUD(this).fetchINeutronPortCRUD(this);
-            if (answer.getNetworkInterface() == null) {
-                throw new ServiceUnavailableException(
-                        "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
-            }
-            if (answer.getSubnetInterface() == null) {
-                throw new ServiceUnavailableException(
-                        "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
-            }
-            if (answer.getPortInterface() == null) {
-                throw new ServiceUnavailableException(
-                        "Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
-            }
-        }
-        return answer;
-    }
-
-    @Override
-    protected INeutronFloatingIPCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = getNeutronInterfaces(false);
-        return answer.getFloatingIPInterface();
-    }
-
     /**
      * Returns a list of all FloatingIPs */
 
@@ -113,7 +83,7 @@ public class NeutronFloatingIPsNorthbound
             @QueryParam("page_reverse") String pageReverse
     // sorting not supported
     ) {
-        INeutronFloatingIPCRUD floatingIPInterface = getNeutronInterfaces(false).getFloatingIPInterface();
+        INeutronFloatingIPCRUD floatingIPInterface = getNeutronCRUD();
         List<NeutronFloatingIP> allFloatingIPs = floatingIPInterface.getAll();
         List<NeutronFloatingIP> ans = new ArrayList<>();
         Iterator<NeutronFloatingIP> i = allFloatingIPs.iterator();
index 7166a989c739f765ac0444ae0342ae561e5f3f92..fa63eaa9d65f659f56863fbef2944384d3184e94 100644 (file)
@@ -27,7 +27,6 @@ import javax.ws.rs.core.UriInfo;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronL2gatewayConnectionCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronL2gatewayConnection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,15 +64,6 @@ public class NeutronL2gatewayConnectionNorthbound extends AbstractNeutronNorthbo
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronL2gatewayConnectionCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronL2gatewayConnectionCRUD(this);
-        if (answer.getL2gatewayConnectionInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getL2gatewayConnectionInterface();
-    }
-
     /**
      * Creates L2gateway Connection
      * @param  input contains connection details
index 4a7f3bf074c938c82bb986a563b4eec1a2c7783c..20778c120f03fcf686a2bcecf071af44cbf76335 100644 (file)
@@ -27,7 +27,6 @@ import javax.ws.rs.core.UriInfo;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronL2gatewayCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronL2gateway;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,15 +63,6 @@ public class NeutronL2gatewayNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronL2gatewayCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronL2gatewayCRUD(this);
-        if (answer.getL2gatewayInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getL2gatewayInterface();
-    }
-
     /**
      * Creates L2gateway
      * @param input l2gateway attributes
@@ -118,7 +108,7 @@ public class NeutronL2gatewayNorthbound
             @QueryParam("page_reverse") String pageReverse
     // sorting not supported
     ) {
-        INeutronL2gatewayCRUD l2gatewayInterface = getNeutronInterfaces().getL2gatewayInterface();
+        INeutronL2gatewayCRUD l2gatewayInterface = getNeutronCRUD();
         List<NeutronL2gateway> allL2gateways = l2gatewayInterface.getAll();
         List<NeutronL2gateway> ans = new ArrayList<>();
         Iterator<NeutronL2gateway> i = allL2gateways.iterator();
@@ -191,12 +181,4 @@ public class NeutronL2gatewayNorthbound
     public Response updateL2gateway(@PathParam("l2gatewayID") String l2gatewayID, NeutronL2gatewayRequest input) {
         return update(l2gatewayID, input);
     }
-
-    private NeutronCRUDInterfaces getNeutronInterfaces() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronL2gatewayCRUD(this);
-        if (answer.getL2gatewayInterface() == null) {
-            throw new ServiceUnavailableException("Service is unavailable");
-        }
-        return answer;
-    }
 }
index 0a685c2a5a17178cca428cf55a6fc77240bf8a04..c6f40735ccbaef657717479fd0aa338d17c5ae8f 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerHealthMonitor;
 
 /**
@@ -58,15 +57,6 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronLoadBalancerHealthMonitorCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (answer.getLoadBalancerHealthMonitorInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getLoadBalancerHealthMonitorInterface();
-    }
-
     /**
      * Returns a list of all LoadBalancerHealthMonitor */
     @GET
index f9b50760ebc920c4de6d8f5f2b4fbbc67cdd47f4..796b69f1e0798383001a83b5c68c0e0fa13d1b99 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerListener;
 
 /**
@@ -57,15 +56,6 @@ public class NeutronLoadBalancerListenerNorthbound extends AbstractNeutronNorthb
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronLoadBalancerListenerCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronLoadBalancerListenerCRUD(this);
-        if (answer.getLoadBalancerListenerInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getLoadBalancerListenerInterface();
-    }
-
     /**
      * Returns a list of all LoadBalancerListener */
     @GET
index 41b2abcd7802a291e322389e6bdd72c980c0833e..888f423a728fb87d25602ec63e247ec2864af9cb 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronLoadBalancer;
 
 /**
@@ -57,15 +56,6 @@ public class NeutronLoadBalancerNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronLoadBalancerCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronLoadBalancerCRUD(this);
-        if (answer.getLoadBalancerInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getLoadBalancerInterface();
-    }
-
     /**
      * Returns a list of all LoadBalancer */
     @GET
index 4665cb3a8301689384fa733801e33c7203b17c79..1e6ea6518919fc00e70fadbf1672fd7371a1e31b 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerPool;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerPoolMember;
 
@@ -64,15 +63,6 @@ public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronLoadBalancerPoolCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronLoadBalancerPoolCRUD(this);
-        if (answer.getLoadBalancerPoolInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getLoadBalancerPoolInterface();
-    }
-
     /**
      * Returns a list of all LoadBalancerPool
      * */
index 4c4ce8fd7786849bcbd404339c5685220c16c071..82e345b984858f0f63ad94bc47669e1201c7dcdc 100644 (file)
@@ -27,7 +27,6 @@ import javax.ws.rs.core.UriInfo;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronMeteringLabelRuleCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronMeteringLabelRule;
 
 /**
@@ -58,15 +57,6 @@ public class NeutronMeteringLabelRulesNorthbound extends AbstractNeutronNorthbou
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronMeteringLabelRuleCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronMeteringLabelRuleCRUD(this);
-        if (answer.getMeteringLabelRuleInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getMeteringLabelRuleInterface();
-    }
-
     @Context
     UriInfo uriInfo;
 
index f2e837c19bb48b4e7271b93ccd968374fe60ae6a..0cf46f2b69cebf74ccad4cd2a57a770abe7abc32 100644 (file)
@@ -27,7 +27,6 @@ import javax.ws.rs.core.UriInfo;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronMeteringLabelCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronMeteringLabel;
 
 /**
@@ -58,15 +57,6 @@ public class NeutronMeteringLabelsNorthbound extends
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronMeteringLabelCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronMeteringLabelCRUD(this);
-        if (answer.getMeteringLabelInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getMeteringLabelInterface();
-    }
-
     @Context
     UriInfo uriInfo;
 
index 469aa9120a66b00f702565c308ce7de5d0c20779..d11aa5e940bdebcb1d5dd278d4888df06fb5faaa 100644 (file)
@@ -30,7 +30,6 @@ import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.neutron.spi.INeutronNetworkCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronNetwork;
 
 /**
@@ -65,15 +64,6 @@ public class NeutronNetworksNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronNetworkCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronNetworkCRUD(this);
-        if (answer.getNetworkInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getNetworkInterface();
-    }
-
     /**
      * Returns a list of all Networks */
 
index 572dcde049844a5d3490eb5a379f7c8edb099cd6..a9f1254005cebe073b85286f249ef435bb261bb3 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronQosPolicyCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronQosPolicy;
 
 @Path("/qos/policies")
@@ -39,15 +38,6 @@ public class NeutronQosPolicyNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronQosPolicyCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronQosPolicyCRUD(this);
-        if (answer.getQosPolicyInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getQosPolicyInterface();
-    }
-
     /**
      * Returns a list of all Qos Policies
      */
index f9f6aa9c283baa1f5209cda282bf7be1fe463f30..312d2db5f4ef43bd0db25ca0b9cacb23506f7852 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronSFCFlowClassifierCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronSFCFlowClassifier;
 
 /**
@@ -56,15 +55,6 @@ public class NeutronSFCFlowClassifiersNorthbound extends AbstractNeutronNorthbou
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronSFCFlowClassifierCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSFCFlowClassifierCRUD(this);
-        if (answer.getSFCFlowClassifierInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getSFCFlowClassifierInterface();
-    }
-
     /**
      * Returns a list of all SFC Flow Classifiers */
 
index 3d54b5bcfd16ebb6a93a5348ac83113a27ba9dcc..1c4b8d2ce619660e0f61fd1eff969f4e09d478f1 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronSFCPortChainCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronSFCPortChain;
 
 /**
@@ -57,15 +56,6 @@ public class NeutronSFCPortChainsNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronSFCPortChainCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSFCPortChainCRUD(this);
-        if (answer.getSFCPortChainInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getSFCPortChainInterface();
-    }
-
     /**
      * Returns a list of all SFC Port Chains*/
 
index c3c3a157246fbc0fc0b45879101655fe0bf5c0a6..a46ed01f7d8a1412c43a3387c52f91dd562ec7e4 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronSFCPortPairGroupCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronSFCPortPairGroup;
 
 /**
@@ -57,15 +56,6 @@ public class NeutronSFCPortPairGroupsNorthbound extends AbstractNeutronNorthboun
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronSFCPortPairGroupCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSFCPortPairGroupCRUD(this);
-        if (answer.getSFCPortPairGroupInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getSFCPortPairGroupInterface();
-    }
-
     /**
      * Returns a list of all SFC Port Pair Groups*/
 
index c61fc0c0d46aba2c7120ead652f3b54ee1be05ac..3e933240ebf9d93025e894da7a605e97d2fcbd80 100644 (file)
@@ -25,7 +25,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronSFCPortPairCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronSFCPortPair;
 
 /**
@@ -57,15 +56,6 @@ public class NeutronSFCPortPairsNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronSFCPortPairCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSFCPortPairCRUD(this);
-        if (answer.getSFCPortPairInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getSFCPortPairInterface();
-    }
-
     /**
      * Returns a list of all SFC Port Pairs*/
 
index 9e12af17e6a4148493bede3f362778685637f4cc..5a0906ae94563196ae3318c280cca42ed4c9244e 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronSecurityGroupCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronSecurityGroup;
 
 /**
@@ -55,15 +54,6 @@ public class NeutronSecurityGroupsNorthbound extends
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronSecurityGroupCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSecurityGroupCRUD(this);
-        if (answer.getSecurityGroupInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getSecurityGroupInterface();
-    }
-
     /**
      * Returns a list of all Security Groups
      */
index 3a95c4e17078428c3a25bf110688887f9d50be28..2cca389c7763097a2abe9edcbc52c8ea6ced367e 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.opendaylight.neutron.spi.INeutronSecurityRuleCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronSecurityRule;
 
 /**
@@ -56,15 +55,6 @@ public class NeutronSecurityRulesNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronSecurityRuleCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSecurityRuleCRUD(this);
-        if (answer.getSecurityRuleInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getSecurityRuleInterface();
-    }
-
     /**
      * Returns a list of all Security Rules
      */
index ec886f303d961b58b0a8fa380dc3f4c512fee74f..8e629af9c36c27d6cdf8ee72252efaf6850f6e2b 100644 (file)
@@ -29,7 +29,6 @@ import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.neutron.spi.INeutronVPNIKEPolicyCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronVPNIKEPolicy;
 
 /**
@@ -60,15 +59,6 @@ public class NeutronVPNIKEPoliciesNorthbound
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronVPNIKEPolicyCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNIKEPolicyCRUD(this);
-        if (answer.getVPNIKEPolicyInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getVPNIKEPolicyInterface();
-    }
-
     @Context
     UriInfo uriInfo;
 
index 3dd4d8cb41d81887e6ab781b69f45331d0371b26..65842b95ee9d8354b1290a70fb28cc15a48d2db8 100644 (file)
@@ -29,7 +29,6 @@ import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.neutron.spi.INeutronVPNIPSECPolicyCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronVPNIPSECPolicy;
 
 /**
@@ -61,15 +60,6 @@ public class NeutronVPNIPSECPoliciesNorthbound extends
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronVPNIPSECPolicyCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNIPSECPolicyCRUD(this);
-        if (answer.getVPNIPSECPolicyInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getVPNIPSECPolicyInterface();
-    }
-
     @Context
     UriInfo uriInfo;
 
index 055bf3af10bba256988dd28bf6fafdd0a76b8cd7..eca5524f9395c2240bd72ac85f92b3f63868ff54 100644 (file)
@@ -29,7 +29,6 @@ import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.neutron.spi.INeutronVPNIPSECSiteConnectionsCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronVPNIPSECSiteConnection;
 
 /**
@@ -61,15 +60,6 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound extends AbstractNeutronNor
         return RESOURCE_NAME;
     }
 
-    @Override
-    protected INeutronVPNIPSECSiteConnectionsCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNIPSECSiteConnectionsCRUD(this);
-        if (answer.getVPNIPSECSiteConnectionsInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getVPNIPSECSiteConnectionsInterface();
-    }
-
     @Context
     UriInfo uriInfo;
 
index 028b38c03deeace93222b158cb87c2dd226f8f81..2859b23a134778121ca257b269b5fe6ae47f409b 100644 (file)
@@ -29,7 +29,6 @@ import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.neutron.spi.INeutronVPNServiceCRUD;
-import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronVPNService;
 
 /**
@@ -64,15 +63,6 @@ public class NeutronVPNServicesNorthbound
     @Context
     UriInfo uriInfo;
 
-    @Override
-    protected INeutronVPNServiceCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNServiceCRUD(this);
-        if (answer.getVPNServiceInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable());
-        }
-        return answer.getVPNServiceInterface();
-    }
-
     /**
      * Returns a list of all VPN Services
      */