From 3b49549f18b9c28daeb7777e67b0b0f8ec172c18 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Thu, 1 Sep 2016 09:21:33 -0700 Subject: [PATCH] sort out signature of extraceField method So far, the signature of extractField was not defined cleanly. Define it clean and simplify convoluted code due to it. Change-Id: I48387b8df50bd019a735e6272a3850adfd10b0d5 Signed-off-by: Isaku Yamahata --- .../neutron/spi/INeutronCRUD.java | 2 +- .../neutron/spi/INeutronObject.java | 6 ++++- .../neutron/spi/NeutronBgpvpn.java | 2 +- .../neutron/spi/NeutronFirewall.java | 4 +-- .../neutron/spi/NeutronFirewallPolicy.java | 4 +-- .../neutron/spi/NeutronFirewallRule.java | 4 +-- .../neutron/spi/NeutronFloatingIP.java | 4 +-- .../neutron/spi/NeutronL2gateway.java | 5 ++-- .../spi/NeutronL2gatewayConnection.java | 4 +-- .../neutron/spi/NeutronLoadBalancer.java | 4 +-- .../spi/NeutronLoadBalancerHealthMonitor.java | 4 +-- .../spi/NeutronLoadBalancerListener.java | 4 +-- .../neutron/spi/NeutronLoadBalancerPool.java | 4 +-- .../spi/NeutronLoadBalancerPoolMember.java | 4 +-- .../neutron/spi/NeutronMeteringLabel.java | 3 ++- .../neutron/spi/NeutronMeteringLabelRule.java | 3 ++- .../neutron/spi/NeutronNetwork.java | 4 +-- .../neutron/spi/NeutronObject.java | 7 ++++- .../opendaylight/neutron/spi/NeutronPort.java | 2 +- .../neutron/spi/NeutronQosBandwidthRule.java | 3 ++- .../spi/NeutronQosDscpMarkingRule.java | 3 ++- .../neutron/spi/NeutronQosPolicy.java | 3 ++- .../neutron/spi/NeutronRouter.java | 4 +-- .../neutron/spi/NeutronRouter_Interface.java | 27 ++++++++++++++++++- .../neutron/spi/NeutronSFCFlowClassifier.java | 4 +-- .../neutron/spi/NeutronSFCPortChain.java | 4 +-- .../neutron/spi/NeutronSFCPortPair.java | 4 +-- .../neutron/spi/NeutronSFCPortPairGroup.java | 4 +-- .../neutron/spi/NeutronSecurityGroup.java | 4 +-- .../neutron/spi/NeutronSecurityRule.java | 4 +-- .../neutron/spi/NeutronSubnet.java | 4 +-- .../neutron/spi/NeutronVPNIKEPolicy.java | 3 ++- .../neutron/spi/NeutronVPNIPSECPolicy.java | 3 ++- .../spi/NeutronVPNIPSECSiteConnection.java | 3 ++- .../neutron/spi/NeutronVPNService.java | 3 ++- .../api/AbstractNeutronNorthbound.java | 6 ++--- .../northbound/api/INeutronRequest.java | 2 +- .../api/NeutronBgpvpnsNorthbound.java | 7 +---- .../api/NeutronFirewallNorthbound.java | 7 +---- .../api/NeutronFirewallPolicyNorthbound.java | 7 +---- .../api/NeutronFirewallRulesNorthbound.java | 7 +---- .../api/NeutronFloatingIPsNorthbound.java | 7 +---- .../NeutronL2gatewayConnectionNorthbound.java | 7 +---- .../api/NeutronL2gatewayNorthbound.java | 7 +---- ...onLoadBalancerHealthMonitorNorthbound.java | 7 +---- ...NeutronLoadBalancerListenerNorthbound.java | 7 +---- .../api/NeutronLoadBalancerNorthbound.java | 7 +---- .../NeutronLoadBalancerPoolNorthbound.java | 15 +++-------- .../NeutronMeteringLabelRulesNorthbound.java | 7 +---- .../api/NeutronMeteringLabelsNorthbound.java | 7 +---- .../api/NeutronNetworksNorthbound.java | 7 +---- .../api/NeutronPortsNorthbound.java | 7 +---- .../api/NeutronQosPolicyNorthbound.java | 7 +---- .../api/NeutronRoutersNorthbound.java | 7 +---- .../NeutronSFCFlowClassifiersNorthbound.java | 7 +---- .../api/NeutronSFCPortChainsNorthbound.java | 7 +---- .../NeutronSFCPortPairGroupsNorthbound.java | 7 +---- .../api/NeutronSFCPortPairsNorthbound.java | 7 +---- .../api/NeutronSecurityGroupsNorthbound.java | 7 +---- .../api/NeutronSecurityRulesNorthbound.java | 7 +---- .../api/NeutronSubnetsNorthbound.java | 7 +---- .../api/NeutronVPNIKEPoliciesNorthbound.java | 7 +---- .../NeutronVPNIPSECPoliciesNorthbound.java | 7 +---- ...tronVPNIPSECSiteConnectionsNorthbound.java | 7 +---- .../api/NeutronVPNServicesNorthbound.java | 7 +---- .../api/PaginatedRequestFactory.java | 14 +++++++--- .../transcriber/AbstractNeutronInterface.java | 2 +- 67 files changed, 143 insertions(+), 239 deletions(-) diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronCRUD.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronCRUD.java index 7c1467ad6..f5504ae25 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronCRUD.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronCRUD.java @@ -15,7 +15,7 @@ import java.util.List; * */ -public interface INeutronCRUD { +public interface INeutronCRUD> { /** * Applications call this interface method to determine if a particular * Neutron object exists diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronObject.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronObject.java index 9131a8138..289252135 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronObject.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronObject.java @@ -8,12 +8,14 @@ package org.opendaylight.neutron.spi; +import java.util.List; + import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid; /** * This class contains behaviour common to Neutron configuration objects */ -public interface INeutronObject { +public interface INeutronObject { String getID(); @@ -26,4 +28,6 @@ public interface INeutronObject { void setTenantID(Uuid tenantID); void initDefaults(); + + T extractFields(List fields); } diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java index b1fa1c0b0..d0b1d39c1 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java @@ -18,7 +18,7 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "bgpvpn") @XmlAccessorType(XmlAccessType.NONE) -public class NeutronBgpvpn extends NeutronObject implements Serializable, INeutronObject { +public class NeutronBgpvpn extends NeutronObject implements Serializable, INeutronObject { // See OpenStack Network API v2.0 Reference for description of // annotated attributes diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewall.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewall.java index 5c795da43..dc78d1ab6 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewall.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewall.java @@ -34,8 +34,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronFirewall extends NeutronObject implements Serializable, INeutronObject { +public class NeutronFirewall extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallPolicy.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallPolicy.java index 8a5beaa45..be874befc 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallPolicy.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallPolicy.java @@ -33,8 +33,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronFirewallPolicy extends NeutronObject implements Serializable, INeutronObject { +public class NeutronFirewallPolicy extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallRule.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallRule.java index 645db26d0..3fca004f8 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallRule.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFirewallRule.java @@ -45,8 +45,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronFirewallRule extends NeutronObject implements Serializable, INeutronObject { +public class NeutronFirewallRule extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFloatingIP.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFloatingIP.java index 9cfa83e8b..1f3138175 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFloatingIP.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronFloatingIP.java @@ -18,8 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronFloatingIP extends NeutronObject implements Serializable, INeutronObject { +public class NeutronFloatingIP + extends NeutronObject implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java index d1ca05965..88a6afdaa 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java @@ -16,7 +16,8 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "l2gateway") -public class NeutronL2gateway extends NeutronObject implements Serializable, INeutronObject { +public class NeutronL2gateway extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") @@ -70,4 +71,4 @@ public class NeutronL2gateway extends NeutronObject implements Serializable, INe + ", devices = " + neutronL2gatewayDevices + "]"; } -} \ No newline at end of file +} diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gatewayConnection.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gatewayConnection.java index 148ac0747..83315ef68 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gatewayConnection.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gatewayConnection.java @@ -18,8 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "l2gatewayConnection") @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronL2gatewayConnection extends NeutronObject implements Serializable, INeutronObject { +public class NeutronL2gatewayConnection extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "gateway_id") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancer.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancer.java index 3e8795f99..3304927c3 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancer.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancer.java @@ -33,8 +33,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronLoadBalancer extends NeutronObject implements Serializable, INeutronObject { +public class NeutronLoadBalancer extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitor.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitor.java index 336a6bcb6..09444648a 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitor.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitor.java @@ -39,8 +39,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronLoadBalancerHealthMonitor extends NeutronObject implements Serializable, INeutronObject { +public class NeutronLoadBalancerHealthMonitor extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "type") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerListener.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerListener.java index 5383a1442..037ce96dc 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerListener.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerListener.java @@ -38,8 +38,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronLoadBalancerListener extends NeutronObject implements Serializable, INeutronObject { +public class NeutronLoadBalancerListener extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "default_pool_id") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPool.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPool.java index 9acc69ee9..465445593 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPool.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPool.java @@ -36,8 +36,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronLoadBalancerPool extends NeutronObject implements Serializable, INeutronObject { +public class NeutronLoadBalancerPool extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPoolMember.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPoolMember.java index 893b65637..de4401b1b 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPoolMember.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronLoadBalancerPoolMember.java @@ -19,8 +19,8 @@ import javax.xml.bind.annotation.XmlTransient; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronLoadBalancerPoolMember extends NeutronObject implements Serializable, INeutronObject { +public class NeutronLoadBalancerPoolMember extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabel.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabel.java index 726c3ffc2..8327f2bb2 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabel.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabel.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronMeteringLabel extends NeutronObject implements Serializable, INeutronObject { +public class NeutronMeteringLabel extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabelRule.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabelRule.java index ed5ea1a07..e4356487a 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabelRule.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronMeteringLabelRule.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronMeteringLabelRule extends NeutronObject implements Serializable, INeutronObject { +public class NeutronMeteringLabelRule extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "direction") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork.java index 571c4e18a..059d9e4e0 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork.java @@ -18,8 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "network") @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronNetwork extends NeutronObject implements Serializable, INeutronObject { +public class NeutronNetwork extends NeutronObject + implements Serializable, INeutronObject { // See OpenStack Network API v2.0 Reference for description of // annotated attributes diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronObject.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronObject.java index f6547053d..d80a1ffbc 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronObject.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronObject.java @@ -11,6 +11,7 @@ package org.opendaylight.neutron.spi; import com.fasterxml.jackson.annotation.JsonIgnore; import java.io.Serializable; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -19,7 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types. @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronObject extends Neutron_ID implements Serializable, INeutronObject { +public abstract class NeutronObject extends Neutron_ID + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "tenant_id") @@ -58,4 +60,7 @@ public class NeutronObject extends Neutron_ID implements Serializable, INeutronO @Override public void initDefaults() { } + + @Override + public abstract T extractFields(List fields); } diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java index b17375430..6bbed0399 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java @@ -21,7 +21,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronPort extends NeutronObject implements Serializable, INeutronObject { +public class NeutronPort extends NeutronObject implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosBandwidthRule.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosBandwidthRule.java index 0e97d3cc0..1dd3ae262 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosBandwidthRule.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosBandwidthRule.java @@ -19,7 +19,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronQosBandwidthRule extends NeutronObject implements Serializable, INeutronObject { +public class NeutronQosBandwidthRule extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "max_kbps") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosDscpMarkingRule.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosDscpMarkingRule.java index a3202dcdc..6c4868d7a 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosDscpMarkingRule.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosDscpMarkingRule.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronQosDscpMarkingRule extends NeutronObject implements Serializable, INeutronObject { +public class NeutronQosDscpMarkingRule extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "dscp_mark") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosPolicy.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosPolicy.java index 161860fd4..0a18605d7 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosPolicy.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronQosPolicy.java @@ -19,7 +19,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronQosPolicy extends NeutronObject implements Serializable, INeutronObject { +public class NeutronQosPolicy extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter.java index 66df248bc..ec7c694aa 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter.java @@ -18,8 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronRouter extends NeutronObject implements Serializable, INeutronObject { +public class NeutronRouter extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter_Interface.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter_Interface.java index 3e6a25e36..7589ea74b 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter_Interface.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronRouter_Interface.java @@ -9,6 +9,8 @@ package org.opendaylight.neutron.spi; import java.io.Serializable; +import java.util.Iterator; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -16,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronRouter_Interface extends NeutronObject implements Serializable, INeutronObject { +public class NeutronRouter_Interface extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of @@ -52,6 +55,28 @@ public class NeutronRouter_Interface extends NeutronObject implements Serializab this.portUUID = portUUID; } + @Override + public NeutronRouter_Interface extractFields(List fields) { + NeutronRouter_Interface ans = new NeutronRouter_Interface(); + Iterator i = fields.iterator(); + while (i.hasNext()) { + String s = i.next(); + if (s.equals("id")) { + ans.setID(this.getID()); + } + if (s.equals("tenant_id")) { + ans.setTenantID(this.getTenantID()); + } + if (s.equals("subnet_id")) { + ans.setSubnetUUID(this.getSubnetUUID()); + } + if (s.equals("port_id")) { + ans.setPortUUID(this.getPortUUID()); + } + } + return ans; + } + @Override public String toString() { return "NeutronRouterInterface [" + "subnetUUID=" + subnetUUID + ", portUUID=" + portUUID + ", id=" + uuid diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java index 67e4c9150..0b5bddd05 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java @@ -20,8 +20,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSFCFlowClassifier extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSFCFlowClassifier extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Networking SFC (networking-sfc) API v1.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortChain.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortChain.java index 9a34bc6da..a5f9bc34d 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortChain.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortChain.java @@ -19,8 +19,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSFCPortChain extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSFCPortChain extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java index f0d16ca4c..488ae49bc 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java @@ -20,8 +20,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSFCPortPair extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSFCPortPair extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPairGroup.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPairGroup.java index ae0dd35bd..9841a7c49 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPairGroup.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPairGroup.java @@ -17,8 +17,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSFCPortPairGroup extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSFCPortPairGroup extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Networking SFC (networking-sfc) Port Pair Group API v1.0 diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityGroup.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityGroup.java index f0cab37d9..527fc21ed 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityGroup.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityGroup.java @@ -28,8 +28,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSecurityGroup extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSecurityGroup extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "name") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityRule.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityRule.java index db2d4d90e..87f33ce4d 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityRule.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSecurityRule.java @@ -34,8 +34,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSecurityRule extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSecurityRule extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; @XmlElement(name = "direction") diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java index 4b4b3f020..0c9cf9de3 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java @@ -27,8 +27,8 @@ import org.slf4j.LoggerFactory; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) - -public class NeutronSubnet extends NeutronObject implements Serializable, INeutronObject { +public class NeutronSubnet extends NeutronObject + implements Serializable, INeutronObject { private static final Logger LOGGER = LoggerFactory.getLogger(NeutronCRUDInterfaces.class); private static final long serialVersionUID = 1L; diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIKEPolicy.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIKEPolicy.java index 54ec75e50..4685298aa 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIKEPolicy.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIKEPolicy.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronVPNIKEPolicy extends NeutronObject implements Serializable, INeutronObject { +public class NeutronVPNIKEPolicy extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECPolicy.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECPolicy.java index eee86a670..845a42b04 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECPolicy.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECPolicy.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronVPNIPSECPolicy extends NeutronObject implements Serializable, INeutronObject { +public class NeutronVPNIPSECPolicy extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnection.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnection.java index aa14c704a..b9db653da 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnection.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnection.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronVPNIPSECSiteConnection extends NeutronObject implements Serializable, INeutronObject { +public class NeutronVPNIPSECSiteConnection extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNService.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNService.java index 432c994ec..2769c6c7c 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNService.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNService.java @@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronVPNService extends NeutronObject implements Serializable, INeutronObject { +public class NeutronVPNService extends NeutronObject + implements Serializable, INeutronObject { private static final long serialVersionUID = 1L; // See OpenStack Network API v2.0 Reference for description of diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java index 10508be7e..7577ad7e8 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java @@ -16,7 +16,7 @@ import org.opendaylight.neutron.spi.INeutronObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public abstract class AbstractNeutronNorthbound, +public abstract class AbstractNeutronNorthbound, NeutronRequest extends INeutronRequest, I extends INeutronCRUD> { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractNeutronNorthbound.class); @@ -36,8 +36,6 @@ public abstract class AbstractNeutronNorthbound fields); - protected abstract NeutronRequest newNeutronRequest(T o); protected abstract I getNeutronCRUD(); @@ -52,7 +50,7 @@ public abstract class AbstractNeutronNorthbound 0) { - return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(extractFields(ans, fields))) + return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(ans.extractFields(fields))) .build(); } else { return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(ans)).build(); diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java index 0594ba80c..7a376b221 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java @@ -12,7 +12,7 @@ import java.lang.reflect.Field; import java.util.List; import org.opendaylight.neutron.spi.INeutronObject; -public interface INeutronRequest { +public interface INeutronRequest> { default T getSingleton() { Class aClass = getClass(); try { diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnsNorthbound.java index 3414e1eef..013274d2c 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnsNorthbound.java @@ -65,11 +65,6 @@ public class NeutronBgpvpnsNorthbound return RESOURCE_NAME; } - @Override - protected NeutronBgpvpn extractFields(NeutronBgpvpn o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronBgpvpnRequest newNeutronRequest(NeutronBgpvpn o) { return new NeutronBgpvpnRequest(o); @@ -133,7 +128,7 @@ public class NeutronBgpvpnsNorthbound && (bAutoAggregate == null || bAutoAggregate.booleanValue() == oSN.isAutoAggregate()) && (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSN, fields)); + ans.add(oSN.extractFields(fields)); } else { ans.add(oSN); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallNorthbound.java index 840030598..21319a63c 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallNorthbound.java @@ -56,11 +56,6 @@ public class NeutronFirewallNorthbound return RESOURCE_NAME; } - @Override - protected NeutronFirewall extractFields(NeutronFirewall o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronFirewallRequest newNeutronRequest(NeutronFirewall o) { return new NeutronFirewallRequest(o); @@ -111,7 +106,7 @@ public class NeutronFirewallNorthbound && (queryFirewallIsShared == null || queryFirewallIsShared.equals(nsg.getFirewallIsShared())) && (queryFirewallPolicyID == null || queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallPolicyNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallPolicyNorthbound.java index 7879f9c8d..533948901 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallPolicyNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallPolicyNorthbound.java @@ -56,11 +56,6 @@ public class NeutronFirewallPolicyNorthbound extends return RESOURCE_NAME; } - @Override - protected NeutronFirewallPolicy extractFields(NeutronFirewallPolicy o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronFirewallPolicyRequest newNeutronRequest(NeutronFirewallPolicy o) { return new NeutronFirewallPolicyRequest(o); @@ -110,7 +105,7 @@ public class NeutronFirewallPolicyNorthbound extends && (querySecurityPolicyIsAudited == null || querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRulesNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRulesNorthbound.java index 7da21c265..7cf05fa76 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRulesNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRulesNorthbound.java @@ -55,11 +55,6 @@ public class NeutronFirewallRulesNorthbound return RESOURCE_NAME; } - @Override - protected NeutronFirewallRule extractFields(NeutronFirewallRule o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronFirewallRuleRequest newNeutronRequest(NeutronFirewallRule o) { return new NeutronFirewallRuleRequest(o); @@ -140,7 +135,7 @@ public class NeutronFirewallRulesNorthbound && (queryFirewallRuleIsEnabled == null || queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) { if (fields.size() > 0) { - ans.add(extractFields(nsr, fields)); + ans.add(nsr.extractFields(fields)); } else { ans.add(nsr); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPsNorthbound.java index d4805f2b8..f720f331c 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPsNorthbound.java @@ -57,11 +57,6 @@ public class NeutronFloatingIPsNorthbound return RESOURCE_NAME; } - @Override - protected NeutronFloatingIP extractFields(NeutronFloatingIP o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronFloatingIPRequest newNeutronRequest(NeutronFloatingIP o) { return new NeutronFloatingIPRequest(o); @@ -139,7 +134,7 @@ public class NeutronFloatingIPsNorthbound && (queryRouterID == null || queryRouterID.equals(oSS.getRouterUUID())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayConnectionNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayConnectionNorthbound.java index 051523f56..ec7c72195 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayConnectionNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayConnectionNorthbound.java @@ -66,11 +66,6 @@ public class NeutronL2gatewayConnectionNorthbound extends AbstractNeutronNorthbo return RESOURCE_NAME; } - @Override - protected NeutronL2gatewayConnection extractFields(NeutronL2gatewayConnection o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronL2gatewayConnectionRequest newNeutronRequest(NeutronL2gatewayConnection o) { return new NeutronL2gatewayConnectionRequest(o); @@ -144,7 +139,7 @@ public class NeutronL2gatewayConnectionNorthbound extends AbstractNeutronNorthbo && (querySegmentID == null || querySegmentID.equals(oSS.getSegmentID())) && (queryPortID == null || queryPortID.equals(oSS.getPortID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayNorthbound.java index f2e03eabe..7dc5f1edd 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronL2gatewayNorthbound.java @@ -64,11 +64,6 @@ public class NeutronL2gatewayNorthbound return RESOURCE_NAME; } - @Override - protected NeutronL2gateway extractFields(NeutronL2gateway o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronL2gatewayRequest newNeutronRequest(NeutronL2gateway o) { return new NeutronL2gatewayRequest(o); @@ -140,7 +135,7 @@ public class NeutronL2gatewayNorthbound && (queryNeutronL2gatewayDevice == null || queryNeutronL2gatewayDevice.equals(l2gateway.getNeutronL2gatewayDevices()))) { if (fields.size() > 0) { - ans.add(extractFields(l2gateway, fields)); + ans.add(l2gateway.extractFields(fields)); } else { ans.add(l2gateway); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerHealthMonitorNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerHealthMonitorNorthbound.java index a5334ae5d..c2728f4ab 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerHealthMonitorNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerHealthMonitorNorthbound.java @@ -58,11 +58,6 @@ public class NeutronLoadBalancerHealthMonitorNorthbound return RESOURCE_NAME; } - @Override - protected NeutronLoadBalancerHealthMonitor extractFields(NeutronLoadBalancerHealthMonitor o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronLoadBalancerHealthMonitorRequest newNeutronRequest(NeutronLoadBalancerHealthMonitor o) { return new NeutronLoadBalancerHealthMonitorRequest(o); @@ -136,7 +131,7 @@ public class NeutronLoadBalancerHealthMonitorNorthbound || queryLoadBalancerHealthMonitorIsAdminStateUp .equals(nsg.getLoadBalancerHealthMonitorAdminStateIsUp()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerNorthbound.java index bc5ed89a2..a1a3059b0 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerNorthbound.java @@ -57,11 +57,6 @@ public class NeutronLoadBalancerListenerNorthbound extends AbstractNeutronNorthb return RESOURCE_NAME; } - @Override - protected NeutronLoadBalancerListener extractFields(NeutronLoadBalancerListener o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronLoadBalancerListenerRequest newNeutronRequest(NeutronLoadBalancerListener o) { return new NeutronLoadBalancerListenerRequest(o); @@ -122,7 +117,7 @@ public class NeutronLoadBalancerListenerNorthbound extends AbstractNeutronNorthb && (queryLoadBalancerListenerAdminIsUp == null || queryLoadBalancerListenerAdminIsUp .equals(nsg.getLoadBalancerListenerAdminStateIsUp()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerNorthbound.java index a8c9e39f5..163c52684 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerNorthbound.java @@ -57,11 +57,6 @@ public class NeutronLoadBalancerNorthbound return RESOURCE_NAME; } - @Override - protected NeutronLoadBalancer extractFields(NeutronLoadBalancer o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronLoadBalancerRequest newNeutronRequest(NeutronLoadBalancer o) { return new NeutronLoadBalancerRequest(o); @@ -115,7 +110,7 @@ public class NeutronLoadBalancerNorthbound && (queryLoadBalancerVipSubnet == null || queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolNorthbound.java index 49156a0ab..399d83494 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolNorthbound.java @@ -64,15 +64,6 @@ public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound return RESOURCE_NAME; } - @Override - protected NeutronLoadBalancerPool extractFields(NeutronLoadBalancerPool o, List fields) { - return o.extractFields(fields); - } - - protected NeutronLoadBalancerPoolMember extractFields(NeutronLoadBalancerPoolMember o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronLoadBalancerPoolRequest newNeutronRequest(NeutronLoadBalancerPool o) { return new NeutronLoadBalancerPoolRequest(o); @@ -135,7 +126,7 @@ public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound && (queryLoadBalancerPoolMembers.size() == 0 || queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } @@ -255,7 +246,7 @@ public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound && (queryLoadBalancerPoolMemberSubnetID == null || queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } @@ -293,7 +284,7 @@ public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound if (fields.size() > 0) { return Response.status(HttpURLConnection.HTTP_OK) - .entity(new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build(); + .entity(new NeutronLoadBalancerPoolMemberRequest(ans.extractFields(fields))).build(); } else { return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolMemberRequest(ans)) .build(); diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRulesNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRulesNorthbound.java index 6b4e69cfa..263f2b0a4 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRulesNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRulesNorthbound.java @@ -58,11 +58,6 @@ public class NeutronMeteringLabelRulesNorthbound extends AbstractNeutronNorthbou return RESOURCE_NAME; } - @Override - protected NeutronMeteringLabelRule extractFields(NeutronMeteringLabelRule o, List fields) { - return o.extractFields(fields); - } - @Override protected INeutronMeteringLabelRuleCRUD getNeutronCRUD() { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronMeteringLabelRuleCRUD(this); @@ -112,7 +107,7 @@ public class NeutronMeteringLabelRulesNorthbound extends AbstractNeutronNorthbou || queryRemoteIPPrefix.equals(oSS.getMeteringLabelRuleRemoteIPPrefix())) && (queryLabelID == null || queryLabelID.equals(oSS.getMeteringLabelRuleLabelID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelsNorthbound.java index 4374cc5a1..69d44a5d8 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelsNorthbound.java @@ -58,11 +58,6 @@ public class NeutronMeteringLabelsNorthbound extends return RESOURCE_NAME; } - @Override - protected NeutronMeteringLabel extractFields(NeutronMeteringLabel o, List fields) { - return o.extractFields(fields); - } - @Override protected INeutronMeteringLabelCRUD getNeutronCRUD() { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronMeteringLabelCRUD(this); @@ -109,7 +104,7 @@ public class NeutronMeteringLabelsNorthbound extends && (queryName == null || queryName.equals(oSS.getMeteringLabelName())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNetworksNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNetworksNorthbound.java index 263398a1c..05f03444b 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNetworksNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNetworksNorthbound.java @@ -65,11 +65,6 @@ public class NeutronNetworksNorthbound return RESOURCE_NAME; } - @Override - protected NeutronNetwork extractFields(NeutronNetwork o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronNetworkRequest newNeutronRequest(NeutronNetwork o) { return new NeutronNetworkRequest(o); @@ -143,7 +138,7 @@ public class NeutronNetworksNorthbound && (queryTenantID == null || queryTenantID.equals(oSN.getTenantID())) && (queryQosPolicyId == null || queryQosPolicyId.equals(oSN.getQosPolicyId()))) { if (fields.size() > 0) { - ans.add(extractFields(oSN, fields)); + ans.add(oSN.extractFields(fields)); } else { ans.add(oSN); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortsNorthbound.java index d7f5dbb7a..32ef7dd6f 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortsNorthbound.java @@ -61,11 +61,6 @@ public class NeutronPortsNorthbound return RESOURCE_NAME; } - @Override - protected NeutronPort extractFields(NeutronPort o, List fields) { - return o.extractFields(fields); - } - private NeutronCRUDInterfaces getNeutronInterfaces(boolean needNetworks, boolean needSubnets) { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronPortCRUD(this); if (answer.getPortInterface() == null) { @@ -151,7 +146,7 @@ public class NeutronPortsNorthbound || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled())) && (queryQosPolicyId == null || queryQosPolicyId.equals(oSS.getQosPolicyId()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronQosPolicyNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronQosPolicyNorthbound.java index 78832ea4c..9060f0f33 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronQosPolicyNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronQosPolicyNorthbound.java @@ -39,11 +39,6 @@ public class NeutronQosPolicyNorthbound return RESOURCE_NAME; } - @Override - protected NeutronQosPolicy extractFields(NeutronQosPolicy o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronQosPolicyRequest newNeutronRequest(NeutronQosPolicy o) { return new NeutronQosPolicyRequest(o); @@ -87,7 +82,7 @@ public class NeutronQosPolicyNorthbound && (queryQosPolicyName == null || queryQosPolicyName.equals(nsg.getQosPolicyName())) && (queryQosPolicyIsShared == null || queryQosPolicyIsShared.equals(nsg.getPolicyIsShared()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRoutersNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRoutersNorthbound.java index 5d90070cd..0443007a7 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRoutersNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRoutersNorthbound.java @@ -60,11 +60,6 @@ public class NeutronRoutersNorthbound return RESOURCE_NAME; } - @Override - protected NeutronRouter extractFields(NeutronRouter o, List fields) { - return o.extractFields(fields); - } - private NeutronCRUDInterfaces getNeutronInterfaces(boolean flag) { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronRouterCRUD(this); if (answer.getRouterInterface() == null) { @@ -149,7 +144,7 @@ public class NeutronRoutersNorthbound || queryExternalGatewayInfo.equals(oSS.getExternalGatewayInfo())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifiersNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifiersNorthbound.java index 04d9c3889..3d2227180 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifiersNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifiersNorthbound.java @@ -56,11 +56,6 @@ public class NeutronSFCFlowClassifiersNorthbound extends AbstractNeutronNorthbou return RESOURCE_NAME; } - @Override - protected NeutronSFCFlowClassifier extractFields(NeutronSFCFlowClassifier o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronSFCFlowClassifierRequest newNeutronRequest(NeutronSFCFlowClassifier o) { return new NeutronSFCFlowClassifierRequest(o); @@ -126,7 +121,7 @@ public class NeutronSFCFlowClassifiersNorthbound extends AbstractNeutronNorthbou || queryLogicalDestinationPort.equals(oSFC.getLogicalDestinationPortUUID())) && (queryTenantID == null || queryTenantID.equals(oSFC.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSFC, fields)); + ans.add(oSFC.extractFields(fields)); } else { ans.add(oSFC); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainsNorthbound.java index 8ed8638e3..301515a70 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainsNorthbound.java @@ -57,11 +57,6 @@ public class NeutronSFCPortChainsNorthbound return RESOURCE_NAME; } - @Override - protected NeutronSFCPortChain extractFields(NeutronSFCPortChain o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronSFCPortChainRequest newNeutronRequest(NeutronSFCPortChain o) { return new NeutronSFCPortChainRequest(o); @@ -101,7 +96,7 @@ public class NeutronSFCPortChainsNorthbound && (queryName == null || queryName.equals(oSFCPC.getName())) && (queryTenantID == null || queryTenantID.equals(oSFCPC.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSFCPC, fields)); + ans.add(oSFCPC.extractFields(fields)); } else { ans.add(oSFCPC); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupsNorthbound.java index 3e4712f7e..4b269d8ad 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupsNorthbound.java @@ -57,11 +57,6 @@ public class NeutronSFCPortPairGroupsNorthbound extends AbstractNeutronNorthboun return RESOURCE_NAME; } - @Override - protected NeutronSFCPortPairGroup extractFields(NeutronSFCPortPairGroup o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronSFCPortPairGroupRequest newNeutronRequest(NeutronSFCPortPairGroup o) { return new NeutronSFCPortPairGroupRequest(o); @@ -102,7 +97,7 @@ public class NeutronSFCPortPairGroupsNorthbound extends AbstractNeutronNorthboun && (queryName == null || queryName.equals(oSFCPPG.getName())) && (queryTenantID == null || queryTenantID.equals(oSFCPPG.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSFCPPG, fields)); + ans.add(oSFCPPG.extractFields(fields)); } else { ans.add(oSFCPPG); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairsNorthbound.java index 1d57ecf82..475b89300 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairsNorthbound.java @@ -57,11 +57,6 @@ public class NeutronSFCPortPairsNorthbound return RESOURCE_NAME; } - @Override - protected NeutronSFCPortPair extractFields(NeutronSFCPortPair o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronSFCPortPairRequest newNeutronRequest(NeutronSFCPortPair o) { return new NeutronSFCPortPairRequest(o); @@ -105,7 +100,7 @@ public class NeutronSFCPortPairsNorthbound && (queryEgressPort == null || queryEgressPort.equals(oSFCPP.getEgressPortUUID())) && (queryTenantID == null || queryTenantID.equals(oSFCPP.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSFCPP, fields)); + ans.add(oSFCPP.extractFields(fields)); } else { ans.add(oSFCPP); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupsNorthbound.java index eeb359744..77aba65d3 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupsNorthbound.java @@ -55,11 +55,6 @@ public class NeutronSecurityGroupsNorthbound extends return RESOURCE_NAME; } - @Override - protected NeutronSecurityGroup extractFields(NeutronSecurityGroup o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronSecurityGroupRequest newNeutronRequest(NeutronSecurityGroup o) { return new NeutronSecurityGroupRequest(o); @@ -104,7 +99,7 @@ public class NeutronSecurityGroupsNorthbound extends && (querySecurityGroupName == null || querySecurityGroupName.equals(nsg.getSecurityGroupName())) && (querySecurityTenantID == null || querySecurityTenantID.equals(nsg.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(nsg, fields)); + ans.add(nsg.extractFields(fields)); } else { ans.add(nsg); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRulesNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRulesNorthbound.java index 6acb8e0a5..a05790ac5 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRulesNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRulesNorthbound.java @@ -56,11 +56,6 @@ public class NeutronSecurityRulesNorthbound return RESOURCE_NAME; } - @Override - protected NeutronSecurityRule extractFields(NeutronSecurityRule o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronSecurityRuleRequest newNeutronRequest(NeutronSecurityRule o) { return new NeutronSecurityRuleRequest(o); @@ -126,7 +121,7 @@ public class NeutronSecurityRulesNorthbound || querySecurityRemoteGroupID.equals(nsr.getSecurityRemoteGroupID())) && (querySecurityRuleTenantID == null || querySecurityRuleTenantID.equals(nsr.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(nsr, fields)); + ans.add(nsr.extractFields(fields)); } else { ans.add(nsr); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSubnetsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSubnetsNorthbound.java index 9491947b6..575ab926d 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSubnetsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSubnetsNorthbound.java @@ -60,11 +60,6 @@ public class NeutronSubnetsNorthbound return RESOURCE_NAME; } - @Override - protected NeutronSubnet extractFields(NeutronSubnet o, List fields) { - return o.extractFields(fields); - } - private NeutronCRUDInterfaces getNeutronInterfaces(boolean needNetwork) { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronSubnetCRUD(this); if (answer.getSubnetInterface() == null) { @@ -139,7 +134,7 @@ public class NeutronSubnetsNorthbound && (queryIpV6AddressMode == null || queryIpV6AddressMode.equals(oSS.getIpV6AddressMode())) && (queryIpV6RaMode == null || queryIpV6RaMode.equals(oSS.getIpV6RaMode()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java index cd659fbb5..fa7bdcd84 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java @@ -60,11 +60,6 @@ public class NeutronVPNIKEPoliciesNorthbound return RESOURCE_NAME; } - @Override - protected NeutronVPNIKEPolicy extractFields(NeutronVPNIKEPolicy o, List fields) { - return o.extractFields(fields); - } - @Override protected INeutronVPNIKEPolicyCRUD getNeutronCRUD() { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNIKEPolicyCRUD(this); @@ -122,7 +117,7 @@ public class NeutronVPNIKEPoliciesNorthbound && (queryIKEVersion == null || queryIKEVersion.equals(oSS.getIkeVersion())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java index 0e27a6bb7..80f617652 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java @@ -61,11 +61,6 @@ public class NeutronVPNIPSECPoliciesNorthbound extends return RESOURCE_NAME; } - @Override - protected NeutronVPNIPSECPolicy extractFields(NeutronVPNIPSECPolicy o, List fields) { - return o.extractFields(fields); - } - @Override protected INeutronVPNIPSECPolicyCRUD getNeutronCRUD() { NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNIPSECPolicyCRUD(this); @@ -122,7 +117,7 @@ public class NeutronVPNIPSECPoliciesNorthbound extends && (queryEncapsulationMode == null || queryEncapsulationMode.equals(oSS.getEncapsulationMode())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java index 638f44d13..f9a7daf34 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java @@ -61,11 +61,6 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound extends AbstractNeutronNor return RESOURCE_NAME; } - @Override - protected NeutronVPNIPSECSiteConnection extractFields(NeutronVPNIPSECSiteConnection o, List fields) { - return o.extractFields(fields); - } - @Override protected NeutronVPNIPSECSiteConnectionRequest newNeutronRequest(NeutronVPNIPSECSiteConnection o) { return new NeutronVPNIPSECSiteConnectionRequest(o); @@ -136,7 +131,7 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound extends AbstractNeutronNor && (queryIpSecPolicyID == null || queryIpSecPolicyID.equals(oSS.getIpsecPolicyID())) && (queryVpnServiceID == null || queryVpnServiceID.equals(oSS.getVpnServiceID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java index d27a31a58..9fa3d8840 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java @@ -61,11 +61,6 @@ public class NeutronVPNServicesNorthbound return RESOURCE_NAME; } - @Override - protected NeutronVPNService extractFields(NeutronVPNService o, List fields) { - return o.extractFields(fields); - } - @Context UriInfo uriInfo; @@ -124,7 +119,7 @@ public class NeutronVPNServicesNorthbound && (queryRouterID == null || queryRouterID.equals(oSS.getRouterUUID())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) { if (fields.size() > 0) { - ans.add(extractFields(oSS, fields)); + ans.add(oSS.extractFields(fields)); } else { ans.add(oSS); } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java index bd9a7874a..2952b2903 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java @@ -28,7 +28,7 @@ public final class PaginatedRequestFactory { } }; - public static class PaginationResults { + public static class PaginationResults> { List collection; List links; @@ -38,7 +38,8 @@ public final class PaginatedRequestFactory { } } - private static final class MarkerObject extends NeutronObject implements INeutronObject { + private static final class MarkerObject extends NeutronObject + implements INeutronObject { private final String id; MarkerObject(String id) { @@ -55,6 +56,11 @@ public final class PaginatedRequestFactory { public void setID(String id) { throw new UnsupportedOperationException("Marker has constant ID"); } + + @Override + public MarkerObject extractFields(List fields) { + return null; + } } private PaginatedRequestFactory() { @@ -67,7 +73,7 @@ public final class PaginatedRequestFactory { * FIXME: the only caller performs a cast back, so this is not actually necessary. */ @SuppressWarnings("unchecked") - public static INeutronRequest createRequest(Integer limit, String marker, + public static > INeutronRequest createRequest(Integer limit, String marker, Boolean pageReverse, UriInfo uriInfo, List collection, Class clazz) { PaginationResults results = paginate(limit, marker, pageReverse, uriInfo, collection); @@ -85,7 +91,7 @@ public final class PaginatedRequestFactory { return null; } - private static PaginationResults paginate(Integer limit, String marker, + private static > PaginationResults paginate(Integer limit, String marker, Boolean pageReverse, UriInfo uriInfo, List collection) { List links = new ArrayList<>(); final int startPos; diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java index 10076a148..31d16d06c 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java @@ -37,7 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class AbstractNeutronInterface & Augmentable, S extends INeutronObject> + U extends ChildOf & Augmentable, S extends INeutronObject> implements AutoCloseable, INeutronCRUD { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractNeutronInterface.class); private static final int DEDASHED_UUID_LENGTH = 32; -- 2.36.6