Checkstyle formatting issues fix (Northbound API) 92/43892/2
authorRitu Sood <ritu.sood@intel.com>
Fri, 12 Aug 2016 01:30:28 +0000 (18:30 -0700)
committerRitu Sood <ritu.sood@intel.com>
Fri, 12 Aug 2016 05:27:12 +0000 (22:27 -0700)
Patch fixes WhitespaceAround, ArrayTypeStyle, OperatorWrap,
LineLength and other formatting checkstyle issues for
northbound api files.

Change-Id: I11123566ee4d96f3310c74834e9d0977af80f8f8
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
65 files changed:
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/INeutronRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/InternalServerErrorException.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnRequest.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/NeutronFirewallPolicyRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRuleRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallRulesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPRequest.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/NeutronLoadBalancerHealthMonitorRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerListenerRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolMemberRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerPoolRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronLoadBalancerRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronMeteringLabelRuleRequest.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/NeutronNetworkRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNetworksNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPageLink.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronPortsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronQosPolicyNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRouterRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronRoutersNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifierRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCFlowClassifiersNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortChainsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairGroupsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSFCPortPairsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityGroupsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRuleRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSecurityRulesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSubnetRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronSubnetsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPolicyRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPolicyRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServiceRequest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNServicesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ResourceConflictException.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ResourceNotFoundException.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/RestMessages.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/ServiceUnavailableException.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/UnimplementedException.java

index a62a26884944a6ebc3da1687da89249302552669..10508be7e1ab15454af9a57b7e1177ac319de173 100644 (file)
@@ -16,9 +16,9 @@ import org.opendaylight.neutron.spi.INeutronObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractNeutronNorthbound<T extends INeutronObject, NeutronRequest extends INeutronRequest<T>, I extends INeutronCRUD<T>> {
-    private static final Logger LOGGER = LoggerFactory
-        .getLogger(AbstractNeutronNorthbound.class);
+public abstract class AbstractNeutronNorthbound<T extends INeutronObject, NeutronRequest extends INeutronRequest<T>,
+        I extends INeutronCRUD<T>> {
+    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractNeutronNorthbound.class);
 
     protected static final int HTTP_OK_BOTTOM = 200;
     protected static final int HTTP_OK_TOP = 299;
@@ -35,13 +35,16 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject, Neutro
     }
 
     protected abstract String getResourceName();
+
     protected abstract T extractFields(T o, List<String> fields);
+
     protected abstract NeutronRequest newNeutronRequest(T o);
+
     protected abstract I getNeutronCRUD();
 
     protected Response show(String uuid,
-                            // return fields
-                            List<String> fields) {
+            // return fields
+            List<String> fields) {
         I neutronCRUD = getNeutronCRUD();
         T ans = neutronCRUD.get(uuid);
         if (ans == null) {
@@ -49,8 +52,8 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject, Neutro
         }
 
         if (fields.size() > 0) {
-            return Response.status(HttpURLConnection.HTTP_OK).entity(
-                    newNeutronRequest(extractFields(ans, fields))).build();
+            return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(extractFields(ans, fields)))
+                    .build();
         } else {
             return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(ans)).build();
         }
@@ -111,10 +114,8 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject, Neutro
         try {
             exist = neutronCRUD.remove(uuid);
         } catch (Exception e) {
-            LOGGER.debug("exception during remove {} {} {}",
-                         resourceName, uuid, e);
-            throw new InternalServerErrorException("Could not delete " +
-                                                   resourceName);
+            LOGGER.debug("exception during remove {} {} {}", resourceName, uuid, e);
+            throw new InternalServerErrorException("Could not delete " + resourceName);
         }
         if (!exist) {
             throw new ResourceNotFoundException(uuidNoExist());
index 30956c0a808246b04527d34969b9a1f8afb2c2bc..5a1f10f0117bf2dbc58f81b84ff11de5c5f2f76c 100644 (file)
@@ -13,6 +13,8 @@ import org.opendaylight.neutron.spi.INeutronObject;
 
 public interface INeutronRequest<T extends INeutronObject> {
     T getSingleton();
+
     boolean isSingleton();
+
     List<T> getBulk();
 }
index 129f67c12abbd3b504a06c1b8633c05e51f97dad..b924baf1ab10776b38a905f533b9b02b262ae1a4 100644 (file)
@@ -32,7 +32,6 @@ public class InternalServerErrorException extends WebApplicationException {
      *
      */
     public InternalServerErrorException(String string) {
-        super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
-                string).type(MediaType.TEXT_PLAIN).build());
+        super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(string).type(MediaType.TEXT_PLAIN).build());
     }
 }
index 679dd0c1ec4ceaf6a12770f6e409567b867bff60..347a4dbaa69ca866836e698727ce2b2501f4088d 100644 (file)
@@ -21,13 +21,12 @@ public class NeutronBgpvpnRequest implements INeutronRequest<NeutronBgpvpn> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="bgpvpn")
+    @XmlElement(name = "bgpvpn")
     NeutronBgpvpn singletonBgpvpn;
 
-    @XmlElement(name="bgpvpns")
+    @XmlElement(name = "bgpvpns")
     List<NeutronBgpvpn> bulkRequest;
 
-
     NeutronBgpvpnRequest() {
     }
 
index 4d1b9eaf5dcf48ca21d0c55496a37a0a1a6b48f4..3414e1eef00859e4fd98ebc1a35ceddab8f68644 100644 (file)
@@ -53,7 +53,7 @@ import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 
 @Path("/bgpvpns")
 public class NeutronBgpvpnsNorthbound
-    extends AbstractNeutronNorthbound<NeutronBgpvpn, NeutronBgpvpnRequest, INeutronBgpvpnCRUD> {
+        extends AbstractNeutronNorthbound<NeutronBgpvpn, NeutronBgpvpnRequest, INeutronBgpvpnCRUD> {
 
     @Context
     UriInfo uriInfo;
@@ -90,11 +90,10 @@ public class NeutronBgpvpnsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackBgpvpns.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listBgpvpns(
             // return fields
             @QueryParam("fields") List<String> fields,
@@ -110,11 +109,11 @@ public class NeutronBgpvpnsNorthbound
             @QueryParam("limit") Integer limit,
             @QueryParam("marker") String marker,
             @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
+    // sorting not supported
+    ) {
         INeutronBgpvpnCRUD bgpvpnInterface = getNeutronCRUD();
         List<NeutronBgpvpn> allBgpvpns = bgpvpnInterface.getAll();
-        List<NeutronBgpvpn> ans = new ArrayList<NeutronBgpvpn>();
+        List<NeutronBgpvpn> ans = new ArrayList<>();
         Iterator<NeutronBgpvpn> i = allBgpvpns.iterator();
         while (i.hasNext()) {
             NeutronBgpvpn oSN = i.next();
@@ -127,14 +126,14 @@ public class NeutronBgpvpnsNorthbound
             if (queryAutoAggregate != null) {
                 bAutoAggregate = Boolean.valueOf(queryAutoAggregate);
             }
-            if ((queryID == null || queryID.equals(oSN.getID())) &&
-                    (queryName == null || queryName.equals(oSN.getBgpvpnName())) &&
-                    (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp()) &&
-                    (queryStatus == null || queryStatus.equals(oSN.getStatus())) &&
-                    (bAutoAggregate == null || bAutoAggregate.booleanValue() == oSN.isAutoAggregate()) &&
-                    (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSN.getID()))
+                    && (queryName == null || queryName.equals(oSN.getBgpvpnName()))
+                    && (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp())
+                    && (queryStatus == null || queryStatus.equals(oSN.getStatus()))
+                    && (bAutoAggregate == null || bAutoAggregate.booleanValue() == oSN.isAutoAggregate())
+                    && (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSN,fields));
+                    ans.add(extractFields(oSN, fields));
                 } else {
                     ans.add(oSN);
                 }
@@ -143,12 +142,12 @@ public class NeutronBgpvpnsNorthbound
 
         if (limit != null && ans.size() > 1) {
             // Return a paginated request
-            NeutronBgpvpnRequest request = (NeutronBgpvpnRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronBgpvpn.class);
+            NeutronBgpvpnRequest request = (NeutronBgpvpnRequest) PaginatedRequestFactory.createRequest(limit, marker,
+                    pageReverse, uriInfo, ans, NeutronBgpvpn.class);
             return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
         }
 
-    return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronBgpvpnRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronBgpvpnRequest(ans)).build();
 
     }
 
@@ -159,17 +158,14 @@ public class NeutronBgpvpnsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackBgpvpns.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showBgpvpn(
-            @PathParam("bgpvpnUUID") String bgpvpnUUID,
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response showBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID,
             // return fields
-            @QueryParam("fields") List<String> fields
-            ) {
+            @QueryParam("fields") List<String> fields) {
         return show(bgpvpnUUID, fields);
     }
 
@@ -179,9 +175,8 @@ public class NeutronBgpvpnsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     @TypeHint(NeutronBgpvpn.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createBgpvpns(final NeutronBgpvpnRequest input) {
         return create(input);
     }
@@ -189,8 +184,7 @@ public class NeutronBgpvpnsNorthbound
     /**
      * Updates a Bgpvpn */
     @Override
-    protected void updateDelta(String uuid,
-                               NeutronBgpvpn delta, NeutronBgpvpn original) {
+    protected void updateDelta(String uuid, NeutronBgpvpn delta, NeutronBgpvpn original) {
         //Fill in defaults if they're missing in update
         delta.initDefaults();
         delta.setID(uuid);
@@ -202,13 +196,10 @@ public class NeutronBgpvpnsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackBgpvpns.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateBgpvpn(
-            @PathParam("bgpvpnUUID") String bgpvpnUUID, final NeutronBgpvpnRequest input
-            ) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response updateBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID, final NeutronBgpvpnRequest input) {
         return update(bgpvpnUUID, input);
     }
 
@@ -217,12 +208,10 @@ public class NeutronBgpvpnsNorthbound
 
     @Path("{bgpvpnUUID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteBgpvpn(
-            @PathParam("bgpvpnUUID") String bgpvpnUUID) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deleteBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID) {
         return delete(bgpvpnUUID);
     }
 }
index 53864f646faacac78a286de7a2f4e6eeee37d28b..84003059878c8528df107385820f6da1d261f1d9 100644 (file)
@@ -47,7 +47,7 @@ import org.opendaylight.neutron.spi.NeutronFirewall;
  */
 @Path("/fw/firewalls")
 public class NeutronFirewallNorthbound
-    extends AbstractNeutronNorthbound<NeutronFirewall, NeutronFirewallRequest, INeutronFirewallCRUD> {
+        extends AbstractNeutronNorthbound<NeutronFirewall, NeutronFirewallRequest, INeutronFirewallCRUD> {
 
     private static final String RESOURCE_NAME = "Firewall";
 
@@ -79,8 +79,7 @@ public class NeutronFirewallNorthbound
      * Returns a list of all Firewalls */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -99,33 +98,27 @@ public class NeutronFirewallNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronFirewallCRUD firewallInterface = getNeutronCRUD();
-        List<NeutronFirewall> ans = new ArrayList<NeutronFirewall>();
+        List<NeutronFirewall> ans = new ArrayList<>();
         for (NeutronFirewall nsg : firewallInterface.getAll()) {
-            if ((queryFirewallUUID == null ||
-                queryFirewallUUID.equals(nsg.getID())) &&
-                (queryFirewallTenantID == null ||
-                    queryFirewallTenantID.equals(nsg.getTenantID())) &&
-                (queryFirewallName == null ||
-                    queryFirewallName.equals(nsg.getFirewallName())) &&
-                (queryFirewallAdminStateIsUp == null ||
-                    queryFirewallAdminStateIsUp.equals(nsg.getFirewallAdminStateIsUp())) &&
-                (queryFirewallIsShared == null ||
-                    queryFirewallIsShared.equals(nsg.getFirewallIsShared())) &&
-                (queryFirewallPolicyID == null ||
-                    queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) {
+            if ((queryFirewallUUID == null || queryFirewallUUID.equals(nsg.getID()))
+                    && (queryFirewallTenantID == null || queryFirewallTenantID.equals(nsg.getTenantID()))
+                    && (queryFirewallName == null || queryFirewallName.equals(nsg.getFirewallName()))
+                    && (queryFirewallAdminStateIsUp == null
+                            || queryFirewallAdminStateIsUp.equals(nsg.getFirewallAdminStateIsUp()))
+                    && (queryFirewallIsShared == null || queryFirewallIsShared.equals(nsg.getFirewallIsShared()))
+                    && (queryFirewallPolicyID == null || queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
+                    ans.add(extractFields(nsg, fields));
                 } else {
                     ans.add(nsg);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronFirewallRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFirewallRequest(ans)).build();
     }
 
     /**
@@ -134,15 +127,14 @@ public class NeutronFirewallNorthbound
     @Path("{firewallUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response showFirewall(@PathParam("firewallUUID") String firewallUUID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
+            // return fields
+            @QueryParam("fields") List<String> fields) {
         return show(firewallUUID, fields);
     }
 
@@ -152,8 +144,7 @@ public class NeutronFirewallNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createFirewalls(final NeutronFirewallRequest input) {
         return create(input);
@@ -166,12 +157,10 @@ public class NeutronFirewallNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateFirewall(
-            @PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
+    public Response updateFirewall(@PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
         return update(firewallUUID, input);
     }
 
@@ -180,12 +169,10 @@ public class NeutronFirewallNorthbound
 
     @Path("{firewallUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteFirewall(
-            @PathParam("firewallUUID") String firewallUUID) {
+    public Response deleteFirewall(@PathParam("firewallUUID") String firewallUUID) {
         return delete(firewallUUID);
     }
 }
index 2264cb305bfff739eb218737c977ac28f15c31be..7879f9c8d43ab6c5c87beae4e5fb53bdb6a4560a 100644 (file)
@@ -46,8 +46,8 @@ import org.opendaylight.neutron.spi.NeutronFirewallPolicy;
  *
  */
 @Path("/fw/firewall_policies")
-public class NeutronFirewallPolicyNorthbound
-    extends AbstractNeutronNorthbound<NeutronFirewallPolicy, NeutronFirewallPolicyRequest, INeutronFirewallPolicyCRUD> {
+public class NeutronFirewallPolicyNorthbound extends
+        AbstractNeutronNorthbound<NeutronFirewallPolicy, NeutronFirewallPolicyRequest, INeutronFirewallPolicyCRUD> {
 
     private static final String RESOURCE_NAME = "Firewall Policy";
 
@@ -79,8 +79,7 @@ public class NeutronFirewallPolicyNorthbound
      * Returns a list of all Firewall Policies */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -98,31 +97,27 @@ public class NeutronFirewallPolicyNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronFirewallPolicyCRUD firewallPolicyInterface = getNeutronCRUD();
-        List<NeutronFirewallPolicy> ans = new ArrayList<NeutronFirewallPolicy>();
+        List<NeutronFirewallPolicy> ans = new ArrayList<>();
         for (NeutronFirewallPolicy nsg : firewallPolicyInterface.getAll()) {
-            if ((queryFirewallPolicyUUID == null ||
-                queryFirewallPolicyUUID.equals(nsg.getID())) &&
-                (queryFirewallPolicyTenantID == null ||
-                    queryFirewallPolicyTenantID.equals(nsg.getTenantID())) &&
-                (queryFirewallPolicyName == null ||
-                    queryFirewallPolicyName.equals(nsg.getFirewallPolicyName())) &&
-                (querySecurityPolicyIsShared == null ||
-                    querySecurityPolicyIsShared.equals(nsg.getFirewallPolicyIsShared())) &&
-                (querySecurityPolicyIsAudited == null ||
-                    querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) {
+            if ((queryFirewallPolicyUUID == null || queryFirewallPolicyUUID.equals(nsg.getID()))
+                    && (queryFirewallPolicyTenantID == null || queryFirewallPolicyTenantID.equals(nsg.getTenantID()))
+                    && (queryFirewallPolicyName == null || queryFirewallPolicyName.equals(nsg.getFirewallPolicyName()))
+                    && (querySecurityPolicyIsShared == null
+                            || querySecurityPolicyIsShared.equals(nsg.getFirewallPolicyIsShared()))
+                    && (querySecurityPolicyIsAudited == null
+                            || querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
+                    ans.add(extractFields(nsg, fields));
                 } else {
                     ans.add(nsg);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronFirewallPolicyRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFirewallPolicyRequest(ans)).build();
     }
 
     /**
@@ -131,15 +126,14 @@ public class NeutronFirewallPolicyNorthbound
     @Path("{firewallPolicyUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response showFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
+            // return fields
+            @QueryParam("fields") List<String> fields) {
         return show(firewallPolicyUUID, fields);
     }
 
@@ -149,8 +143,7 @@ public class NeutronFirewallPolicyNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createFirewallPolicies(final NeutronFirewallPolicyRequest input) {
         return create(input);
@@ -164,12 +157,11 @@ public class NeutronFirewallPolicyNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateFirewallPolicy(
-            @PathParam("firewallPolicyUUID") String firewallPolicyUUID, final NeutronFirewallPolicyRequest input) {
+    public Response updateFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
+            final NeutronFirewallPolicyRequest input) {
         return update(firewallPolicyUUID, input);
     }
 
@@ -178,12 +170,10 @@ public class NeutronFirewallPolicyNorthbound
 
     @Path("{firewallPolicyUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteFirewallPolicy(
-            @PathParam("firewallPolicyUUID") String firewallPolicyUUID) {
+    public Response deleteFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID) {
         return delete(firewallPolicyUUID);
     }
 }
index 44a4d8cd82d582b271330c3fc7dc55e48e6913e1..7f83aebe4a372d3418a9aa0b6b97159b1ad7c732 100644 (file)
@@ -15,22 +15,20 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronFirewallPolicy;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronFirewallPolicyRequest
-    implements INeutronRequest<NeutronFirewallPolicy> {
+public class NeutronFirewallPolicyRequest implements INeutronRequest<NeutronFirewallPolicy> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      *
      */
 
-    @XmlElement(name="firewall_policy")
+    @XmlElement(name = "firewall_policy")
     NeutronFirewallPolicy singletonFirewallPolicy;
 
-    @XmlElement(name="firewall_policies")
+    @XmlElement(name = "firewall_policies")
     List<NeutronFirewallPolicy> bulkRequest;
 
     NeutronFirewallPolicyRequest() {
index 398191e3b7007c48082f013cedf21d2c54f176d5..d19bf1847749639a8fcd5978c034c5b1d4281e26 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronFirewall;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronFirewallRequest
-    implements INeutronRequest<NeutronFirewall> {
+public class NeutronFirewallRequest implements INeutronRequest<NeutronFirewall> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      */
 
-    @XmlElement(name="firewall")
+    @XmlElement(name = "firewall")
     NeutronFirewall singletonFirewall;
 
-    @XmlElement(name="firewalls")
+    @XmlElement(name = "firewalls")
     List<NeutronFirewall> bulkRequest;
 
     NeutronFirewallRequest() {
index 64b23cb5fb5894559803dd357e360bd595dd870a..8331a86bca2642776ada7672cee9fd8cd943958e 100644 (file)
@@ -15,22 +15,20 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronFirewallRule;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronFirewallRuleRequest
-    implements INeutronRequest<NeutronFirewallRule> {
+public class NeutronFirewallRuleRequest implements INeutronRequest<NeutronFirewallRule> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      *
      */
 
-    @XmlElement(name="firewall_rule")
+    @XmlElement(name = "firewall_rule")
     NeutronFirewallRule singletonFirewallRule;
 
-    @XmlElement(name="firewall_rules")
+    @XmlElement(name = "firewall_rules")
     List<NeutronFirewallRule> bulkRequest;
 
     NeutronFirewallRuleRequest() {
index 6955cbe1c85dc2a5982b59b90822cc6a6d9d6f35..7da21c265a33b68616845dc91ba26d637c2c3459 100644 (file)
@@ -47,7 +47,7 @@ import org.opendaylight.neutron.spi.NeutronFirewallRule;
 
 @Path("fw/firewall_rules")
 public class NeutronFirewallRulesNorthbound
-    extends AbstractNeutronNorthbound<NeutronFirewallRule, NeutronFirewallRuleRequest, INeutronFirewallRuleCRUD> {
+        extends AbstractNeutronNorthbound<NeutronFirewallRule, NeutronFirewallRuleRequest, INeutronFirewallRuleCRUD> {
     private static final String RESOURCE_NAME = "Firewall Rule";
 
     @Override
@@ -78,9 +78,8 @@ public class NeutronFirewallRulesNorthbound
      * Returns a list of all Firewall Rules
      */
     @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -108,43 +107,38 @@ public class NeutronFirewallRulesNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronFirewallRuleCRUD firewallRuleInterface = getNeutronCRUD();
-        List<NeutronFirewallRule> ans = new ArrayList<NeutronFirewallRule>();
+        List<NeutronFirewallRule> ans = new ArrayList<>();
         for (NeutronFirewallRule nsr : firewallRuleInterface.getAll()) {
-            if ((queryFirewallRuleUUID == null ||
-                    queryFirewallRuleUUID.equals(nsr.getID())) &&
-                    (queryFirewallRuleTenantID == null ||
-                            queryFirewallRuleTenantID.equals(nsr.getTenantID())) &&
-                    (queryFirewallRuleName == null ||
-                            queryFirewallRuleName.equals(nsr.getFirewallRuleName())) &&
-                    (queryFirewallRuleIsShared == null ||
-                            queryFirewallRuleIsShared.equals(nsr.getFirewallRuleIsShared())) &&
-                    (queryFirewallRulePolicyID == null ||
-                            queryFirewallRulePolicyID.equals(nsr.getFirewallRulePolicyID())) &&
-                    (queryFirewallRuleProtocol == null ||
-                            queryFirewallRuleProtocol.equals(nsr.getFirewallRuleProtocol())) &&
-                    (queryFirewallRuleIpVer == null ||
-                            queryFirewallRuleIpVer.equals(nsr.getFirewallRuleIpVer())) &&
-                    (queryFirewallRuleSrcIpAddr == null ||
-                            queryFirewallRuleSrcIpAddr.equals(nsr.getFirewallRuleSrcIpAddr())) &&
-                    (queryFirewallRuleDstIpAddr == null ||
-                            queryFirewallRuleDstIpAddr.equals(nsr.getFirewallRuleDstIpAddr())) &&
-                    (queryFirewallRuleSrcPortRangeMin == null ||
-                            queryFirewallRuleSrcPortRangeMin.equals(nsr.getFirewallRuleSrcPortRangeMin())) &&
-                    (queryFirewallRuleSrcPortRangeMax == null ||
-                            queryFirewallRuleSrcPortRangeMax.equals(nsr.getFirewallRuleSrcPortRangeMax())) &&
-                    (queryFirewallRuleDstPortRangeMin == null ||
-                            queryFirewallRuleDstPortRangeMin.equals(nsr.getFirewallRuleDstPortRangeMin())) &&
-                    (queryFirewallRuleDstPortRangeMax == null ||
-                            queryFirewallRuleDstPortRangeMax.equals(nsr.getFirewallRuleDstPortRangeMax())) &&
-                    (queryFirewallRulePosition == null ||
-                            queryFirewallRulePosition.equals(nsr.getFirewallRulePosition())) &&
-                    (queryFirewallRuleAction == null ||
-                            queryFirewallRuleAction.equals(nsr.getFirewallRuleAction())) &&
-                    (queryFirewallRuleIsEnabled == null ||
-                            queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) {
+            if ((queryFirewallRuleUUID == null || queryFirewallRuleUUID.equals(nsr.getID()))
+                    && (queryFirewallRuleTenantID == null || queryFirewallRuleTenantID.equals(nsr.getTenantID()))
+                    && (queryFirewallRuleName == null || queryFirewallRuleName.equals(nsr.getFirewallRuleName()))
+                    && (queryFirewallRuleIsShared == null
+                            || queryFirewallRuleIsShared.equals(nsr.getFirewallRuleIsShared()))
+                    && (queryFirewallRulePolicyID == null
+                            || queryFirewallRulePolicyID.equals(nsr.getFirewallRulePolicyID()))
+                    && (queryFirewallRuleProtocol == null
+                            || queryFirewallRuleProtocol.equals(nsr.getFirewallRuleProtocol()))
+                    && (queryFirewallRuleIpVer == null || queryFirewallRuleIpVer.equals(nsr.getFirewallRuleIpVer()))
+                    && (queryFirewallRuleSrcIpAddr == null
+                            || queryFirewallRuleSrcIpAddr.equals(nsr.getFirewallRuleSrcIpAddr()))
+                    && (queryFirewallRuleDstIpAddr == null
+                            || queryFirewallRuleDstIpAddr.equals(nsr.getFirewallRuleDstIpAddr()))
+                    && (queryFirewallRuleSrcPortRangeMin == null
+                            || queryFirewallRuleSrcPortRangeMin.equals(nsr.getFirewallRuleSrcPortRangeMin()))
+                    && (queryFirewallRuleSrcPortRangeMax == null
+                            || queryFirewallRuleSrcPortRangeMax.equals(nsr.getFirewallRuleSrcPortRangeMax()))
+                    && (queryFirewallRuleDstPortRangeMin == null
+                            || queryFirewallRuleDstPortRangeMin.equals(nsr.getFirewallRuleDstPortRangeMin()))
+                    && (queryFirewallRuleDstPortRangeMax == null
+                            || queryFirewallRuleDstPortRangeMax.equals(nsr.getFirewallRuleDstPortRangeMax()))
+                    && (queryFirewallRulePosition == null
+                            || queryFirewallRulePosition.equals(nsr.getFirewallRulePosition()))
+                    && (queryFirewallRuleAction == null || queryFirewallRuleAction.equals(nsr.getFirewallRuleAction()))
+                    && (queryFirewallRuleIsEnabled == null
+                            || queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) {
                 if (fields.size() > 0) {
                     ans.add(extractFields(nsr, fields));
                 } else {
@@ -153,8 +147,7 @@ public class NeutronFirewallRulesNorthbound
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronFirewallRuleRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFirewallRuleRequest(ans)).build();
     }
 
     /**
@@ -163,9 +156,8 @@ public class NeutronFirewallRulesNorthbound
 
     @Path("{firewallRuleUUID}")
     @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@@ -181,10 +173,9 @@ public class NeutronFirewallRulesNorthbound
      */
 
     @POST
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createFirewallRules(final NeutronFirewallRuleRequest input) {
         return create(input);
@@ -195,14 +186,13 @@ public class NeutronFirewallRulesNorthbound
      */
     @Path("{firewallRuleUUID}")
     @PUT
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateFirewallRule(
-            @PathParam("firewallRuleUUID") String firewallRuleUUID, final NeutronFirewallRuleRequest input) {
+    public Response updateFirewallRule(@PathParam("firewallRuleUUID") String firewallRuleUUID,
+            final NeutronFirewallRuleRequest input) {
         return update(firewallRuleUUID, input);
     }
 
@@ -212,12 +202,10 @@ public class NeutronFirewallRulesNorthbound
 
     @Path("{firewallRuleUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteFirewallRule(
-            @PathParam("firewallRuleUUID") String firewallRuleUUID) {
+    public Response deleteFirewallRule(@PathParam("firewallRuleUUID") String firewallRuleUUID) {
         return delete(firewallRuleUUID);
     }
 }
index bfacd729fbd76b91cbf73a7b4c2fdb00047f7646..18a5d62dde0257bb7828ab4215414741c30ba600 100644 (file)
@@ -17,15 +17,14 @@ import org.opendaylight.neutron.spi.NeutronFloatingIP;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFloatingIPRequest
-    implements INeutronRequest<NeutronFloatingIP> {
+public class NeutronFloatingIPRequest implements INeutronRequest<NeutronFloatingIP> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="floatingip")
+    @XmlElement(name = "floatingip")
     NeutronFloatingIP singletonFloatingIP;
 
-    @XmlElement(name="floatingips")
+    @XmlElement(name = "floatingips")
     List<NeutronFloatingIP> bulkRequest;
 
     NeutronFloatingIPRequest() {
index 6f8c8bf6e831456b022642b723c0a46a9a735def..d4805f2b83c4bcae031d8311d5bcce2b12bb5e11 100644 (file)
@@ -49,7 +49,7 @@ import org.opendaylight.neutron.spi.NeutronFloatingIP;
 
 @Path("/floatingips")
 public class NeutronFloatingIPsNorthbound
-    extends AbstractNeutronNorthbound<NeutronFloatingIP, NeutronFloatingIPRequest, INeutronFloatingIPCRUD> {
+        extends AbstractNeutronNorthbound<NeutronFloatingIP, NeutronFloatingIPRequest, INeutronFloatingIPCRUD> {
     private static final String RESOURCE_NAME = "Floating IP";
 
     @Override
@@ -75,16 +75,16 @@ public class NeutronFloatingIPsNorthbound
         if (flag) {
             answer = answer.fetchINeutronNetworkCRUD(this).fetchINeutronSubnetCRUD(this).fetchINeutronPortCRUD(this);
             if (answer.getNetworkInterface() == null) {
-                throw new ServiceUnavailableException("Network CRUD Interface "
-                        + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
             if (answer.getSubnetInterface() == null) {
-                throw new ServiceUnavailableException("Subnet CRUD Interface "
-                        + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
             if (answer.getPortInterface() == null) {
-                throw new ServiceUnavailableException("Port CRUD Interface "
-                        + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
         }
         return answer;
@@ -101,8 +101,7 @@ public class NeutronFloatingIPsNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -122,33 +121,32 @@ public class NeutronFloatingIPsNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-            ) {
+    // sorting not supported
+    ) {
         INeutronFloatingIPCRUD floatingIPInterface = getNeutronInterfaces(false).getFloatingIPInterface();
         List<NeutronFloatingIP> allFloatingIPs = floatingIPInterface.getAll();
-        List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
+        List<NeutronFloatingIP> ans = new ArrayList<>();
         Iterator<NeutronFloatingIP> i = allFloatingIPs.iterator();
         while (i.hasNext()) {
             NeutronFloatingIP oSS = i.next();
             //match filters: TODO provider extension and router extension
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID())) &&
-                    (queryPortId == null || queryPortId.equals(oSS.getPortUUID())) &&
-                    (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress())) &&
-                    (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress())) &&
-                    (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
-                    (queryRouterID == null || queryRouterID.equals(oSS.getRouterUUID())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID()))
+                    && (queryPortId == null || queryPortId.equals(oSS.getPortUUID()))
+                    && (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress()))
+                    && (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress()))
+                    && (queryStatus == null || queryStatus.equals(oSS.getStatus()))
+                    && (queryRouterID == null || queryRouterID.equals(oSS.getRouterUUID()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronFloatingIPRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFloatingIPRequest(ans)).build();
     }
 
     /**
@@ -157,16 +155,14 @@ public class NeutronFloatingIPsNorthbound
     @Path("{floatingipUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID,
+    public Response showFloatingIP(@PathParam("floatingipUUID") String floatingipUUID,
             // return fields
-            @QueryParam("fields") List<String> fields ) {
+            @QueryParam("fields") List<String> fields) {
         return show(floatingipUUID, fields);
     }
 
@@ -176,9 +172,8 @@ public class NeutronFloatingIPsNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createFloatingIPs(final NeutronFloatingIPRequest input) {
         return create(input);
     }
@@ -190,14 +185,11 @@ public class NeutronFloatingIPsNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID,
-            NeutronFloatingIPRequest input
-            ) {
+    public Response updateFloatingIP(@PathParam("floatingipUUID") String floatingipUUID,
+            NeutronFloatingIPRequest input) {
         return update(floatingipUUID, input);
     }
 
@@ -206,12 +198,10 @@ public class NeutronFloatingIPsNorthbound
 
     @Path("{floatingipUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID) {
+    public Response deleteFloatingIP(@PathParam("floatingipUUID") String floatingipUUID) {
         return delete(floatingipUUID);
     }
 }
index 3e4218b43e9304b29b649034df7b88e6efc47e01..051523f562e93611d21f464247e2914d0c8570e7 100644 (file)
@@ -49,9 +49,9 @@ import org.slf4j.LoggerFactory;
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
  */
 
-@Path ("/l2gateway-connections")
-public class NeutronL2gatewayConnectionNorthbound
-    extends AbstractNeutronNorthbound<NeutronL2gatewayConnection, NeutronL2gatewayConnectionRequest, INeutronL2gatewayConnectionCRUD> {
+@Path("/l2gateway-connections")
+public class NeutronL2gatewayConnectionNorthbound extends AbstractNeutronNorthbound<NeutronL2gatewayConnection,
+        NeutronL2gatewayConnectionRequest, INeutronL2gatewayConnectionCRUD> {
 
     static final Logger logger = LoggerFactory.getLogger(NeutronL2gatewayConnectionNorthbound.class);
 
@@ -67,8 +67,7 @@ public class NeutronL2gatewayConnectionNorthbound
     }
 
     @Override
-    protected NeutronL2gatewayConnection extractFields(NeutronL2gatewayConnection o,
-                                                     List<String> fields) {
+    protected NeutronL2gatewayConnection extractFields(NeutronL2gatewayConnection o, List<String> fields) {
         return o.extractFields(fields);
     }
 
@@ -92,10 +91,9 @@ public class NeutronL2gatewayConnectionNorthbound
      * @return status
      */
     @POST
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_BAD_REQUEST, condition = "Bad Request"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@@ -115,48 +113,36 @@ public class NeutronL2gatewayConnectionNorthbound
      */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK,
-                condition = "Operation successful"),
-                @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED,
-                condition = "Unauthorized"),
-                @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
-                condition = "Not Implemented"),
-                @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-                condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listL2gatewayConnections(
-                                // return fields
-                                @QueryParam("fields") List<String> fields,
-                                @QueryParam("tenant_id") String queryTenantID,
-                                @QueryParam("connection_id") String queryConnectionID,
-                                @QueryParam("l2gateway_id") String queryL2gatewayID,
-                                @QueryParam("network_id") String queryNetworkID,
-                                @QueryParam("segment_id") String querySegmentID,
-                                @QueryParam("port_id") String queryPortID,
-                                @QueryParam ("limit") String limit,
-                                @QueryParam ("marker") String marker,
-                                @QueryParam ("page_reverse") String pageReverse
-                                // sorting not supported
+            // return fields
+            @QueryParam("fields") List<String> fields,
+            @QueryParam("tenant_id") String queryTenantID,
+            @QueryParam("connection_id") String queryConnectionID,
+            @QueryParam("l2gateway_id") String queryL2gatewayID,
+            @QueryParam("network_id") String queryNetworkID,
+            @QueryParam("segment_id") String querySegmentID,
+            @QueryParam("port_id") String queryPortID,
+            @QueryParam("limit") String limit,
+            @QueryParam("marker") String marker,
+            @QueryParam("page_reverse") String pageReverse
+    // sorting not supported
     ) {
         INeutronL2gatewayConnectionCRUD l2gatewayConnectionInterface = getNeutronCRUD();
         List<NeutronL2gatewayConnection> allL2gatewayConnections = l2gatewayConnectionInterface.getAll();
-        List<NeutronL2gatewayConnection> ans = new ArrayList<NeutronL2gatewayConnection>();
-        Iterator<NeutronL2gatewayConnection> i = allL2gatewayConnections
-            .iterator();
+        List<NeutronL2gatewayConnection> ans = new ArrayList<>();
+        Iterator<NeutronL2gatewayConnection> i = allL2gatewayConnections.iterator();
         while (i.hasNext()) {
             NeutronL2gatewayConnection oSS = i.next();
-            if ((queryTenantID == null || queryTenantID.equals(oSS
-                .getTenantID()))
-                    && (queryConnectionID == null || queryConnectionID
-                        .equals(oSS.getID()))
-                    && (queryL2gatewayID == null || queryL2gatewayID.equals(oSS
-                        .getL2gatewayID()))
-                    && (queryNetworkID == null || queryNetworkID.equals(oSS
-                        .getNetworkID()))
-                    && (querySegmentID == null || querySegmentID.equals(oSS
-                        .getSegmentID()))
-                    && (queryPortID == null || queryPortID.equals(oSS
-                        .getPortID()))) {
+            if ((queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
+                    && (queryConnectionID == null || queryConnectionID.equals(oSS.getID()))
+                    && (queryL2gatewayID == null || queryL2gatewayID.equals(oSS.getL2gatewayID()))
+                    && (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkID()))
+                    && (querySegmentID == null || querySegmentID.equals(oSS.getSegmentID()))
+                    && (queryPortID == null || queryPortID.equals(oSS.getPortID()))) {
                 if (fields.size() > 0) {
                     ans.add(extractFields(oSS, fields));
                 } else {
@@ -165,8 +151,7 @@ public class NeutronL2gatewayConnectionNorthbound
             }
         }
         // TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK)
-            .entity(new NeutronL2gatewayConnectionRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronL2gatewayConnectionRequest(ans)).build();
     }
 
     /**
@@ -175,23 +160,17 @@ public class NeutronL2gatewayConnectionNorthbound
      * @param fields attributes used for querying
      * @return status
      */
-    @Path ("{l2gatewayConnectionID}")
+    @Path("{l2gatewayConnectionID}")
     @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-        @ResponseCode (code = HttpURLConnection.HTTP_OK,
-                condition = "Operation successful"),
-                @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED,
-                condition = "Unauthorized"),
-                @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND,
-                condition = "Not Found"),
-                @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
-                condition = "Not Implemented"),
-                @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-                condition = "No providers available") })
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response showL2gatewayID(@PathParam("l2gatewayConnectionID") String l2gatewayConnectionID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
+            // return fields
+            @QueryParam("fields") List<String> fields) {
         return show(l2gatewayConnectionID, fields);
     }
 
@@ -202,15 +181,10 @@ public class NeutronL2gatewayConnectionNorthbound
      */
     @Path("{l2gatewayConnectionID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT,
-                condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND,
-                condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-        condition = "No providers available") })
-    public Response deleteL2gatewayConnection(
-            @PathParam("l2gatewayConnectionID") String l2gatewayConnectionID) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deleteL2gatewayConnection(@PathParam("l2gatewayConnectionID") String l2gatewayConnectionID) {
         return delete(l2gatewayConnectionID);
     }
 
index 914f37e6f7b05b09f6bbad97799d1a7b66328ff7..f2e03eabedc14cd3c4f7e0e6dda601e837180358 100644 (file)
@@ -49,9 +49,9 @@ import org.slf4j.LoggerFactory;
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
  */
 
-@Path ("/l2-gateways")
+@Path("/l2-gateways")
 public class NeutronL2gatewayNorthbound
-    extends AbstractNeutronNorthbound<NeutronL2gateway, NeutronL2gatewayRequest, INeutronL2gatewayCRUD> {
+        extends AbstractNeutronNorthbound<NeutronL2gateway, NeutronL2gatewayRequest, INeutronL2gatewayCRUD> {
     static final Logger logger = LoggerFactory.getLogger(NeutronL2gatewayNorthbound.class);
 
     @Context
@@ -89,10 +89,9 @@ public class NeutronL2gatewayNorthbound
      * @return success or error code
      */
     @POST
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_BAD_REQUEST, condition = "Bad Request"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@@ -111,44 +110,37 @@ public class NeutronL2gatewayNorthbound
      */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK,
-                condition = "Operation successful"),
-                @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED,
-                condition = "Unauthorized"),
-                @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
-                condition = "Not Implemented"),
-                @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-                condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listL2gateways(
-                                   // return fields
-                                   @QueryParam("fields") List<String> fields,
-                                   // OpenStack L2gateway attributes
-                                   @QueryParam("id") String queryID,
-                                   @QueryParam("name") String queryName,
-                                   @QueryParam("tenant_id") String queryTenantID,
-                                   @QueryParam("devices") String queryNeutronL2gatewayDevice,
-                                   // pagination
-                                   @QueryParam("limit") String limit,
-                                   @QueryParam("marker") String marker,
-                                   @QueryParam("page_reverse") String pageReverse
-                                   // sorting not supported
-            ){
-        INeutronL2gatewayCRUD l2gatewayInterface =
-                getNeutronInterfaces().getL2gatewayInterface();
-        List<NeutronL2gateway> allL2gateways =
-                l2gatewayInterface.getAll();
-        List<NeutronL2gateway> ans = new ArrayList<NeutronL2gateway>();
+            // return fields
+            @QueryParam("fields") List<String> fields,
+            // OpenStack L2gateway attributes
+            @QueryParam("id") String queryID,
+            @QueryParam("name") String queryName,
+            @QueryParam("tenant_id") String queryTenantID,
+            @QueryParam("devices") String queryNeutronL2gatewayDevice,
+            // pagination
+            @QueryParam("limit") String limit,
+            @QueryParam("marker") String marker,
+            @QueryParam("page_reverse") String pageReverse
+    // sorting not supported
+    ) {
+        INeutronL2gatewayCRUD l2gatewayInterface = getNeutronInterfaces().getL2gatewayInterface();
+        List<NeutronL2gateway> allL2gateways = l2gatewayInterface.getAll();
+        List<NeutronL2gateway> ans = new ArrayList<>();
         Iterator<NeutronL2gateway> i = allL2gateways.iterator();
         while (i.hasNext()) {
             NeutronL2gateway l2gateway = i.next();
             if ((queryID == null || queryID.equals(l2gateway.getID()))
                     && (queryName == null || queryName.equals(l2gateway.getL2gatewayName()))
                     && (queryTenantID == null || queryTenantID.equals(l2gateway.getTenantID()))
-                    && (queryNeutronL2gatewayDevice == null || queryNeutronL2gatewayDevice
-                    .equals(l2gateway.getNeutronL2gatewayDevices()))) {
+                    && (queryNeutronL2gatewayDevice == null
+                            || queryNeutronL2gatewayDevice.equals(l2gateway.getNeutronL2gatewayDevices()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(l2gateway,fields));
+                    ans.add(extractFields(l2gateway, fields));
                 } else {
                     ans.add(l2gateway);
                 }
@@ -164,23 +156,17 @@ public class NeutronL2gatewayNorthbound
      * @param fields l2gateway attributes
      * @return l2gateway details or error.
      */
-    @Path ("{l2gatewayID}")
+    @Path("{l2gatewayID}")
     @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-        @ResponseCode (code = HttpURLConnection.HTTP_OK,
-                condition = "Operation successful"),
-                @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED,
-                condition = "Unauthorized"),
-                @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND,
-                condition = "Not Found"),
-                @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
-                condition = "Not Implemented"),
-                @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-                condition = "No providers available") })
-    public Response showL2gateway(@PathParam ("l2gatewayID") String l2gatewayID,
-                                      // return fields
-                                      @QueryParam ("fields") List<String> fields) {
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response showL2gateway(@PathParam("l2gatewayID") String l2gatewayID,
+            // return fields
+            @QueryParam("fields") List<String> fields) {
         return show(l2gatewayID, fields);
     }
 
@@ -192,15 +178,10 @@ public class NeutronL2gatewayNorthbound
 
     @Path("{l2gatewayID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT,
-                condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND,
-                condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-        condition = "No providers available") })
-    public Response deleteL2gateway(
-                                    @PathParam("l2gatewayID") String l2gatewayID) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deleteL2gateway(@PathParam("l2gatewayID") String l2gatewayID) {
         return delete(l2gatewayID);
     }
 
@@ -214,16 +195,10 @@ public class NeutronL2gatewayNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK,
-                condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND,
-                condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
-        condition = "No providers available") })
-    public Response updateL2gateway(
-                                    @PathParam("l2gatewayID") String l2gatewayID,
-                                    NeutronL2gatewayRequest input) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response updateL2gateway(@PathParam("l2gatewayID") String l2gatewayID, NeutronL2gatewayRequest input) {
         return update(l2gatewayID, input);
     }
 
index b111c599d6af341d4aad4f9779387ccf57f0c148..a5334ae5dc529b0566c89ffe48bf38123f3c9df4 100644 (file)
@@ -48,7 +48,8 @@ import org.opendaylight.neutron.spi.NeutronLoadBalancerHealthMonitor;
  */
 @Path("/lbaas/healthmonitors")
 public class NeutronLoadBalancerHealthMonitorNorthbound
-    extends AbstractNeutronNorthbound<NeutronLoadBalancerHealthMonitor, NeutronLoadBalancerHealthMonitorRequest, INeutronLoadBalancerHealthMonitorCRUD> {
+        extends AbstractNeutronNorthbound<NeutronLoadBalancerHealthMonitor, NeutronLoadBalancerHealthMonitorRequest,
+                INeutronLoadBalancerHealthMonitorCRUD> {
 
     private static final String RESOURCE_NAME = "LoadBalancerHealthMonitor";
 
@@ -80,8 +81,7 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
      * Returns a list of all LoadBalancerHealthMonitor */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -105,52 +105,45 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = getNeutronCRUD();
-        List<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = loadBalancerHealthMonitorInterface.getAll();
-        List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<NeutronLoadBalancerHealthMonitor>();
+        List<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = loadBalancerHealthMonitorInterface
+                .getAll();
+        List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<>();
         Iterator<NeutronLoadBalancerHealthMonitor> i = allLoadBalancerHealthMonitors.iterator();
         while (i.hasNext()) {
             NeutronLoadBalancerHealthMonitor nsg = i.next();
-            if ((queryLoadBalancerHealthMonitorID == null ||
-                    queryLoadBalancerHealthMonitorID.equals(nsg.getID())) &&
-                    (queryLoadBalancerHealthMonitorTenantID == null ||
-                            queryLoadBalancerHealthMonitorTenantID.equals
-                                    (nsg.getTenantID())) &&
-                    (queryLoadBalancerHealthMonitorType == null ||
-                            queryLoadBalancerHealthMonitorType.equals
-                                    (nsg.getLoadBalancerHealthMonitorType())) &&
-                    (queryLoadBalancerHealthMonitorDelay == null ||
-                            queryLoadBalancerHealthMonitorDelay.equals
-                                    (nsg.getLoadBalancerHealthMonitorDelay())) &&
-                    (queryLoadBalancerHealthMonitorTimeout == null ||
-                            queryLoadBalancerHealthMonitorTimeout.equals
-                                    (nsg.getLoadBalancerHealthMonitorTimeout())) &&
-                    (queryLoadBalancerHealthMonitorMaxRetries == null ||
-                            queryLoadBalancerHealthMonitorMaxRetries.equals
-                                    (nsg.getLoadBalancerHealthMonitorMaxRetries())) &&
-                    (queryLoadBalancerHealthMonitorHttpMethod == null ||
-                            queryLoadBalancerHealthMonitorHttpMethod.equals
-                                    (nsg.getLoadBalancerHealthMonitorHttpMethod())) &&
-                    (queryLoadBalancerHealthMonitorUrlPath == null ||
-                            queryLoadBalancerHealthMonitorUrlPath.equals
-                                    (nsg.getLoadBalancerHealthMonitorUrlPath())) &&
-                    (queryLoadBalancerHealthMonitorExpectedCodes == null ||
-                            queryLoadBalancerHealthMonitorExpectedCodes.equals
-                                    (nsg.getLoadBalancerHealthMonitorExpectedCodes())) &&
-                    (queryLoadBalancerHealthMonitorIsAdminStateUp == null ||
-                            queryLoadBalancerHealthMonitorIsAdminStateUp.equals
-                                    (nsg.getLoadBalancerHealthMonitorAdminStateIsUp()))) {
+            if ((queryLoadBalancerHealthMonitorID == null || queryLoadBalancerHealthMonitorID.equals(nsg.getID()))
+                    && (queryLoadBalancerHealthMonitorTenantID == null
+                            || queryLoadBalancerHealthMonitorTenantID.equals(nsg.getTenantID()))
+                    && (queryLoadBalancerHealthMonitorType == null
+                            || queryLoadBalancerHealthMonitorType.equals(nsg.getLoadBalancerHealthMonitorType()))
+                    && (queryLoadBalancerHealthMonitorDelay == null
+                            || queryLoadBalancerHealthMonitorDelay.equals(nsg.getLoadBalancerHealthMonitorDelay()))
+                    && (queryLoadBalancerHealthMonitorTimeout == null
+                            || queryLoadBalancerHealthMonitorTimeout.equals(nsg.getLoadBalancerHealthMonitorTimeout()))
+                    && (queryLoadBalancerHealthMonitorMaxRetries == null || queryLoadBalancerHealthMonitorMaxRetries
+                            .equals(nsg.getLoadBalancerHealthMonitorMaxRetries()))
+                    && (queryLoadBalancerHealthMonitorHttpMethod == null || queryLoadBalancerHealthMonitorHttpMethod
+                            .equals(nsg.getLoadBalancerHealthMonitorHttpMethod()))
+                    && (queryLoadBalancerHealthMonitorUrlPath == null
+                            || queryLoadBalancerHealthMonitorUrlPath.equals(nsg.getLoadBalancerHealthMonitorUrlPath()))
+                    && (queryLoadBalancerHealthMonitorExpectedCodes == null
+                            || queryLoadBalancerHealthMonitorExpectedCodes
+                                    .equals(nsg.getLoadBalancerHealthMonitorExpectedCodes()))
+                    && (queryLoadBalancerHealthMonitorIsAdminStateUp == null
+                            || queryLoadBalancerHealthMonitorIsAdminStateUp
+                                    .equals(nsg.getLoadBalancerHealthMonitorAdminStateIsUp()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
+                    ans.add(extractFields(nsg, fields));
                 } else {
                     ans.add(nsg);
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronLoadBalancerHealthMonitorRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerHealthMonitorRequest(ans))
+                .build();
     }
 
     /**
@@ -159,13 +152,13 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
     @Path("{loadBalancerHealthMonitorID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showLoadBalancerHealthMonitor(@PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
+    public Response showLoadBalancerHealthMonitor(
+            @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
             // return fields
             @QueryParam("fields") List<String> fields) {
         return show(loadBalancerHealthMonitorID, fields);
@@ -177,8 +170,7 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createLoadBalancerHealthMonitors(final NeutronLoadBalancerHealthMonitorRequest input) {
         return create(input);
@@ -191,8 +183,7 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response updateLoadBalancerHealthMonitor(
@@ -201,14 +192,12 @@ public class NeutronLoadBalancerHealthMonitorNorthbound
         return update(loadBalancerHealthMonitorID, input);
     }
 
-
     /**
      * Deletes a LoadBalancerHealthMonitor
      * */
     @Path("{loadBalancerHealthMonitorID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response deleteLoadBalancerHealthMonitor(
index 33d32e43941f0eaf0e1ea5523281e60194fea996..e141820f0701ed05a4a3930e91e071a00cfe916f 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerHealthMonitor;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronLoadBalancerHealthMonitorRequest
-    implements INeutronRequest<NeutronLoadBalancerHealthMonitor> {
+public class NeutronLoadBalancerHealthMonitorRequest implements INeutronRequest<NeutronLoadBalancerHealthMonitor> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      */
 
-    @XmlElement(name="healthmonitor")
+    @XmlElement(name = "healthmonitor")
     NeutronLoadBalancerHealthMonitor singletonLoadBalancerHealthMonitor;
 
-    @XmlElement(name="healthmonitors")
+    @XmlElement(name = "healthmonitors")
     List<NeutronLoadBalancerHealthMonitor> bulkRequest;
 
     NeutronLoadBalancerHealthMonitorRequest() {
index 54c23021398b7e68437c27b08be2fb0206401709..bc5ed89a27af44c7e24627bee602062dbef3cfbf 100644 (file)
@@ -47,8 +47,8 @@ import org.opendaylight.neutron.spi.NeutronLoadBalancerListener;
  *
  */
 @Path("/lbaas/listeners")
-public class NeutronLoadBalancerListenerNorthbound
-    extends AbstractNeutronNorthbound<NeutronLoadBalancerListener, NeutronLoadBalancerListenerRequest, INeutronLoadBalancerListenerCRUD> {
+public class NeutronLoadBalancerListenerNorthbound extends AbstractNeutronNorthbound<NeutronLoadBalancerListener,
+        NeutronLoadBalancerListenerRequest, INeutronLoadBalancerListenerCRUD> {
 
     private static final String RESOURCE_NAME = "LoadBalancerListener";
 
@@ -80,8 +80,7 @@ public class NeutronLoadBalancerListenerNorthbound
      * Returns a list of all LoadBalancerListener */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -101,37 +100,35 @@ public class NeutronLoadBalancerListenerNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = getNeutronCRUD();
         List<NeutronLoadBalancerListener> allLoadBalancerListeners = loadBalancerListenerInterface.getAll();
-        List<NeutronLoadBalancerListener> ans = new ArrayList<NeutronLoadBalancerListener>();
+        List<NeutronLoadBalancerListener> ans = new ArrayList<>();
         Iterator<NeutronLoadBalancerListener> i = allLoadBalancerListeners.iterator();
         while (i.hasNext()) {
             NeutronLoadBalancerListener nsg = i.next();
-            if ((queryLoadBalancerListenerID == null ||
-                    queryLoadBalancerListenerID.equals(nsg.getID())) &&
-                    (queryLoadBalancerListenerDefaultPoolID == null ||
-                            queryLoadBalancerListenerDefaultPoolID.equals(nsg.getNeutronLoadBalancerListenerDefaultPoolID())) &&
-                    (queryLoadBalancerListenerTenantID == null ||
-                            queryLoadBalancerListenerTenantID.equals(nsg.getTenantID())) &&
-                    (queryLoadBalancerListenerName == null ||
-                            queryLoadBalancerListenerName.equals(nsg.getLoadBalancerListenerName())) &&
-                    (queryLoadBalancerListenerProtocol == null ||
-                            queryLoadBalancerListenerProtocol.equals(nsg.getNeutronLoadBalancerListenerProtocol())) &&
-                    (queryLoadBalancerListenerProtocolPort == null ||
-                            queryLoadBalancerListenerProtocolPort.equals(nsg.getNeutronLoadBalancerListenerProtocolPort())) &&
-                    (queryLoadBalancerListenerAdminIsUp == null ||
-                            queryLoadBalancerListenerAdminIsUp.equals(nsg.getLoadBalancerListenerAdminStateIsUp()))) {
+            if ((queryLoadBalancerListenerID == null || queryLoadBalancerListenerID.equals(nsg.getID()))
+                    && (queryLoadBalancerListenerDefaultPoolID == null || queryLoadBalancerListenerDefaultPoolID
+                            .equals(nsg.getNeutronLoadBalancerListenerDefaultPoolID()))
+                    && (queryLoadBalancerListenerTenantID == null
+                            || queryLoadBalancerListenerTenantID.equals(nsg.getTenantID()))
+                    && (queryLoadBalancerListenerName == null
+                            || queryLoadBalancerListenerName.equals(nsg.getLoadBalancerListenerName()))
+                    && (queryLoadBalancerListenerProtocol == null
+                            || queryLoadBalancerListenerProtocol.equals(nsg.getNeutronLoadBalancerListenerProtocol()))
+                    && (queryLoadBalancerListenerProtocolPort == null || queryLoadBalancerListenerProtocolPort
+                            .equals(nsg.getNeutronLoadBalancerListenerProtocolPort()))
+                    && (queryLoadBalancerListenerAdminIsUp == null || queryLoadBalancerListenerAdminIsUp
+                            .equals(nsg.getLoadBalancerListenerAdminStateIsUp()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
+                    ans.add(extractFields(nsg, fields));
                 } else {
                     ans.add(nsg);
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronLoadBalancerListenerRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerListenerRequest(ans)).build();
     }
 
     /**
@@ -140,8 +137,7 @@ public class NeutronLoadBalancerListenerNorthbound
     @Path("{loadBalancerListenerID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@@ -158,8 +154,7 @@ public class NeutronLoadBalancerListenerNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createLoadBalancerListeners(final NeutronLoadBalancerListenerRequest input) {
         return create(input);
@@ -172,12 +167,11 @@ public class NeutronLoadBalancerListenerNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateLoadBalancerListener(
-            @PathParam("loadBalancerListenerID") String loadBalancerListenerID, final NeutronLoadBalancerListenerRequest input) {
+    public Response updateLoadBalancerListener(@PathParam("loadBalancerListenerID") String loadBalancerListenerID,
+            final NeutronLoadBalancerListenerRequest input) {
         return update(loadBalancerListenerID, input);
     }
 
@@ -186,12 +180,10 @@ public class NeutronLoadBalancerListenerNorthbound
 
     @Path("{loadBalancerListenerID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteLoadBalancerListener(
-            @PathParam("loadBalancerListenerID") String loadBalancerListenerID) {
+    public Response deleteLoadBalancerListener(@PathParam("loadBalancerListenerID") String loadBalancerListenerID) {
         return delete(loadBalancerListenerID);
     }
 }
index 81f2b055f6edec16e1f2c178be3e3deb03b406e5..4c8d88e3a37b1bcb0a0da27a19c43dd714a155e5 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerListener;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronLoadBalancerListenerRequest
-    implements INeutronRequest<NeutronLoadBalancerListener> {
+public class NeutronLoadBalancerListenerRequest implements INeutronRequest<NeutronLoadBalancerListener> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      */
 
-    @XmlElement(name="listener")
+    @XmlElement(name = "listener")
     NeutronLoadBalancerListener singletonLoadBalancerListener;
 
-    @XmlElement(name="listeners")
+    @XmlElement(name = "listeners")
     List<NeutronLoadBalancerListener> bulkRequest;
 
     NeutronLoadBalancerListenerRequest() {
index ef44d2575f8d71290c09f0d7656d42868a327219..a8c9e39f53d1714df179a0f88622b0c3e5e64a1f 100644 (file)
@@ -48,7 +48,7 @@ import org.opendaylight.neutron.spi.NeutronLoadBalancer;
  */
 @Path("/lbaas/loadbalancers")
 public class NeutronLoadBalancerNorthbound
-    extends AbstractNeutronNorthbound<NeutronLoadBalancer, NeutronLoadBalancerRequest, INeutronLoadBalancerCRUD> {
+        extends AbstractNeutronNorthbound<NeutronLoadBalancer, NeutronLoadBalancerRequest, INeutronLoadBalancerCRUD> {
 
     private static final String RESOURCE_NAME = "LoadBalancer";
 
@@ -80,8 +80,7 @@ public class NeutronLoadBalancerNorthbound
      * Returns a list of all LoadBalancer */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -100,33 +99,29 @@ public class NeutronLoadBalancerNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronLoadBalancerCRUD loadBalancerInterface = getNeutronCRUD();
         List<NeutronLoadBalancer> allLoadBalancers = loadBalancerInterface.getAll();
-        List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
+        List<NeutronLoadBalancer> ans = new ArrayList<>();
         Iterator<NeutronLoadBalancer> i = allLoadBalancers.iterator();
         while (i.hasNext()) {
             NeutronLoadBalancer nsg = i.next();
-            if ((queryLoadBalancerID == null ||
-                    queryLoadBalancerID.equals(nsg.getID())) &&
-                    (queryLoadBalancerTenantID == null ||
-                            queryLoadBalancerTenantID.equals(nsg.getTenantID())) &&
-                    (queryLoadBalancerName == null ||
-                            queryLoadBalancerName.equals(nsg.getLoadBalancerName())) &&
-                    (queryLoadBalancerVipAddress == null ||
-                            queryLoadBalancerVipAddress.equals(nsg.getLoadBalancerVipAddress())) &&
-                    (queryLoadBalancerVipSubnet == null ||
-                            queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) {
+            if ((queryLoadBalancerID == null || queryLoadBalancerID.equals(nsg.getID()))
+                    && (queryLoadBalancerTenantID == null || queryLoadBalancerTenantID.equals(nsg.getTenantID()))
+                    && (queryLoadBalancerName == null || queryLoadBalancerName.equals(nsg.getLoadBalancerName()))
+                    && (queryLoadBalancerVipAddress == null
+                            || queryLoadBalancerVipAddress.equals(nsg.getLoadBalancerVipAddress()))
+                    && (queryLoadBalancerVipSubnet == null
+                            || queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
+                    ans.add(extractFields(nsg, fields));
                 } else {
                     ans.add(nsg);
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronLoadBalancerRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerRequest(ans)).build();
     }
 
     /**
@@ -136,8 +131,7 @@ public class NeutronLoadBalancerNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
 
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@@ -155,8 +149,7 @@ public class NeutronLoadBalancerNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
 
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createLoadBalancers(final NeutronLoadBalancerRequest input) {
         return create(input);
@@ -170,12 +163,11 @@ public class NeutronLoadBalancerNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
 
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateLoadBalancer(
-            @PathParam("loadBalancerID") String loadBalancerID, final NeutronLoadBalancerRequest input) {
+    public Response updateLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID,
+            final NeutronLoadBalancerRequest input) {
         return update(loadBalancerID, input);
     }
 
@@ -184,12 +176,10 @@ public class NeutronLoadBalancerNorthbound
 
     @Path("{loadBalancerID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteLoadBalancer(
-            @PathParam("loadBalancerID") String loadBalancerID) {
+    public Response deleteLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID) {
         return delete(loadBalancerID);
     }
 }
index 81e1eb00870788ae55f890a69c40da1794810caf..40976e6ea8f1d5fa4987e83bebd9a7d4e2acf926 100644 (file)
@@ -12,18 +12,17 @@ import java.util.List;
 import javax.xml.bind.annotation.XmlElement;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerPoolMember;
 
-public class NeutronLoadBalancerPoolMemberRequest
-    implements INeutronRequest<NeutronLoadBalancerPoolMember> {
+public class NeutronLoadBalancerPoolMemberRequest implements INeutronRequest<NeutronLoadBalancerPoolMember> {
 
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      */
 
-    @XmlElement(name="member")
+    @XmlElement(name = "member")
     NeutronLoadBalancerPoolMember singletonLoadBalancerPoolMember;
 
-    @XmlElement(name="members")
+    @XmlElement(name = "members")
     List<NeutronLoadBalancerPoolMember> bulkRequest;
 
     NeutronLoadBalancerPoolMemberRequest() {
index 0ae021214576d1a95b6951b6639478f8354ce795..8f634f130695727bcb1102b045ba50e677cbf460 100644 (file)
@@ -54,8 +54,8 @@ import org.opendaylight.neutron.spi.NeutronLoadBalancerPoolMember;
  */
 
 @Path("/lbaas/pools")
-public class NeutronLoadBalancerPoolNorthbound
-    extends AbstractNeutronNorthbound<NeutronLoadBalancerPool, NeutronLoadBalancerPoolRequest, INeutronLoadBalancerPoolCRUD> {
+public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound<NeutronLoadBalancerPool,
+        NeutronLoadBalancerPoolRequest, INeutronLoadBalancerPoolCRUD> {
 
     private static final String RESOURCE_NAME = "LoadBalancerPool";
 
@@ -76,8 +76,7 @@ public class NeutronLoadBalancerPoolNorthbound
 
     @Override
     protected INeutronLoadBalancerPoolCRUD getNeutronCRUD() {
-        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().
-            fetchINeutronLoadBalancerPoolCRUD(this);
+        NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronLoadBalancerPoolCRUD(this);
         if (answer.getLoadBalancerPoolInterface() == null) {
             throw new ServiceUnavailableException(serviceUnavailable());
         }
@@ -89,8 +88,7 @@ public class NeutronLoadBalancerPoolNorthbound
      * */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -111,37 +109,35 @@ public class NeutronLoadBalancerPoolNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
         List<NeutronLoadBalancerPool> allLoadBalancerPools = loadBalancerPoolInterface.getAll();
-        List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
+        List<NeutronLoadBalancerPool> ans = new ArrayList<>();
         Iterator<NeutronLoadBalancerPool> i = allLoadBalancerPools.iterator();
         while (i.hasNext()) {
             NeutronLoadBalancerPool nsg = i.next();
-            if ((queryLoadBalancerPoolID == null ||
-                    queryLoadBalancerPoolID.equals(nsg.getID())) &&
-                    (queryLoadBalancerPoolTenantID == null ||
-                            queryLoadBalancerPoolTenantID.equals(nsg.getTenantID())) &&
-                    (queryLoadBalancerPoolName == null ||
-                            queryLoadBalancerPoolName.equals(nsg.getLoadBalancerPoolName())) &&
-                    (queryLoadBalancerPoolLbAlgorithm == null ||
-                            queryLoadBalancerPoolLbAlgorithm.equals(nsg.getLoadBalancerPoolLbAlgorithm())) &&
-                    (queryLoadBalancerPoolHealthMonitorID == null ||
-                            queryLoadBalancerPoolHealthMonitorID.equals(nsg.getNeutronLoadBalancerPoolHealthMonitorID())) &&
-                    (queryLoadBalancerIsAdminStateUp == null ||
-                            queryLoadBalancerIsAdminStateUp.equals(nsg.getLoadBalancerPoolAdminIsStateIsUp())) &&
-                    (queryLoadBalancerPoolMembers.size() == 0 ||
-                            queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) {
+            if ((queryLoadBalancerPoolID == null || queryLoadBalancerPoolID.equals(nsg.getID()))
+                    && (queryLoadBalancerPoolTenantID == null
+                            || queryLoadBalancerPoolTenantID.equals(nsg.getTenantID()))
+                    && (queryLoadBalancerPoolName == null
+                            || queryLoadBalancerPoolName.equals(nsg.getLoadBalancerPoolName()))
+                    && (queryLoadBalancerPoolLbAlgorithm == null
+                            || queryLoadBalancerPoolLbAlgorithm.equals(nsg.getLoadBalancerPoolLbAlgorithm()))
+                    && (queryLoadBalancerPoolHealthMonitorID == null || queryLoadBalancerPoolHealthMonitorID
+                            .equals(nsg.getNeutronLoadBalancerPoolHealthMonitorID()))
+                    && (queryLoadBalancerIsAdminStateUp == null
+                            || queryLoadBalancerIsAdminStateUp.equals(nsg.getLoadBalancerPoolAdminIsStateIsUp()))
+                    && (queryLoadBalancerPoolMembers.size() == 0
+                            || queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
+                    ans.add(extractFields(nsg, fields));
                 } else {
                     ans.add(nsg);
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronLoadBalancerPoolRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolRequest(ans)).build();
     }
 
     /**
@@ -150,8 +146,7 @@ public class NeutronLoadBalancerPoolNorthbound
     @Path("{loadBalancerPoolID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@@ -168,8 +163,7 @@ public class NeutronLoadBalancerPoolNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createLoadBalancerPools(final NeutronLoadBalancerPoolRequest input) {
         return create(input);
@@ -182,12 +176,11 @@ public class NeutronLoadBalancerPoolNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateLoadBalancerPool(
-            @PathParam("loadBalancerPoolID") String loadBalancerPoolID, final NeutronLoadBalancerPoolRequest input) {
+    public Response updateLoadBalancerPool(@PathParam("loadBalancerPoolID") String loadBalancerPoolID,
+            final NeutronLoadBalancerPoolRequest input) {
         return update(loadBalancerPoolID, input);
     }
 
@@ -197,12 +190,10 @@ public class NeutronLoadBalancerPoolNorthbound
 
     @Path("{loadBalancerPoolUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteLoadBalancerPool(
-            @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID) {
+    public Response deleteLoadBalancerPool(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID) {
         return delete(loadBalancerPoolUUID);
     }
 
@@ -215,9 +206,8 @@ public class NeutronLoadBalancerPoolNorthbound
      */
     @Path("{loadBalancerPoolUUID}/members")
     @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listMembers(
@@ -240,31 +230,30 @@ public class NeutronLoadBalancerPoolNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
+    // sorting not supported
     ) {
         INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
         if (!loadBalancerPoolInterface.exists(loadBalancerPoolUUID)) {
             throw new ResourceNotFoundException(uuidNoExist());
         }
-        List<NeutronLoadBalancerPoolMember> members =
-                    loadBalancerPoolInterface.get(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-        List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
+        List<NeutronLoadBalancerPoolMember> members = loadBalancerPoolInterface.get(loadBalancerPoolUUID)
+                .getLoadBalancerPoolMembers();
+        List<NeutronLoadBalancerPoolMember> ans = new ArrayList<>();
         Iterator<NeutronLoadBalancerPoolMember> i = members.iterator();
         while (i.hasNext()) {
             NeutronLoadBalancerPoolMember nsg = i.next();
-            if ((queryLoadBalancerPoolMemberID == null ||
-                queryLoadBalancerPoolMemberID.equals(nsg.getID())) &&
-                loadBalancerPoolUUID.equals(nsg.getPoolID()) &&
-                (queryLoadBalancerPoolMemberTenantID == null ||
-                        queryLoadBalancerPoolMemberTenantID.equals(nsg.getTenantID())) &&
-                (queryLoadBalancerPoolMemberAddress == null ||
-                        queryLoadBalancerPoolMemberAddress.equals(nsg.getPoolMemberAddress())) &&
-                (queryLoadBalancerPoolMemberAdminStateUp == null ||
-                        queryLoadBalancerPoolMemberAdminStateUp.equals(nsg.getPoolMemberAdminStateIsUp())) &&
-                (queryLoadBalancerPoolMemberWeight == null ||
-                        queryLoadBalancerPoolMemberWeight.equals(nsg.getPoolMemberWeight())) &&
-                (queryLoadBalancerPoolMemberSubnetID == null ||
-                        queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID()))) {
+            if ((queryLoadBalancerPoolMemberID == null || queryLoadBalancerPoolMemberID.equals(nsg.getID()))
+                    && loadBalancerPoolUUID.equals(nsg.getPoolID())
+                    && (queryLoadBalancerPoolMemberTenantID == null
+                            || queryLoadBalancerPoolMemberTenantID.equals(nsg.getTenantID()))
+                    && (queryLoadBalancerPoolMemberAddress == null
+                            || queryLoadBalancerPoolMemberAddress.equals(nsg.getPoolMemberAddress()))
+                    && (queryLoadBalancerPoolMemberAdminStateUp == null
+                            || queryLoadBalancerPoolMemberAdminStateUp.equals(nsg.getPoolMemberAdminStateIsUp()))
+                    && (queryLoadBalancerPoolMemberWeight == null
+                            || queryLoadBalancerPoolMemberWeight.equals(nsg.getPoolMemberWeight()))
+                    && (queryLoadBalancerPoolMemberSubnetID == null
+                            || queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID()))) {
                 if (fields.size() > 0) {
                     ans.add(extractFields(nsg, fields));
                 } else {
@@ -272,8 +261,7 @@ public class NeutronLoadBalancerPoolNorthbound
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronLoadBalancerPoolMemberRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolMemberRequest(ans)).build();
     }
 
     /**
@@ -283,34 +271,32 @@ public class NeutronLoadBalancerPoolNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackLoadBalancerPoolMembers.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showLoadBalancerPoolMember(
-            @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response showLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
             @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
             // return fields
-            @QueryParam("fields") List<String> fields ) {
+            @QueryParam("fields") List<String> fields) {
 
         INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
         if (!loadBalancerPoolInterface.exists(loadBalancerPoolUUID)) {
             throw new ResourceNotFoundException(uuidNoExist());
         }
-        List<NeutronLoadBalancerPoolMember> members =
-                    loadBalancerPoolInterface.get(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-        for (NeutronLoadBalancerPoolMember ans: members) {
+        List<NeutronLoadBalancerPoolMember> members = loadBalancerPoolInterface.get(loadBalancerPoolUUID)
+                .getLoadBalancerPoolMembers();
+        for (NeutronLoadBalancerPoolMember ans : members) {
             if (!ans.getID().equals(loadBalancerPoolMemberUUID)) {
                 continue;
             }
 
             if (fields.size() > 0) {
-                return Response.status(HttpURLConnection.HTTP_OK).entity(
-                    new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build();
+                return Response.status(HttpURLConnection.HTTP_OK)
+                        .entity(new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build();
             } else {
-                return Response.status(HttpURLConnection.HTTP_OK).entity(
-                    new NeutronLoadBalancerPoolMemberRequest(ans)).build();
+                return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolMemberRequest(ans))
+                        .build();
             }
         }
         throw new ResourceNotFoundException(uuidNoExist());
@@ -321,13 +307,11 @@ public class NeutronLoadBalancerPoolNorthbound
      */
     @Path("{loadBalancerPoolUUID}/members")
     @POST
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response createLoadBalancerPoolMember(
-            @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+    public Response createLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
             final NeutronLoadBalancerPoolMemberRequest input) {
 
         INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
@@ -360,11 +344,9 @@ public class NeutronLoadBalancerPoolNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found") })
-    public Response updateLoadBalancerPoolMember(
-            @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+    public Response updateLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
             @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
             final NeutronLoadBalancerPoolMemberRequest input) {
         INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
@@ -375,9 +357,11 @@ public class NeutronLoadBalancerPoolNorthbound
         if (singletonPool == null) {
             throw new ResourceNotFoundException("Pool doesn't Exist");
         }
-        NeutronLoadBalancerPoolMember original = singletonPool.getNeutronLoadBalancerPoolMember(loadBalancerPoolMemberUUID);
+        NeutronLoadBalancerPoolMember original = singletonPool
+                .getNeutronLoadBalancerPoolMember(loadBalancerPoolMemberUUID);
 
-        loadBalancerPoolInterface.updateNeutronLoadBalancerPoolMember(loadBalancerPoolUUID, loadBalancerPoolMemberUUID, singleton);
+        loadBalancerPoolInterface.updateNeutronLoadBalancerPoolMember(loadBalancerPoolUUID, loadBalancerPoolMemberUUID,
+                singleton);
         return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
     }
 
@@ -387,20 +371,18 @@ public class NeutronLoadBalancerPoolNorthbound
 
     @Path("{loadBalancerPoolUUID}/members/{loadBalancerPoolMemberUUID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteLoadBalancerPoolMember(
-            @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deleteLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
             @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID) {
         INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
 
         //Verify that the LB pool member exists
         NeutronLoadBalancerPoolMember singleton = null;
-        List<NeutronLoadBalancerPoolMember> members =
-                loadBalancerPoolInterface.get(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-        for (NeutronLoadBalancerPoolMember member: members) {
+        List<NeutronLoadBalancerPoolMember> members = loadBalancerPoolInterface.get(loadBalancerPoolUUID)
+                .getLoadBalancerPoolMembers();
+        for (NeutronLoadBalancerPoolMember member : members) {
             if (member.getID().equals(loadBalancerPoolMemberUUID)) {
                 singleton = member;
                 break;
index eeaf218d90c77a1ed1dcca5028753f6678d4bc1a..ce98fac524bd2da2b25a868ccdf8981a60c2db91 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerPool;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronLoadBalancerPoolRequest
-    implements INeutronRequest<NeutronLoadBalancerPool> {
+public class NeutronLoadBalancerPoolRequest implements INeutronRequest<NeutronLoadBalancerPool> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      */
 
-    @XmlElement(name="pool")
+    @XmlElement(name = "pool")
     NeutronLoadBalancerPool singletonLoadBalancerPool;
 
-    @XmlElement(name="pools")
+    @XmlElement(name = "pools")
     List<NeutronLoadBalancerPool> bulkRequest;
 
     NeutronLoadBalancerPoolRequest() {
index 1017cfff4e8e73ab1a5423f90564980da9380242..a2fda77ad7dda9a5a32802cd5f75a84bcb7be24e 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronLoadBalancer;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronLoadBalancerRequest
-    implements INeutronRequest<NeutronLoadBalancer> {
+public class NeutronLoadBalancerRequest implements INeutronRequest<NeutronLoadBalancer> {
     /**
      * See OpenStack Network API v2.0 Reference for description of
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      */
 
-    @XmlElement(name="loadbalancer")
+    @XmlElement(name = "loadbalancer")
     NeutronLoadBalancer singletonLoadBalancer;
 
-    @XmlElement(name="loadbalancers")
+    @XmlElement(name = "loadbalancers")
     List<NeutronLoadBalancer> bulkRequest;
 
     NeutronLoadBalancerRequest() {
index 4b8b7929fc40c82eec12e26bf1a1edc909800a1a..d6015d42b6431c20274e66a392f37cbc98c601ba 100644 (file)
@@ -15,19 +15,17 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronMeteringLabel;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronMeteringLabelRequest
-    implements INeutronRequest<NeutronMeteringLabel> {
+public class NeutronMeteringLabelRequest implements INeutronRequest<NeutronMeteringLabel> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="metering_label")
+    @XmlElement(name = "metering_label")
     NeutronMeteringLabel singletonMeteringLabel;
 
-    @XmlElement(name="metering_labels")
+    @XmlElement(name = "metering_labels")
     List<NeutronMeteringLabel> bulkMeteringLabels;
 
     NeutronMeteringLabelRequest() {
index ef6627c67f671518d52fad1b810f8a5f9661fbc6..a2c19b4dc099b3ec6d2708628b3a942f6bc7f398 100644 (file)
@@ -15,19 +15,17 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronMeteringLabelRule;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronMeteringLabelRuleRequest
-    implements INeutronRequest<NeutronMeteringLabelRule> {
+public class NeutronMeteringLabelRuleRequest implements INeutronRequest<NeutronMeteringLabelRule> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="metering_label_rule")
+    @XmlElement(name = "metering_label_rule")
     NeutronMeteringLabelRule singletonMeteringLabelRule;
 
-    @XmlElement(name="metering_label_rules")
+    @XmlElement(name = "metering_label_rules")
     List<NeutronMeteringLabelRule> bulkMeteringLabelRules;
 
     NeutronMeteringLabelRuleRequest() {
index 0c87183db47cecb651d2554b734d24008b6f7a16..6b4e69cfa3de2208ca734737ca49f414a9b7868d 100644 (file)
@@ -49,8 +49,8 @@ import org.opendaylight.neutron.spi.NeutronMeteringLabelRule;
  */
 
 @Path("/metering/metering-label-rules")
-public class NeutronMeteringLabelRulesNorthbound
-    extends AbstractNeutronNorthbound<NeutronMeteringLabelRule, NeutronMeteringLabelRuleRequest, INeutronMeteringLabelRuleCRUD> {
+public class NeutronMeteringLabelRulesNorthbound extends AbstractNeutronNorthbound<NeutronMeteringLabelRule,
+        NeutronMeteringLabelRuleRequest, INeutronMeteringLabelRuleCRUD> {
     private static final String RESOURCE_NAME = "Metering Label Rule";
 
     @Override
@@ -86,8 +86,7 @@ public class NeutronMeteringLabelRulesNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -99,28 +98,28 @@ public class NeutronMeteringLabelRulesNorthbound
             @QueryParam("direction") String queryDirection,
             @QueryParam("remote_ip_prefix") String queryRemoteIPPrefix,
             @QueryParam("metering_label_id") String queryLabelID
-            // pagination and sorting are TODO
-            ) {
+    // pagination and sorting are TODO
+    ) {
         INeutronMeteringLabelRuleCRUD ruleInterface = getNeutronCRUD();
         List<NeutronMeteringLabelRule> allNeutronMeteringLabelRule = ruleInterface.getAll();
-        List<NeutronMeteringLabelRule> ans = new ArrayList<NeutronMeteringLabelRule>();
+        List<NeutronMeteringLabelRule> ans = new ArrayList<>();
         Iterator<NeutronMeteringLabelRule> i = allNeutronMeteringLabelRule.iterator();
         while (i.hasNext()) {
             NeutronMeteringLabelRule oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryDirection == null || queryDirection.equals(oSS.getMeteringLabelRuleDirection())) &&
-                    (queryRemoteIPPrefix == null || queryRemoteIPPrefix.equals(oSS.getMeteringLabelRuleRemoteIPPrefix())) &&
-                    (queryLabelID == null || queryLabelID.equals(oSS.getMeteringLabelRuleLabelID()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryDirection == null || queryDirection.equals(oSS.getMeteringLabelRuleDirection()))
+                    && (queryRemoteIPPrefix == null
+                            || queryRemoteIPPrefix.equals(oSS.getMeteringLabelRuleRemoteIPPrefix()))
+                    && (queryLabelID == null || queryLabelID.equals(oSS.getMeteringLabelRuleLabelID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronMeteringLabelRuleRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronMeteringLabelRuleRequest(ans)).build();
     }
 
     /**
@@ -129,15 +128,13 @@ public class NeutronMeteringLabelRulesNorthbound
     @Path("{ruleUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showMeteringLabelRule(
-            @PathParam("ruleUUID") String ruleUUID,
+    public Response showMeteringLabelRule(@PathParam("ruleUUID") String ruleUUID,
             // return fields
             @QueryParam("fields") List<String> fields) {
         return show(ruleUUID, fields);
@@ -149,8 +146,7 @@ public class NeutronMeteringLabelRulesNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(NeutronNetwork.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createMeteringLabelRule(final NeutronMeteringLabelRuleRequest input) {
         INeutronMeteringLabelRuleCRUD meteringLabelRuleInterface = getNeutronCRUD();
@@ -176,12 +172,10 @@ public class NeutronMeteringLabelRulesNorthbound
 
     @Path("{ruleUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteMeteringLabelRule(
-            @PathParam("ruleUUID") String ruleUUID) {
+    public Response deleteMeteringLabelRule(@PathParam("ruleUUID") String ruleUUID) {
         return delete(ruleUUID);
     }
 }
index 475af6217c943d19b6eac40dd021ef6a4a8a6246..4374cc5a1215cfd2d59e9bb55c8cc31fcb7393a1 100644 (file)
@@ -49,8 +49,8 @@ import org.opendaylight.neutron.spi.NeutronMeteringLabel;
  */
 
 @Path("/metering/metering-labels")
-public class NeutronMeteringLabelsNorthbound
-    extends AbstractNeutronNorthbound<NeutronMeteringLabel, NeutronMeteringLabelRequest, INeutronMeteringLabelCRUD> {
+public class NeutronMeteringLabelsNorthbound extends
+        AbstractNeutronNorthbound<NeutronMeteringLabel, NeutronMeteringLabelRequest, INeutronMeteringLabelCRUD> {
     private static final String RESOURCE_NAME = "Metering Label";
 
     @Override
@@ -86,8 +86,7 @@ public class NeutronMeteringLabelsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -98,27 +97,26 @@ public class NeutronMeteringLabelsNorthbound
             @QueryParam("id") String queryID,
             @QueryParam("name") String queryName,
             @QueryParam("tenant_id") String queryTenantID
-            // pagination and sorting are TODO
-            ) {
+    // pagination and sorting are TODO
+    ) {
         INeutronMeteringLabelCRUD labelInterface = getNeutronCRUD();
         List<NeutronMeteringLabel> allNeutronMeteringLabel = labelInterface.getAll();
-        List<NeutronMeteringLabel> ans = new ArrayList<NeutronMeteringLabel>();
+        List<NeutronMeteringLabel> ans = new ArrayList<>();
         Iterator<NeutronMeteringLabel> i = allNeutronMeteringLabel.iterator();
         while (i.hasNext()) {
             NeutronMeteringLabel oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryName == null || queryName.equals(oSS.getMeteringLabelName())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryName == null || queryName.equals(oSS.getMeteringLabelName()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronMeteringLabelRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronMeteringLabelRequest(ans)).build();
     }
 
     /**
@@ -127,15 +125,13 @@ public class NeutronMeteringLabelsNorthbound
     @Path("{labelUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showMeteringLabel(
-            @PathParam("labelUUID") String labelUUID,
+    public Response showMeteringLabel(@PathParam("labelUUID") String labelUUID,
             // return fields
             @QueryParam("fields") List<String> fields) {
         return show(labelUUID, fields);
@@ -147,8 +143,7 @@ public class NeutronMeteringLabelsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(NeutronNetwork.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createMeteringLabel(final NeutronMeteringLabelRequest input) {
         return create(input);
@@ -159,12 +154,10 @@ public class NeutronMeteringLabelsNorthbound
 
     @Path("{labelUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteMeteringLabel(
-            @PathParam("labelUUID") String labelUUID) {
+    public Response deleteMeteringLabel(@PathParam("labelUUID") String labelUUID) {
         return delete(labelUUID);
     }
 }
index 846f63d16ff7ae7f26e593012fd33856c3fb2b8c..0e301be36f2b834fe8daa602a219e971a7d7a650 100644 (file)
@@ -21,13 +21,13 @@ public class NeutronNetworkRequest implements INeutronRequest<NeutronNetwork> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="network")
+    @XmlElement(name = "network")
     NeutronNetwork singletonNetwork;
 
-    @XmlElement(name="networks")
+    @XmlElement(name = "networks")
     List<NeutronNetwork> bulkRequest;
 
-    @XmlElement(name="networks_links")
+    @XmlElement(name = "networks_links")
     List<NeutronPageLink> links;
 
     NeutronNetworkRequest() {
index decc8ef09f326cd2e1de109fba8f9a21d9f6f949..3f76d25ca232c7eb8059783341f659ced351952d 100644 (file)
@@ -53,7 +53,7 @@ import org.opendaylight.neutron.spi.NeutronNetwork;
 
 @Path("/networks")
 public class NeutronNetworksNorthbound
-    extends AbstractNeutronNorthbound<NeutronNetwork, NeutronNetworkRequest, INeutronNetworkCRUD> {
+        extends AbstractNeutronNorthbound<NeutronNetwork, NeutronNetworkRequest, INeutronNetworkCRUD> {
 
     @Context
     UriInfo uriInfo;
@@ -90,11 +90,10 @@ public class NeutronNetworksNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listNetworks(
             // return fields
             @QueryParam("fields") List<String> fields,
@@ -114,11 +113,11 @@ public class NeutronNetworksNorthbound
             @QueryParam("limit") Integer limit,
             @QueryParam("marker") String marker,
             @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
+    // sorting not supported
+    ) {
         INeutronNetworkCRUD networkInterface = getNeutronCRUD();
         List<NeutronNetwork> allNetworks = networkInterface.getAll();
-        List<NeutronNetwork> ans = new ArrayList<NeutronNetwork>();
+        List<NeutronNetwork> ans = new ArrayList<>();
         Iterator<NeutronNetwork> i = allNetworks.iterator();
         while (i.hasNext()) {
             NeutronNetwork oSN = i.next();
@@ -135,16 +134,16 @@ public class NeutronNetworksNorthbound
             if (queryRouterExternal != null) {
                 bRouterExternal = Boolean.valueOf(queryRouterExternal);
             }
-            if ((queryID == null || queryID.equals(oSN.getID())) &&
-                    (queryName == null || queryName.equals(oSN.getNetworkName())) &&
-                    (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp()) &&
-                    (queryStatus == null || queryStatus.equals(oSN.getStatus())) &&
-                    (bShared == null || bShared.booleanValue() == oSN.isShared()) &&
-                    (bRouterExternal == null || bRouterExternal.booleanValue() == oSN.isRouterExternal()) &&
-                    (queryTenantID == null || queryTenantID.equals(oSN.getTenantID())) &&
-                    (queryQosPolicyId == null || queryQosPolicyId.equals(oSN.getQosPolicyId()))) {
+            if ((queryID == null || queryID.equals(oSN.getID()))
+                    && (queryName == null || queryName.equals(oSN.getNetworkName()))
+                    && (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp())
+                    && (queryStatus == null || queryStatus.equals(oSN.getStatus()))
+                    && (bShared == null || bShared.booleanValue() == oSN.isShared())
+                    && (bRouterExternal == null || bRouterExternal.booleanValue() == oSN.isRouterExternal())
+                    && (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))
+                    && (queryQosPolicyId == null || queryQosPolicyId.equals(oSN.getQosPolicyId()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSN,fields));
+                    ans.add(extractFields(oSN, fields));
                 } else {
                     ans.add(oSN);
                 }
@@ -153,12 +152,12 @@ public class NeutronNetworksNorthbound
 
         if (limit != null && ans.size() > 1) {
             // Return a paginated request
-            NeutronNetworkRequest request = (NeutronNetworkRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronNetwork.class);
+            NeutronNetworkRequest request = (NeutronNetworkRequest) PaginatedRequestFactory.createRequest(limit, marker,
+                    pageReverse, uriInfo, ans, NeutronNetwork.class);
             return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
         }
 
-    return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronNetworkRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronNetworkRequest(ans)).build();
 
     }
 
@@ -169,17 +168,14 @@ public class NeutronNetworksNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showNetwork(
-            @PathParam("netUUID") String netUUID,
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response showNetwork(@PathParam("netUUID") String netUUID,
             // return fields
-            @QueryParam("fields") List<String> fields
-            ) {
+            @QueryParam("fields") List<String> fields) {
         return show(netUUID, fields);
     }
 
@@ -189,9 +185,8 @@ public class NeutronNetworksNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     @TypeHint(NeutronNetwork.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createNetworks(final NeutronNetworkRequest input) {
         return create(input);
     }
@@ -216,13 +211,10 @@ public class NeutronNetworksNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateNetwork(
-            @PathParam("netUUID") String netUUID, final NeutronNetworkRequest input
-            ) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response updateNetwork(@PathParam("netUUID") String netUUID, final NeutronNetworkRequest input) {
         return update(netUUID, input);
     }
 
@@ -231,12 +223,10 @@ public class NeutronNetworksNorthbound
 
     @Path("{netUUID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteNetwork(
-            @PathParam("netUUID") String netUUID) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deleteNetwork(@PathParam("netUUID") String netUUID) {
         return delete(netUUID);
     }
 }
index e5a1fb68643e094a978140cf9952b40c9fbe12dc..0cc0dae0fde7f3209a1084f01a751b2da14950b4 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Set;
 import javax.ws.rs.core.Application;
 import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
 
-
 /**
  * This class is an instance of javax.ws.rs.core.Application and is used to return the classes
  * that will be instantiated for JAXRS processing. This is necessary
@@ -28,7 +27,7 @@ public class NeutronNorthboundRSApplication extends Application {
     @Override
     public Set<Class<?>> getClasses() {
         Set<Class<?>> classes = new HashSet<Class<?>>();
-// northbound URIs
+        // northbound URIs
         classes.add(NeutronNetworksNorthbound.class);
         classes.add(NeutronSubnetsNorthbound.class);
         classes.add(NeutronPortsNorthbound.class);
index 40e268ba331101e11e403ce682d4f288414a05d9..6e20a55767590fc3950999c9e80e2d4059ef216b 100644 (file)
@@ -18,10 +18,10 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 public class NeutronPageLink {
 
-    @XmlElement(name="ref")
+    @XmlElement(name = "ref")
     String ref;
 
-    @XmlElement (name="href")
+    @XmlElement(name = "href")
     String href;
 
     public String getRef() {
index d7e37571d9305d6a3a27bb60936e9479f326aed6..9c70cbffbb6015a99e2082da68f748412ac38257 100644 (file)
@@ -21,13 +21,13 @@ public class NeutronPortRequest implements INeutronRequest<NeutronPort> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="port")
+    @XmlElement(name = "port")
     NeutronPort singletonPort;
 
-    @XmlElement(name="ports")
+    @XmlElement(name = "ports")
     List<NeutronPort> bulkRequest;
 
-    @XmlElement(name="ports_links")
+    @XmlElement(name = "ports_links")
     List<NeutronPageLink> links;
 
     NeutronPortRequest() {
index 2acb2736751ca4d246c3a9cf7f2ae7f38a858606..d7f5dbb7aa32f11a4c43313dd20f978d7ddcfc54 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.neutron.spi.NeutronPort;
 
 @Path("/ports")
 public class NeutronPortsNorthbound
-    extends AbstractNeutronNorthbound<NeutronPort, NeutronPortRequest, INeutronPortCRUD> {
+        extends AbstractNeutronNorthbound<NeutronPort, NeutronPortRequest, INeutronPortCRUD> {
 
     private static final String RESOURCE_NAME = "Port";
 
@@ -72,17 +72,17 @@ public class NeutronPortsNorthbound
             throw new ServiceUnavailableException(serviceUnavailable());
         }
         if (needNetworks) {
-            answer = answer.fetchINeutronNetworkCRUD( this);
+            answer = answer.fetchINeutronNetworkCRUD(this);
             if (answer.getNetworkInterface() == null) {
-                throw new ServiceUnavailableException("Network CRUD Interface "
-                        + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
         }
         if (needSubnets) {
-            answer = answer.fetchINeutronSubnetCRUD( this);
+            answer = answer.fetchINeutronSubnetCRUD(this);
             if (answer.getSubnetInterface() == null) {
-                throw new ServiceUnavailableException("Subnet CRUD Interface "
-                        + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
         }
         return answer;
@@ -107,11 +107,10 @@ public class NeutronPortsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listPorts(
             // return fields
             @QueryParam("fields") List<String> fields,
@@ -131,27 +130,28 @@ public class NeutronPortsNorthbound
             @QueryParam("limit") Integer limit,
             @QueryParam("marker") String marker,
             @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
+    // sorting not supported
+    ) {
         INeutronPortCRUD portInterface = getNeutronInterfaces(false, false).getPortInterface();
         List<NeutronPort> allPorts = portInterface.getAll();
-        List<NeutronPort> ans = new ArrayList<NeutronPort>();
+        List<NeutronPort> ans = new ArrayList<>();
         Iterator<NeutronPort> i = allPorts.iterator();
         while (i.hasNext()) {
             NeutronPort oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp())) &&
-                    (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
-                    (queryMACAddress == null || queryMACAddress.equals(oSS.getMacAddress())) &&
-                    (queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID())) &&
-                    (queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
-                    (queryPortSecurityEnabled == null || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled())) &&
-                    (queryQosPolicyId == null || queryQosPolicyId.equals(oSS.getQosPolicyId()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID()))
+                    && (queryName == null || queryName.equals(oSS.getName()))
+                    && (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp()))
+                    && (queryStatus == null || queryStatus.equals(oSS.getStatus()))
+                    && (queryMACAddress == null || queryMACAddress.equals(oSS.getMacAddress()))
+                    && (queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID()))
+                    && (queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
+                    && (queryPortSecurityEnabled == null
+                            || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled()))
+                    && (queryQosPolicyId == null || queryQosPolicyId.equals(oSS.getQosPolicyId()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
@@ -160,13 +160,12 @@ public class NeutronPortsNorthbound
 
         if (limit != null && ans.size() > 1) {
             // Return a paginated request
-            NeutronPortRequest request = (NeutronPortRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronPort.class);
+            NeutronPortRequest request = (NeutronPortRequest) PaginatedRequestFactory.createRequest(limit, marker,
+                    pageReverse, uriInfo, ans, NeutronPort.class);
             return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
         }
 
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronPortRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronPortRequest(ans)).build();
     }
 
     /**
@@ -176,16 +175,14 @@ public class NeutronPortsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showPort(
-            @PathParam("portUUID") String portUUID,
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response showPort(@PathParam("portUUID") String portUUID,
             // return fields
-            @QueryParam("fields") List<String> fields ) {
+            @QueryParam("fields") List<String> fields) {
         return show(portUUID, fields);
     }
 
@@ -196,9 +193,8 @@ public class NeutronPortsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createPorts(final NeutronPortRequest input) {
         getNeutronInterfaces(true, true); // Ensure that services for networks and subnets are loaded
         return create(input);
@@ -236,14 +232,10 @@ public class NeutronPortsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updatePort(
-            @PathParam("portUUID") String portUUID,
-            NeutronPortRequest input
-            ) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response updatePort(@PathParam("portUUID") String portUUID, NeutronPortRequest input) {
         //        TODO: Support change of security groups
         // update the port and return the modified object
         return update(portUUID, input);
@@ -254,12 +246,10 @@ public class NeutronPortsNorthbound
 
     @Path("{portUUID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deletePort(
-            @PathParam("portUUID") String portUUID) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deletePort(@PathParam("portUUID") String portUUID) {
         return delete(portUUID);
     }
 }
index 3b1945903f308f721d23efa113744465e4b8466c..78832ea4cb633286469392fbb04743629410d0d7 100644 (file)
@@ -29,8 +29,8 @@ import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronQosPolicy;
 
 @Path("/qos/policies")
-public class NeutronQosPolicyNorthbound extends
-    AbstractNeutronNorthbound<NeutronQosPolicy, NeutronQosPolicyRequest, INeutronQosPolicyCRUD> {
+public class NeutronQosPolicyNorthbound
+        extends AbstractNeutronNorthbound<NeutronQosPolicy, NeutronQosPolicyRequest, INeutronQosPolicyCRUD> {
 
     private static final String RESOURCE_NAME = "Qos Policy";
 
@@ -63,30 +63,29 @@ public class NeutronQosPolicyNorthbound extends
      */
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listGroups(
-        // return fields
-        @QueryParam("fields") List<String> fields,
-        // OpenStack qos Policy attributes
-        @QueryParam("id") String queryQosPolicyUUID,
-        @QueryParam("tenant_id") String queryQosPolicyTenantID,
-        @QueryParam("name") String queryQosPolicyName,
-        @QueryParam("shared") Boolean queryQosPolicyIsShared,
-        // pagination
-        @QueryParam("limit") String limit,
-        @QueryParam("marker") String marker,
-        @QueryParam("page_reverse") String pageReverse) {
+            // return fields
+            @QueryParam("fields") List<String> fields,
+            // OpenStack qos Policy attributes
+            @QueryParam("id") String queryQosPolicyUUID,
+            @QueryParam("tenant_id") String queryQosPolicyTenantID,
+            @QueryParam("name") String queryQosPolicyName,
+            @QueryParam("shared") Boolean queryQosPolicyIsShared,
+            // pagination
+            @QueryParam("limit") String limit,
+            @QueryParam("marker") String marker,
+            @QueryParam("page_reverse") String pageReverse) {
         INeutronQosPolicyCRUD qosPolicyInterface = getNeutronCRUD();
         List<NeutronQosPolicy> ans = new ArrayList<>();
         for (NeutronQosPolicy nsg : qosPolicyInterface.getAll()) {
-            if ((queryQosPolicyUUID == null || queryQosPolicyUUID.equals(nsg.getID())) &&
-                (queryQosPolicyTenantID == null || queryQosPolicyTenantID.equals(nsg.getTenantID())) &&
-                (queryQosPolicyName == null || queryQosPolicyName.equals(nsg.getQosPolicyName())) &&
-                (queryQosPolicyIsShared == null || queryQosPolicyIsShared.equals(nsg.getPolicyIsShared()))) {
+            if ((queryQosPolicyUUID == null || queryQosPolicyUUID.equals(nsg.getID()))
+                    && (queryQosPolicyTenantID == null || queryQosPolicyTenantID.equals(nsg.getTenantID()))
+                    && (queryQosPolicyName == null || queryQosPolicyName.equals(nsg.getQosPolicyName()))
+                    && (queryQosPolicyIsShared == null || queryQosPolicyIsShared.equals(nsg.getPolicyIsShared()))) {
                 if (fields.size() > 0) {
                     ans.add(extractFields(nsg, fields));
                 } else {
@@ -94,8 +93,7 @@ public class NeutronQosPolicyNorthbound extends
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-            new NeutronQosPolicyRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronQosPolicyRequest(ans)).build();
     }
 
     /**
@@ -104,15 +102,13 @@ public class NeutronQosPolicyNorthbound extends
     @Path("{qosPolicyUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showQosPolicy(
-        @PathParam("qosPolicyUUID") String qosPolicyUUID,
-        @QueryParam("fields") List<String> fields) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response showQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID,
+            @QueryParam("fields") List<String> fields) {
         return show(qosPolicyUUID, fields);
     }
 
@@ -122,9 +118,8 @@ public class NeutronQosPolicyNorthbound extends
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createQosPolicies(final NeutronQosPolicyRequest input) {
         return create(input);
     }
@@ -136,13 +131,11 @@ public class NeutronQosPolicyNorthbound extends
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateQosPolicy(
-        @PathParam("qosPolicyUUID") String qosPolicyUUID,
-        final NeutronQosPolicyRequest input) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response updateQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID,
+            final NeutronQosPolicyRequest input) {
         return update(qosPolicyUUID, input);
     }
 
@@ -151,12 +144,10 @@ public class NeutronQosPolicyNorthbound extends
      */
     @Path("{qosPolicyUUID}")
     @DELETE
-    @StatusCodes({
-        @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
-        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
-        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteQosPolicy(
-        @PathParam("qosPolicyUUID") String qosPolicyUUID) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+    public Response deleteQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID) {
         return delete(qosPolicyUUID);
     }
 }
index b80a271471a4f7f4cd8081dd9bfa7425d1bc3ccd..f2bc39d6a107385ec9e7e8b911376adfc0857d53 100644 (file)
@@ -15,19 +15,17 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronRouter;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronRouterRequest
-    implements INeutronRequest<NeutronRouter> {
+public class NeutronRouterRequest implements INeutronRequest<NeutronRouter> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="router")
+    @XmlElement(name = "router")
     NeutronRouter singletonRouter;
 
-    @XmlElement(name="routers")
+    @XmlElement(name = "routers")
     List<NeutronRouter> bulkRequest;
 
     NeutronRouterRequest() {
index 8fd50b2abcd8a59521d0537958439d4ee2273347..5d90070cd2f2589192989e73b25a3a44c8861c94 100644 (file)
@@ -30,7 +30,6 @@ import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.opendaylight.neutron.spi.NeutronRouter;
 import org.opendaylight.neutron.spi.NeutronRouter_Interface;
 
-
 /**
  * Neutron Northbound REST APIs.<br>
  * This class provides REST APIs for managing neutron routers
@@ -51,7 +50,7 @@ import org.opendaylight.neutron.spi.NeutronRouter_Interface;
 
 @Path("/routers")
 public class NeutronRoutersNorthbound
-    extends AbstractNeutronNorthbound<NeutronRouter, NeutronRouterRequest, INeutronRouterCRUD> {
+        extends AbstractNeutronNorthbound<NeutronRouter, NeutronRouterRequest, INeutronRouterCRUD> {
     static final String ROUTER_INTERFACE_STR = "network:router_interface";
     static final String ROUTER_GATEWAY_STR = "network:router_gateway";
     private static final String RESOURCE_NAME = "Router";
@@ -74,8 +73,8 @@ public class NeutronRoutersNorthbound
         if (flag) {
             answer = answer.fetchINeutronNetworkCRUD(this);
             if (answer.getNetworkInterface() == null) {
-                throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
         }
         return answer;
@@ -93,12 +92,11 @@ public class NeutronRoutersNorthbound
         }
         answer = answer.fetchINeutronPortCRUD(this).fetchINeutronSubnetCRUD(this);
         if (answer.getPortInterface() == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
+            throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
         }
         if (answer.getSubnetInterface() == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
+            throw new ServiceUnavailableException(
+                    "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
         }
         return answer;
     }
@@ -114,8 +112,7 @@ public class NeutronRoutersNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -133,33 +130,33 @@ public class NeutronRoutersNorthbound
             @QueryParam("limit") String limit,
             @QueryParam("marker") String marker,
             @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-            ) {
+    // sorting not supported
+    ) {
         INeutronRouterCRUD routerInterface = getNeutronInterfaces(false).getRouterInterface();
         if (routerInterface == null) {
             throw new ServiceUnavailableException(serviceUnavailable());
         }
         List<NeutronRouter> allRouters = routerInterface.getAll();
-        List<NeutronRouter> ans = new ArrayList<NeutronRouter>();
+        List<NeutronRouter> ans = new ArrayList<>();
         Iterator<NeutronRouter> i = allRouters.iterator();
         while (i.hasNext()) {
             NeutronRouter oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp())) &&
-                    (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
-                    (queryExternalGatewayInfo == null || queryExternalGatewayInfo.equals(oSS.getExternalGatewayInfo())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryName == null || queryName.equals(oSS.getName()))
+                    && (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp()))
+                    && (queryStatus == null || queryStatus.equals(oSS.getStatus()))
+                    && (queryExternalGatewayInfo == null
+                            || queryExternalGatewayInfo.equals(oSS.getExternalGatewayInfo()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronRouterRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronRouterRequest(ans)).build();
     }
 
     /**
@@ -169,15 +166,13 @@ public class NeutronRoutersNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showRouter(
-            @PathParam("routerUUID") String routerUUID,
+    public Response showRouter(@PathParam("routerUUID") String routerUUID,
             // return fields
             @QueryParam("fields") List<String> fields) {
         return show(routerUUID, fields);
@@ -190,8 +185,7 @@ public class NeutronRoutersNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createRouters(final NeutronRouterRequest input) {
         getNeutronInterfaces(true); // ensure that network service is loaded
@@ -212,14 +206,10 @@ public class NeutronRoutersNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateRouter(
-            @PathParam("routerUUID") String routerUUID,
-            NeutronRouterRequest input
-            ) {
+    public Response updateRouter(@PathParam("routerUUID") String routerUUID, NeutronRouterRequest input) {
         getNeutronInterfaces(true); // ensure that network service is loaded
         return update(routerUUID, input);
     }
@@ -229,12 +219,10 @@ public class NeutronRoutersNorthbound
 
     @Path("{routerUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteRouter(
-            @PathParam("routerUUID") String routerUUID) {
+    public Response deleteRouter(@PathParam("routerUUID") String routerUUID) {
         return delete(routerUUID);
     }
 
@@ -246,12 +234,8 @@ public class NeutronRoutersNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackRouterInterfaces.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
-    public Response addRouterInterface(
-            @PathParam("routerUUID") String routerUUID,
-            NeutronRouter_Interface input
-            ) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
+    public Response addRouterInterface(@PathParam("routerUUID") String routerUUID, NeutronRouter_Interface input) {
         // Do nothing. Keep this interface for compatibility
         return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
     }
@@ -261,12 +245,8 @@ public class NeutronRoutersNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackRouterInterfaces.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
-    public Response removeRouterInterface(
-            @PathParam("routerUUID") String routerUUID,
-            NeutronRouter_Interface input
-            ) {
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
+    public Response removeRouterInterface(@PathParam("routerUUID") String routerUUID, NeutronRouter_Interface input) {
         // Do nothing. Keep this interface for compatibility
         return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
     }
index ccc94c99388df2b801159bf5fcc60924f91cc389..4d6008d7010ca7d59e002017480c8e8e1b4b738d 100644 (file)
@@ -22,10 +22,10 @@ public class NeutronSFCFlowClassifierRequest implements INeutronRequest<NeutronS
     // See OpenStack Networking SFC (networking-sfc) API v1.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="flowclassifier")
+    @XmlElement(name = "flowclassifier")
     NeutronSFCFlowClassifier singletonSFCFlowClassifier;
 
-    @XmlElement(name="flowclassifiers")
+    @XmlElement(name = "flowclassifiers")
     List<NeutronSFCFlowClassifier> bulkRequest;
 
     NeutronSFCFlowClassifierRequest() {
index d9aa84e1f8f93f371ad4facc436a96c26c843ef2..04d9c3889aac12420888568a243bb27b2a72dfd1 100644 (file)
@@ -47,9 +47,8 @@ import org.opendaylight.neutron.spi.NeutronSFCFlowClassifier;
  */
 
 @Path("/sfc/flowclassifiers")
-public class NeutronSFCFlowClassifiersNorthbound
-        extends AbstractNeutronNorthbound<NeutronSFCFlowClassifier,
-        NeutronSFCFlowClassifierRequest,INeutronSFCFlowClassifierCRUD>{
+public class NeutronSFCFlowClassifiersNorthbound extends AbstractNeutronNorthbound<NeutronSFCFlowClassifier,
+        NeutronSFCFlowClassifierRequest, INeutronSFCFlowClassifierCRUD> {
     private static final String RESOURCE_NAME = "Sfc Flow Classifier";
 
     @Override
@@ -81,8 +80,7 @@ public class NeutronSFCFlowClassifiersNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -102,31 +100,33 @@ public class NeutronSFCFlowClassifiersNorthbound
             @QueryParam("source_ip_prefix") String querySourceIpPrefix,
             @QueryParam("destination_ip_prefix") String queryDestinationIpPrefix,
             @QueryParam("logical_source_port") String queryLogicalSourcePort,
-            @QueryParam("logical_destination_port") String queryLogicalDestinationPort
-    ) {
+            @QueryParam("logical_destination_port") String queryLogicalDestinationPort) {
         INeutronSFCFlowClassifierCRUD sfcFlowClassifierInterface = getNeutronCRUD();
         List<NeutronSFCFlowClassifier> allSFCFlowClassifier = sfcFlowClassifierInterface.getAll();
         List<NeutronSFCFlowClassifier> ans = new ArrayList<>();
         Iterator<NeutronSFCFlowClassifier> i = allSFCFlowClassifier.iterator();
         while (i.hasNext()) {
             NeutronSFCFlowClassifier oSFC = i.next();
-            if ((queryID == null || queryID.equals(oSFC.getID())) &&
-                    (queryName == null || queryName.equals(oSFC.getName())) &&
-                    (queryEthertype == null || queryEthertype.equals(oSFC.getEthertype())) &&
-                    (queryProtocol == null || queryProtocol.equals(oSFC.getProtocol())) &&
-                    (querySourcePortRangeMin == null || querySourcePortRangeMin.equals(oSFC.getSourcePortRangeMin())) &&
-                    (querySourcePortRangeMax == null || querySourcePortRangeMax.equals(oSFC.getSourcePortRangeMax())) &&
-                    (queryDestinationPortRangeMin == null
-                            || queryDestinationPortRangeMin.equals(oSFC.getDestinationPortRangeMin())) &&
-                    (queryDestinationPortRangeMax == null
-                            || queryDestinationPortRangeMax.equals(oSFC.getDestinationPortRangeMax())) &&
-                    (querySourceIpPrefix == null || querySourceIpPrefix.equals(oSFC.getSourceIpPrefix())) &&
-                    (queryDestinationIpPrefix == null || queryDestinationIpPrefix.equals(oSFC.getDestinationIpPrefix())) &&
-                    (queryLogicalSourcePort == null || queryLogicalSourcePort.equals(oSFC.getLogicalSourcePortUUID())) &&
-                    (queryLogicalDestinationPort == null || queryLogicalDestinationPort.equals(oSFC.getLogicalDestinationPortUUID())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSFC.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSFC.getID()))
+                    && (queryName == null || queryName.equals(oSFC.getName()))
+                    && (queryEthertype == null || queryEthertype.equals(oSFC.getEthertype()))
+                    && (queryProtocol == null || queryProtocol.equals(oSFC.getProtocol()))
+                    && (querySourcePortRangeMin == null || querySourcePortRangeMin.equals(oSFC.getSourcePortRangeMin()))
+                    && (querySourcePortRangeMax == null || querySourcePortRangeMax.equals(oSFC.getSourcePortRangeMax()))
+                    && (queryDestinationPortRangeMin == null
+                            || queryDestinationPortRangeMin.equals(oSFC.getDestinationPortRangeMin()))
+                    && (queryDestinationPortRangeMax == null
+                            || queryDestinationPortRangeMax.equals(oSFC.getDestinationPortRangeMax()))
+                    && (querySourceIpPrefix == null || querySourceIpPrefix.equals(oSFC.getSourceIpPrefix()))
+                    && (queryDestinationIpPrefix == null
+                            || queryDestinationIpPrefix.equals(oSFC.getDestinationIpPrefix()))
+                    && (queryLogicalSourcePort == null
+                            || queryLogicalSourcePort.equals(oSFC.getLogicalSourcePortUUID()))
+                    && (queryLogicalDestinationPort == null
+                            || queryLogicalDestinationPort.equals(oSFC.getLogicalDestinationPortUUID()))
+                    && (queryTenantID == null || queryTenantID.equals(oSFC.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSFC,fields));
+                    ans.add(extractFields(oSFC, fields));
                 } else {
                     ans.add(oSFC);
                 }
@@ -143,17 +143,14 @@ public class NeutronSFCFlowClassifiersNorthbound
     @Path("{flowClassifierUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSFCFlowClassifier(
-            @PathParam("flowClassifierUUID") String sfcFlowClassifierUUID,
+    public Response showSFCFlowClassifier(@PathParam("flowClassifierUUID") String sfcFlowClassifierUUID,
             // return fields
-            @QueryParam("fields") List<String> fields
-    ) {
+            @QueryParam("fields") List<String> fields) {
         return show(sfcFlowClassifierUUID, fields);
     }
 
@@ -162,8 +159,7 @@ public class NeutronSFCFlowClassifiersNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSFCFlowClassifier(final NeutronSFCFlowClassifierRequest input) {
         return create(input);
@@ -188,13 +184,11 @@ public class NeutronSFCFlowClassifiersNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSFCFlowClassifier(
-            @PathParam("flowClassifierUUID") String sfcFlowClassifierUUID, final NeutronSFCFlowClassifierRequest input
-    ) {
+    public Response updateSFCFlowClassifier(@PathParam("flowClassifierUUID") String sfcFlowClassifierUUID,
+            final NeutronSFCFlowClassifierRequest input) {
         return update(sfcFlowClassifierUUID, input);
     }
 
@@ -202,12 +196,10 @@ public class NeutronSFCFlowClassifiersNorthbound
      * Deletes the SFC Flow Classifier */
     @Path("{flowClassifierUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSFCFlowClassifier(
-            @PathParam("flowClassifierUUID") String sfcFlowClassifierUUID) {
+    public Response deleteSFCFlowClassifier(@PathParam("flowClassifierUUID") String sfcFlowClassifierUUID) {
         return delete(sfcFlowClassifierUUID);
     }
 }
index 7219e2be60c104410b86459e44a9f881a302131b..dc1d01a9d618e2b5c50d9a807291764ccc2cded3 100644 (file)
@@ -21,10 +21,10 @@ public class NeutronSFCPortChainRequest implements INeutronRequest<NeutronSFCPor
     // See OpenStack Networking SFC (networking-sfc) Port Chain API v1.0 Reference
     // for description of annotated attributes
 
-    @XmlElement(name="portchain")
+    @XmlElement(name = "portchain")
     NeutronSFCPortChain singletonPortChain;
 
-    @XmlElement(name="portchains")
+    @XmlElement(name = "portchains")
     List<NeutronSFCPortChain> bulkRequest;
 
     NeutronSFCPortChainRequest() {
index f4dd067efd090cc2601ba211b7501200b0ff954c..8ed8638e3fd698bdaad6c30ce151ff400c6e3156 100644 (file)
@@ -48,8 +48,7 @@ import org.opendaylight.neutron.spi.NeutronSFCPortChain;
 
 @Path("/sfc/portchains")
 public class NeutronSFCPortChainsNorthbound
-        extends AbstractNeutronNorthbound<NeutronSFCPortChain,
-        NeutronSFCPortChainRequest, INeutronSFCPortChainCRUD> {
+        extends AbstractNeutronNorthbound<NeutronSFCPortChain, NeutronSFCPortChainRequest, INeutronSFCPortChainCRUD> {
 
     private static final String RESOURCE_NAME = "Sfc Port Chain";
 
@@ -82,8 +81,7 @@ public class NeutronSFCPortChainsNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -99,11 +97,11 @@ public class NeutronSFCPortChainsNorthbound
         Iterator<NeutronSFCPortChain> i = allSFCPortChain.iterator();
         while (i.hasNext()) {
             NeutronSFCPortChain oSFCPC = i.next();
-            if ((queryID == null || queryID.equals(oSFCPC.getID())) &&
-                    (queryName == null || queryName.equals(oSFCPC.getName())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSFCPC.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSFCPC.getID()))
+                    && (queryName == null || queryName.equals(oSFCPC.getName()))
+                    && (queryTenantID == null || queryTenantID.equals(oSFCPC.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSFCPC,fields));
+                    ans.add(extractFields(oSFCPC, fields));
                 } else {
                     ans.add(oSFCPC);
                 }
@@ -120,14 +118,12 @@ public class NeutronSFCPortChainsNorthbound
     @Path("{portChainUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSFCPortChain(
-            @PathParam("portChainUUID") String sfcPortChainUUID,
+    public Response showSFCPortChain(@PathParam("portChainUUID") String sfcPortChainUUID,
             // return fields
             @QueryParam("fields") List<String> fields) {
         return show(sfcPortChainUUID, fields);
@@ -138,8 +134,7 @@ public class NeutronSFCPortChainsNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSFCPortChain(final NeutronSFCPortChainRequest input) {
         return create(input);
@@ -164,12 +159,11 @@ public class NeutronSFCPortChainsNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSFCPortChain(
-            @PathParam("portChainUUID") String sfcPortChainUUID, final NeutronSFCPortChainRequest input) {
+    public Response updateSFCPortChain(@PathParam("portChainUUID") String sfcPortChainUUID,
+            final NeutronSFCPortChainRequest input) {
         return update(sfcPortChainUUID, input);
     }
 
@@ -177,12 +171,10 @@ public class NeutronSFCPortChainsNorthbound
      * Deletes the SFC Port Chain */
     @Path("{portChainUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSFCPortChain(
-            @PathParam("portChainUUID") String sfcPortChainUUID) {
+    public Response deleteSFCPortChain(@PathParam("portChainUUID") String sfcPortChainUUID) {
         return delete(sfcPortChainUUID);
     }
 }
index 88ac4fb94739fb66f762e223b8d73730c624d3e4..647f62dcbbbb256beaaba12b58277bd91a79c755 100644 (file)
@@ -21,10 +21,10 @@ public class NeutronSFCPortPairGroupRequest implements INeutronRequest<NeutronSF
     // See OpenStack Networking SFC (networking-sfc) Port Pair Group API v1.0 Reference
     // for description of annotated attributes
 
-    @XmlElement(name="portpairgroup")
+    @XmlElement(name = "portpairgroup")
     NeutronSFCPortPairGroup singletonPortPairGroup;
 
-    @XmlElement(name="portpairgroups")
+    @XmlElement(name = "portpairgroups")
     List<NeutronSFCPortPairGroup> bulkRequest;
 
     NeutronSFCPortPairGroupRequest() {
index 2f3517e139a13dc23b531c01e33d4c8d75c6a422..3e4712f7e8e1323de773e3f3dade7823d5676879 100644 (file)
@@ -47,8 +47,7 @@ import org.opendaylight.neutron.spi.NeutronSFCPortPairGroup;
  */
 
 @Path("/sfc/portpairgroups")
-public class NeutronSFCPortPairGroupsNorthbound
-        extends AbstractNeutronNorthbound<NeutronSFCPortPairGroup,
+public class NeutronSFCPortPairGroupsNorthbound extends AbstractNeutronNorthbound<NeutronSFCPortPairGroup,
         NeutronSFCPortPairGroupRequest, INeutronSFCPortPairGroupCRUD> {
 
     private static final String RESOURCE_NAME = "Sfc Port Pair Group";
@@ -82,8 +81,7 @@ public class NeutronSFCPortPairGroupsNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -93,18 +91,18 @@ public class NeutronSFCPortPairGroupsNorthbound
             @QueryParam("id") String queryID,
             @QueryParam("name") String queryName,
             @QueryParam("tenant_id") String queryTenantID,
-            @QueryParam("port_pairs") List<String> queryPortPairsUUID ) {
+            @QueryParam("port_pairs") List<String> queryPortPairsUUID) {
         INeutronSFCPortPairGroupCRUD sfcPortPairGroupInterface = getNeutronCRUD();
         List<NeutronSFCPortPairGroup> allSFCPortPairGroup = sfcPortPairGroupInterface.getAll();
         List<NeutronSFCPortPairGroup> ans = new ArrayList<>();
         Iterator<NeutronSFCPortPairGroup> i = allSFCPortPairGroup.iterator();
         while (i.hasNext()) {
             NeutronSFCPortPairGroup oSFCPPG = i.next();
-            if ((queryID == null || queryID.equals(oSFCPPG.getID())) &&
-                    (queryName == null || queryName.equals(oSFCPPG.getName())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSFCPPG.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSFCPPG.getID()))
+                    && (queryName == null || queryName.equals(oSFCPPG.getName()))
+                    && (queryTenantID == null || queryTenantID.equals(oSFCPPG.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSFCPPG,fields));
+                    ans.add(extractFields(oSFCPPG, fields));
                 } else {
                     ans.add(oSFCPPG);
                 }
@@ -121,16 +119,14 @@ public class NeutronSFCPortPairGroupsNorthbound
     @Path("{portPairGroupUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSFCPortPairGroup(
-            @PathParam("portPairGroupUUID") String sfcPortPairGroupUUID,
+    public Response showSFCPortPairGroup(@PathParam("portPairGroupUUID") String sfcPortPairGroupUUID,
             // return fields
-            @QueryParam("fields") List<String> fields ){
+            @QueryParam("fields") List<String> fields{
         return show(sfcPortPairGroupUUID, fields);
     }
 
@@ -139,8 +135,7 @@ public class NeutronSFCPortPairGroupsNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSFCPortPairGroup(final NeutronSFCPortPairGroupRequest input) {
         return create(input);
@@ -165,12 +160,11 @@ public class NeutronSFCPortPairGroupsNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSFCPortPairGroup(
-            @PathParam("portPairGroupUUID") String sfcPortPairGroupUUID, final NeutronSFCPortPairGroupRequest input ) {
+    public Response updateSFCPortPairGroup(@PathParam("portPairGroupUUID") String sfcPortPairGroupUUID,
+            final NeutronSFCPortPairGroupRequest input) {
         return update(sfcPortPairGroupUUID, input);
     }
 
@@ -179,12 +173,10 @@ public class NeutronSFCPortPairGroupsNorthbound
 
     @Path("{portPairGroupUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSFCPortPairGroup(
-            @PathParam("portPairGroupUUID") String sfcPortPairGroupUUID) {
+    public Response deleteSFCPortPairGroup(@PathParam("portPairGroupUUID") String sfcPortPairGroupUUID) {
         return delete(sfcPortPairGroupUUID);
     }
 }
index 4a6067118f4226a5b80683d8f623d96180835ae7..068605636d37fee6e4814f3e4a12e012a88b5a99 100644 (file)
@@ -17,14 +17,14 @@ import org.opendaylight.neutron.spi.NeutronSFCPortPair;
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronSFCPortPairRequest  implements INeutronRequest<NeutronSFCPortPair> {
+public class NeutronSFCPortPairRequest implements INeutronRequest<NeutronSFCPortPair> {
     // See OpenStack Networking SFC (networking-sfc) Port Pair API v1.0 Reference
     // for description of annotated attributes
 
-    @XmlElement(name="portpair")
+    @XmlElement(name = "portpair")
     NeutronSFCPortPair singletonPortPair;
 
-    @XmlElement(name="portpairs")
+    @XmlElement(name = "portpairs")
     List<NeutronSFCPortPair> bulkRequest;
 
     NeutronSFCPortPairRequest() {
index bd461b7137ea83bd8d59e152f4913408fa217d93..1d57ecf8282fb001f739537d68236e8d2327a7ae 100644 (file)
@@ -48,8 +48,7 @@ import org.opendaylight.neutron.spi.NeutronSFCPortPair;
 
 @Path("/sfc/portpairs")
 public class NeutronSFCPortPairsNorthbound
-        extends AbstractNeutronNorthbound<NeutronSFCPortPair,
-        NeutronSFCPortPairRequest, INeutronSFCPortPairCRUD> {
+        extends AbstractNeutronNorthbound<NeutronSFCPortPair, NeutronSFCPortPairRequest, INeutronSFCPortPairCRUD> {
 
     private static final String RESOURCE_NAME = "Sfc Port Pair";
 
@@ -82,8 +81,7 @@ public class NeutronSFCPortPairsNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -94,21 +92,20 @@ public class NeutronSFCPortPairsNorthbound
             @QueryParam("name") String queryName,
             @QueryParam("tenant_id") String queryTenantID,
             @QueryParam("ingress") String queryIngressPort,
-            @QueryParam("egress") String queryEgressPort
-    ) {
+            @QueryParam("egress") String queryEgressPort) {
         INeutronSFCPortPairCRUD sfcPortPairInterface = getNeutronCRUD();
         List<NeutronSFCPortPair> allSFCPortPair = sfcPortPairInterface.getAll();
         List<NeutronSFCPortPair> ans = new ArrayList<>();
         Iterator<NeutronSFCPortPair> i = allSFCPortPair.iterator();
         while (i.hasNext()) {
             NeutronSFCPortPair oSFCPP = i.next();
-            if ((queryID == null || queryID.equals(oSFCPP.getID())) &&
-                    (queryName == null || queryName.equals(oSFCPP.getName())) &&
-                    (queryIngressPort == null || queryIngressPort.equals(oSFCPP.getIngressPortUUID())) &&
-                    (queryEgressPort == null || queryEgressPort.equals(oSFCPP.getEgressPortUUID())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSFCPP.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSFCPP.getID()))
+                    && (queryName == null || queryName.equals(oSFCPP.getName()))
+                    && (queryIngressPort == null || queryIngressPort.equals(oSFCPP.getIngressPortUUID()))
+                    && (queryEgressPort == null || queryEgressPort.equals(oSFCPP.getEgressPortUUID()))
+                    && (queryTenantID == null || queryTenantID.equals(oSFCPP.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSFCPP,fields));
+                    ans.add(extractFields(oSFCPP, fields));
                 } else {
                     ans.add(oSFCPP);
                 }
@@ -125,17 +122,14 @@ public class NeutronSFCPortPairsNorthbound
     @Path("{portPairUUID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSFCPortPair(
-            @PathParam("portPairUUID") String sfcPortPairUUID,
+    public Response showSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID,
             // return fields
-            @QueryParam("fields") List<String> fields
-    ) {
+            @QueryParam("fields") List<String> fields) {
         return show(sfcPortPairUUID, fields);
     }
 
@@ -144,8 +138,7 @@ public class NeutronSFCPortPairsNorthbound
     @POST
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSFCPortPair(final NeutronSFCPortPairRequest input) {
         return create(input);
@@ -170,13 +163,11 @@ public class NeutronSFCPortPairsNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSFCPortPair(
-            @PathParam("portPairUUID") String sfcPortPairUUID, final NeutronSFCPortPairRequest input
-    ) {
+    public Response updateSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID,
+            final NeutronSFCPortPairRequest input) {
         return update(sfcPortPairUUID, input);
     }
 
@@ -185,12 +176,10 @@ public class NeutronSFCPortPairsNorthbound
 
     @Path("{portPairUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSFCPortPair(
-            @PathParam("portPairUUID") String sfcPortPairUUID) {
+    public Response deleteSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID) {
         return delete(sfcPortPairUUID);
     }
 
index 8b9864f043be4a6eda81773e93003ce24bb03ac7..3d88561295113e4e2dd2ded72aa3abb75bfd3d23 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronSecurityGroup;
 
-
 @XmlRootElement
-@XmlAccessorType (XmlAccessType.NONE)
+@XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronSecurityGroupRequest
-    implements INeutronRequest<NeutronSecurityGroup> {
+public class NeutronSecurityGroupRequest implements INeutronRequest<NeutronSecurityGroup> {
     /**
     * See OpenStack Network API v2.0 Reference for a
     * description of annotated attributes and operations
     */
 
-    @XmlElement (name = "security_group")
+    @XmlElement(name = "security_group")
     NeutronSecurityGroup singletonSecurityGroup;
 
-    @XmlElement (name = "security_groups")
+    @XmlElement(name = "security_groups")
     List<NeutronSecurityGroup> bulkRequest;
 
     NeutronSecurityGroupRequest() {
index d1ecf48df303db2b21ad934a84120d0ee9a3808d..eeb3597443eeee1ab9d4cc6345ddff5af0abe64d 100644 (file)
@@ -45,9 +45,9 @@ import org.opendaylight.neutron.spi.NeutronSecurityGroup;
  * More info :
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
  */
-@Path ("/security-groups")
-public class NeutronSecurityGroupsNorthbound
-    extends AbstractNeutronNorthbound<NeutronSecurityGroup, NeutronSecurityGroupRequest, INeutronSecurityGroupCRUD> {
+@Path("/security-groups")
+public class NeutronSecurityGroupsNorthbound extends
+        AbstractNeutronNorthbound<NeutronSecurityGroup, NeutronSecurityGroupRequest, INeutronSecurityGroupCRUD> {
     private static final String RESOURCE_NAME = "Security Group";
 
     @Override
@@ -78,36 +78,31 @@ public class NeutronSecurityGroupsNorthbound
      * Returns a list of all Security Groups
      */
     @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-            @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
 
     public Response listGroups(
             // return fields
-            @QueryParam ("fields") List<String> fields,
+            @QueryParam("fields") List<String> fields,
             // OpenStack security group attributes
-            @QueryParam ("id") String querySecurityGroupUUID,
-            @QueryParam ("name") String querySecurityGroupName,
-            @QueryParam ("tenant_id") String querySecurityTenantID,
-            @QueryParam ("limit") String limit,
-            @QueryParam ("marker") String marker,
-            @QueryParam ("page_reverse") String pageReverse
-    ) {
+            @QueryParam("id") String querySecurityGroupUUID,
+            @QueryParam("name") String querySecurityGroupName,
+            @QueryParam("tenant_id") String querySecurityTenantID,
+            @QueryParam("limit") String limit,
+            @QueryParam("marker") String marker,
+            @QueryParam("page_reverse") String pageReverse) {
         INeutronSecurityGroupCRUD securityGroupInterface = getNeutronCRUD();
         List<NeutronSecurityGroup> allSecurityGroups = securityGroupInterface.getAll();
-        List<NeutronSecurityGroup> ans = new ArrayList<NeutronSecurityGroup>();
+        List<NeutronSecurityGroup> ans = new ArrayList<>();
         Iterator<NeutronSecurityGroup> i = allSecurityGroups.iterator();
         while (i.hasNext()) {
             NeutronSecurityGroup nsg = i.next();
-            if ((querySecurityGroupUUID == null ||
-                    querySecurityGroupUUID.equals(nsg.getID())) &&
-                    (querySecurityGroupName == null ||
-                            querySecurityGroupName.equals(nsg.getSecurityGroupName())) &&
-                    (querySecurityTenantID == null ||
-                            querySecurityTenantID.equals(nsg.getTenantID()))) {
+            if ((querySecurityGroupUUID == null || querySecurityGroupUUID.equals(nsg.getID()))
+                    && (querySecurityGroupName == null || querySecurityGroupName.equals(nsg.getSecurityGroupName()))
+                    && (querySecurityTenantID == null || querySecurityTenantID.equals(nsg.getTenantID()))) {
                 if (fields.size() > 0) {
                     ans.add(extractFields(nsg, fields));
                 } else {
@@ -115,26 +110,24 @@ public class NeutronSecurityGroupsNorthbound
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronSecurityGroupRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSecurityGroupRequest(ans)).build();
     }
 
     /**
      * Returns a specific Security Group
      */
 
-    @Path ("{securityGroupUUID}")
+    @Path("{securityGroupUUID}")
     @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-            @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-            @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSecurityGroup(@PathParam ("securityGroupUUID") String securityGroupUUID,
-                                      // return fields
-                                      @QueryParam ("fields") List<String> fields) {
+    public Response showSecurityGroup(@PathParam("securityGroupUUID") String securityGroupUUID,
+            // return fields
+            @QueryParam("fields") List<String> fields) {
         return show(securityGroupUUID, fields);
     }
 
@@ -143,10 +136,9 @@ public class NeutronSecurityGroupsNorthbound
      */
 
     @POST
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSecurityGroups(final NeutronSecurityGroupRequest input) {
         return create(input);
@@ -156,16 +148,15 @@ public class NeutronSecurityGroupsNorthbound
      * Updates a Security Group
      */
 
-    @Path ("{securityGroupUUID}")
+    @Path("{securityGroupUUID}")
     @PUT
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSecurityGroup(
-            @PathParam ("securityGroupUUID") String securityGroupUUID, final NeutronSecurityGroupRequest input) {
+    public Response updateSecurityGroup(@PathParam("securityGroupUUID") String securityGroupUUID,
+            final NeutronSecurityGroupRequest input) {
         return update(securityGroupUUID, input);
     }
 
@@ -173,14 +164,12 @@ public class NeutronSecurityGroupsNorthbound
      * Deletes a Security Group
      */
 
-    @Path ("{securityGroupUUID}")
+    @Path("{securityGroupUUID}")
     @DELETE
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSecurityGroup(
-            @PathParam ("securityGroupUUID") String securityGroupUUID) {
+    public Response deleteSecurityGroup(@PathParam("securityGroupUUID") String securityGroupUUID) {
         return delete(securityGroupUUID);
     }
 }
index dfc8cb2f930f5bd202d46abb2666b91f4f035bff..60dac14ba7d465099037a5c163bcff20ac1c21ff 100644 (file)
@@ -15,21 +15,19 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.neutron.spi.NeutronSecurityRule;
 
-
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronSecurityRuleRequest
-    implements INeutronRequest<NeutronSecurityRule> {
+public class NeutronSecurityRuleRequest implements INeutronRequest<NeutronSecurityRule> {
     /**
      * See OpenStack Network API v2.0 Reference for a
      * description of annotated attributes and operations
      */
 
-    @XmlElement(name="security_group_rule")
+    @XmlElement(name = "security_group_rule")
     NeutronSecurityRule singletonSecurityRule;
 
-    @XmlElement(name="security_group_rules")
+    @XmlElement(name = "security_group_rules")
     List<NeutronSecurityRule> bulkRequest;
 
     NeutronSecurityRuleRequest() {
index 28cf1ed6607d0fe3053441e2c40839c4703e946e..6acb8e0a54c51377a130308ac73909086dde3280 100644 (file)
@@ -46,9 +46,9 @@ import org.opendaylight.neutron.spi.NeutronSecurityRule;
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
  */
 
-@Path ("/security-group-rules")
+@Path("/security-group-rules")
 public class NeutronSecurityRulesNorthbound
-    extends AbstractNeutronNorthbound<NeutronSecurityRule, NeutronSecurityRuleRequest, INeutronSecurityRuleCRUD> {
+        extends AbstractNeutronNorthbound<NeutronSecurityRule, NeutronSecurityRuleRequest, INeutronSecurityRuleCRUD> {
     private static final String RESOURCE_NAME = "Security Rule";
 
     @Override
@@ -79,56 +79,52 @@ public class NeutronSecurityRulesNorthbound
      * Returns a list of all Security Rules
      */
     @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-            @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response listRules(
             // return fields
-            @QueryParam ("fields") List<String> fields,
+            @QueryParam("fields") List<String> fields,
             // OpenStack security rule attributes
-            @QueryParam ("id") String querySecurityRuleUUID,
-            @QueryParam ("direction") String querySecurityRuleDirection,
-            @QueryParam ("protocol") String querySecurityRuleProtocol,
-            @QueryParam ("port_range_min") Integer querySecurityRulePortMin,
-            @QueryParam ("port_range_max") Integer querySecurityRulePortMax,
-            @QueryParam ("ethertype") String querySecurityRuleEthertype,
-            @QueryParam ("remote_ip_prefix") String querySecurityRuleIpPrefix,
-            @QueryParam ("remote_group_id") String querySecurityRemoteGroupID,
-            @QueryParam ("security_group_id") String querySecurityRuleGroupID,
-            @QueryParam ("tenant_id") String querySecurityRuleTenantID,
-            @QueryParam ("limit") String limit,
-            @QueryParam ("marker") String marker,
-            @QueryParam ("page_reverse") String pageReverse
-    ) {
+            @QueryParam("id") String querySecurityRuleUUID,
+            @QueryParam("direction") String querySecurityRuleDirection,
+            @QueryParam("protocol") String querySecurityRuleProtocol,
+            @QueryParam("port_range_min") Integer querySecurityRulePortMin,
+            @QueryParam("port_range_max") Integer querySecurityRulePortMax,
+            @QueryParam("ethertype") String querySecurityRuleEthertype,
+            @QueryParam("remote_ip_prefix") String querySecurityRuleIpPrefix,
+            @QueryParam("remote_group_id") String querySecurityRemoteGroupID,
+            @QueryParam("security_group_id") String querySecurityRuleGroupID,
+            @QueryParam("tenant_id") String querySecurityRuleTenantID,
+            @QueryParam("limit") String limit,
+            @QueryParam("marker") String marker,
+            @QueryParam("page_reverse") String pageReverse) {
         INeutronSecurityRuleCRUD securityRuleInterface = getNeutronCRUD();
         List<NeutronSecurityRule> allSecurityRules = securityRuleInterface.getAll();
-        List<NeutronSecurityRule> ans = new ArrayList<NeutronSecurityRule>();
+        List<NeutronSecurityRule> ans = new ArrayList<>();
         Iterator<NeutronSecurityRule> i = allSecurityRules.iterator();
         while (i.hasNext()) {
             NeutronSecurityRule nsr = i.next();
-            if ((querySecurityRuleUUID == null ||
-                    querySecurityRuleUUID.equals(nsr.getID())) &&
-                    (querySecurityRuleDirection == null ||
-                            querySecurityRuleDirection.equals(nsr.getSecurityRuleDirection())) &&
-                    (querySecurityRuleProtocol == null ||
-                            querySecurityRuleProtocol.equals(nsr.getSecurityRuleProtocol())) &&
-                    (querySecurityRulePortMin == null ||
-                            querySecurityRulePortMin.equals(nsr.getSecurityRulePortMin())) &&
-                    (querySecurityRulePortMax == null ||
-                            querySecurityRulePortMax.equals(nsr.getSecurityRulePortMax())) &&
-                    (querySecurityRuleEthertype == null ||
-                            querySecurityRuleEthertype.equals(nsr.getSecurityRuleEthertype())) &&
-                    (querySecurityRuleIpPrefix == null ||
-                            querySecurityRuleIpPrefix.equals(nsr.getSecurityRuleRemoteIpPrefix())) &&
-                    (querySecurityRuleGroupID == null ||
-                            querySecurityRuleGroupID.equals(nsr.getSecurityRuleGroupID())) &&
-                    (querySecurityRemoteGroupID == null ||
-                            querySecurityRemoteGroupID.equals(nsr.getSecurityRemoteGroupID())) &&
-                    (querySecurityRuleTenantID == null ||
-                            querySecurityRuleTenantID.equals(nsr.getTenantID()))) {
+            if ((querySecurityRuleUUID == null || querySecurityRuleUUID.equals(nsr.getID()))
+                    && (querySecurityRuleDirection == null
+                            || querySecurityRuleDirection.equals(nsr.getSecurityRuleDirection()))
+                    && (querySecurityRuleProtocol == null
+                            || querySecurityRuleProtocol.equals(nsr.getSecurityRuleProtocol()))
+                    && (querySecurityRulePortMin == null
+                            || querySecurityRulePortMin.equals(nsr.getSecurityRulePortMin()))
+                    && (querySecurityRulePortMax == null
+                            || querySecurityRulePortMax.equals(nsr.getSecurityRulePortMax()))
+                    && (querySecurityRuleEthertype == null
+                            || querySecurityRuleEthertype.equals(nsr.getSecurityRuleEthertype()))
+                    && (querySecurityRuleIpPrefix == null
+                            || querySecurityRuleIpPrefix.equals(nsr.getSecurityRuleRemoteIpPrefix()))
+                    && (querySecurityRuleGroupID == null
+                            || querySecurityRuleGroupID.equals(nsr.getSecurityRuleGroupID()))
+                    && (querySecurityRemoteGroupID == null
+                            || querySecurityRemoteGroupID.equals(nsr.getSecurityRemoteGroupID()))
+                    && (querySecurityRuleTenantID == null || querySecurityRuleTenantID.equals(nsr.getTenantID()))) {
                 if (fields.size() > 0) {
                     ans.add(extractFields(nsr, fields));
                 } else {
@@ -136,26 +132,24 @@ public class NeutronSecurityRulesNorthbound
                 }
             }
         }
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronSecurityRuleRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSecurityRuleRequest(ans)).build();
     }
 
     /**
      * Returns a specific Security Rule
      */
 
-    @Path ("{securityRuleUUID}")
+    @Path("{securityRuleUUID}")
     @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
-            @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
-            @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+            @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+            @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSecurityRule(@PathParam ("securityRuleUUID") String securityRuleUUID,
-                                     // return fields
-                                     @QueryParam ("fields") List<String> fields) {
+    public Response showSecurityRule(@PathParam("securityRuleUUID") String securityRuleUUID,
+            // return fields
+            @QueryParam("fields") List<String> fields) {
         return show(securityRuleUUID, fields);
     }
 
@@ -164,10 +158,9 @@ public class NeutronSecurityRulesNorthbound
      */
 
     @POST
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSecurityRules(final NeutronSecurityRuleRequest input) {
         return create(input);
@@ -177,16 +170,15 @@ public class NeutronSecurityRulesNorthbound
      * Updates a Security Rule
      */
 
-    @Path ("{securityRuleUUID}")
+    @Path("{securityRuleUUID}")
     @PUT
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSecurityRule(
-            @PathParam ("securityRuleUUID") String securityRuleUUID, final NeutronSecurityRuleRequest input) {
+    public Response updateSecurityRule(@PathParam("securityRuleUUID") String securityRuleUUID,
+            final NeutronSecurityRuleRequest input) {
         return update(securityRuleUUID, input);
     }
 
@@ -194,14 +186,12 @@ public class NeutronSecurityRulesNorthbound
      * Deletes a Security Rule
      */
 
-    @Path ("{securityRuleUUID}")
+    @Path("{securityRuleUUID}")
     @DELETE
-    @StatusCodes ({
-            @ResponseCode (code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSecurityRule(
-            @PathParam ("securityRuleUUID") String securityRuleUUID) {
+    public Response deleteSecurityRule(@PathParam("securityRuleUUID") String securityRuleUUID) {
         return delete(securityRuleUUID);
     }
 }
index 1cdcfb1ecd39a225590dde416f3c1d08c3a57c0e..9aa52fca134c3c45003d7976854b5fe757692216 100644 (file)
@@ -21,13 +21,13 @@ public class NeutronSubnetRequest implements INeutronRequest<NeutronSubnet> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="subnet")
+    @XmlElement(name = "subnet")
     NeutronSubnet singletonSubnet;
 
-    @XmlElement(name="subnets")
+    @XmlElement(name = "subnets")
     List<NeutronSubnet> bulkRequest;
 
-    @XmlElement(name="subnets_links")
+    @XmlElement(name = "subnets_links")
     List<NeutronPageLink> links;
 
     NeutronSubnetRequest() {
index bb595557a2226390dcb492cf60189d0b39f0ed14..9491947b6d9d4bce58e0c8944ce509d4832d9fbf 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.neutron.spi.NeutronSubnet;
 
 @Path("/subnets")
 public class NeutronSubnetsNorthbound
-    extends AbstractNeutronNorthbound<NeutronSubnet, NeutronSubnetRequest, INeutronSubnetCRUD> {
+        extends AbstractNeutronNorthbound<NeutronSubnet, NeutronSubnetRequest, INeutronSubnetCRUD> {
     private static final String RESOURCE_NAME = "Subnet";
 
     @Override
@@ -73,8 +73,8 @@ public class NeutronSubnetsNorthbound
         if (needNetwork) {
             answer = answer.fetchINeutronNetworkCRUD(this);
             if (answer.getNetworkInterface() == null) {
-                throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
+                throw new ServiceUnavailableException(
+                        "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
             }
         }
         return answer;
@@ -98,8 +98,7 @@ public class NeutronSubnetsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -121,26 +120,26 @@ public class NeutronSubnetsNorthbound
             @QueryParam("limit") Integer limit,
             @QueryParam("marker") String marker,
             @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
+    // sorting not supported
+    ) {
         INeutronSubnetCRUD subnetInterface = getNeutronInterfaces(false).getSubnetInterface();
         List<NeutronSubnet> allNetworks = subnetInterface.getAll();
-        List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>();
+        List<NeutronSubnet> ans = new ArrayList<>();
         Iterator<NeutronSubnet> i = allNetworks.iterator();
         while (i.hasNext()) {
             NeutronSubnet oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryIPVersion == null || queryIPVersion.equals(oSS.getIpVersion())) &&
-                    (queryCIDR == null || queryCIDR.equals(oSS.getCidr())) &&
-                    (queryGatewayIP == null || queryGatewayIP.equals(oSS.getGatewayIP())) &&
-                    (queryEnableDHCP == null || queryEnableDHCP.equals(oSS.getEnableDHCP())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
-                    (queryIpV6AddressMode == null || queryIpV6AddressMode.equals(oSS.getIpV6AddressMode())) &&
-                    (queryIpV6RaMode == null || queryIpV6RaMode.equals(oSS.getIpV6RaMode()))){
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID()))
+                    && (queryName == null || queryName.equals(oSS.getName()))
+                    && (queryIPVersion == null || queryIPVersion.equals(oSS.getIpVersion()))
+                    && (queryCIDR == null || queryCIDR.equals(oSS.getCidr()))
+                    && (queryGatewayIP == null || queryGatewayIP.equals(oSS.getGatewayIP()))
+                    && (queryEnableDHCP == null || queryEnableDHCP.equals(oSS.getEnableDHCP()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
+                    && (queryIpV6AddressMode == null || queryIpV6AddressMode.equals(oSS.getIpV6AddressMode()))
+                    && (queryIpV6RaMode == null || queryIpV6RaMode.equals(oSS.getIpV6RaMode()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
@@ -149,13 +148,12 @@ public class NeutronSubnetsNorthbound
 
         if (limit != null && ans.size() > 1) {
             // Return a paginated request
-            NeutronSubnetRequest request = (NeutronSubnetRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronSubnet.class);
+            NeutronSubnetRequest request = (NeutronSubnetRequest) PaginatedRequestFactory.createRequest(limit, marker,
+                    pageReverse, uriInfo, ans, NeutronSubnet.class);
             return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
         }
 
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronSubnetRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSubnetRequest(ans)).build();
     }
 
     /**
@@ -165,14 +163,12 @@ public class NeutronSubnetsNorthbound
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showSubnet(
-            @PathParam("subnetUUID") String subnetUUID,
+    public Response showSubnet(@PathParam("subnetUUID") String subnetUUID,
             // return fields
             @QueryParam("fields") List<String> fields) {
         return show(subnetUUID, fields);
@@ -185,8 +181,7 @@ public class NeutronSubnetsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createSubnets(final NeutronSubnetRequest input) {
         getNeutronInterfaces(true); // Ensure that network service is loaded
@@ -216,13 +211,10 @@ public class NeutronSubnetsNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateSubnet(
-            @PathParam("subnetUUID") String subnetUUID, final NeutronSubnetRequest input
-            ) {
+    public Response updateSubnet(@PathParam("subnetUUID") String subnetUUID, final NeutronSubnetRequest input) {
         return update(subnetUUID, input);
     }
 
@@ -231,12 +223,10 @@ public class NeutronSubnetsNorthbound
 
     @Path("{subnetUUID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteSubnet(
-            @PathParam("subnetUUID") String subnetUUID) {
+    public Response deleteSubnet(@PathParam("subnetUUID") String subnetUUID) {
         return delete(subnetUUID);
     }
 }
index 762710f45de01807ffd8cf98dfb5045801266a72..cd659fbb5703134f1bde75c001a18e152202b94b 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.neutron.spi.NeutronVPNIKEPolicy;
 
 @Path("/vpn/ikepolicies")
 public class NeutronVPNIKEPoliciesNorthbound
-    extends AbstractNeutronNorthbound<NeutronVPNIKEPolicy, NeutronVPNIKEPolicyRequest, INeutronVPNIKEPolicyCRUD> {
+        extends AbstractNeutronNorthbound<NeutronVPNIKEPolicy, NeutronVPNIKEPolicyRequest, INeutronVPNIKEPolicyCRUD> {
     private static final String RESOURCE_NAME = "VPNIKEPolicy";
 
     @Override
@@ -87,8 +87,7 @@ public class NeutronVPNIKEPoliciesNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -104,32 +103,33 @@ public class NeutronVPNIKEPoliciesNorthbound
             @QueryParam("phase1_negotiation_mode") String queryPhase1NegotiationMode,
             @QueryParam("pfs") String queryPFS,
             @QueryParam("ike_version") String queryIKEVersion
-            // pagination and sorting are TODO
-            ) {
+    // pagination and sorting are TODO
+    ) {
         INeutronVPNIKEPolicyCRUD labelInterface = getNeutronCRUD();
         List<NeutronVPNIKEPolicy> allNeutronVPNIKEPolicy = labelInterface.getAll();
-        List<NeutronVPNIKEPolicy> ans = new ArrayList<NeutronVPNIKEPolicy>();
+        List<NeutronVPNIKEPolicy> ans = new ArrayList<>();
         Iterator<NeutronVPNIKEPolicy> i = allNeutronVPNIKEPolicy.iterator();
         while (i.hasNext()) {
             NeutronVPNIKEPolicy oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm())) &&
-                    (queryEncryptionAlgorithm == null || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm())) &&
-                    (queryPhase1NegotiationMode == null || queryPhase1NegotiationMode.equals(oSS.getPhase1NegotiationMode())) &&
-                    (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy())) &&
-                    (queryIKEVersion == null || queryIKEVersion.equals(oSS.getIkeVersion())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryName == null || queryName.equals(oSS.getName()))
+                    && (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm()))
+                    && (queryEncryptionAlgorithm == null
+                            || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm()))
+                    && (queryPhase1NegotiationMode == null
+                            || queryPhase1NegotiationMode.equals(oSS.getPhase1NegotiationMode()))
+                    && (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy()))
+                    && (queryIKEVersion == null || queryIKEVersion.equals(oSS.getIkeVersion()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronVPNIKEPolicyRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronVPNIKEPolicyRequest(ans)).build();
     }
 
     /**
@@ -138,18 +138,15 @@ public class NeutronVPNIKEPoliciesNorthbound
     @Path("{policyID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showVPNIKEPolicy(
-            @PathParam("policyID") String policyUUID,
+    public Response showVPNIKEPolicy(@PathParam("policyID") String policyUUID,
             // return fields
-            @QueryParam("fields") List<String> fields
-            ) {
+            @QueryParam("fields") List<String> fields) {
         return show(policyUUID, fields);
     }
 
@@ -159,8 +156,7 @@ public class NeutronVPNIKEPoliciesNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     @TypeHint(NeutronVPNIKEPolicy.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createVPNIKEPolicy(final NeutronVPNIKEPolicyRequest input) {
         return create(input);
@@ -172,13 +168,11 @@ public class NeutronVPNIKEPoliciesNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateVPNIKEPolicy(
-            @PathParam("policyID") String policyUUID, final NeutronVPNIKEPolicyRequest input
-            ) {
+    public Response updateVPNIKEPolicy(@PathParam("policyID") String policyUUID,
+            final NeutronVPNIKEPolicyRequest input) {
         return update(policyUUID, input);
     }
 
@@ -187,12 +181,10 @@ public class NeutronVPNIKEPoliciesNorthbound
 
     @Path("{policyID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteVPNIKEPolicy(
-            @PathParam("policyID") String policyUUID) {
+    public Response deleteVPNIKEPolicy(@PathParam("policyID") String policyUUID) {
         return delete(policyUUID);
     }
 }
index 0ce27b2d00b603fca2d77306acf67716cc354c53..ccc5851b47790249c77d2d7b5f4f38148875530a 100644 (file)
@@ -19,10 +19,10 @@ import org.opendaylight.neutron.spi.NeutronVPNIKEPolicy;
 @XmlAccessorType(XmlAccessType.NONE)
 public class NeutronVPNIKEPolicyRequest implements INeutronRequest<NeutronVPNIKEPolicy> {
 
-    @XmlElement(name="ikepolicy")
+    @XmlElement(name = "ikepolicy")
     NeutronVPNIKEPolicy singletonIKEPolicy;
 
-    @XmlElement(name="ikepolicies")
+    @XmlElement(name = "ikepolicies")
     List<NeutronVPNIKEPolicy> bulkIKEPolicies;
 
     NeutronVPNIKEPolicyRequest() {
index 4c4085078a7c6349e983437055b6cead472dfaee..0e27a6bb767310ed64817c531af23a3924174f76 100644 (file)
@@ -51,8 +51,8 @@ import org.opendaylight.neutron.spi.NeutronVPNIPSECPolicy;
  */
 
 @Path("/vpn/ipsecpolicies")
-public class NeutronVPNIPSECPoliciesNorthbound
-    extends AbstractNeutronNorthbound<NeutronVPNIPSECPolicy, NeutronVPNIPSECPolicyRequest, INeutronVPNIPSECPolicyCRUD> {
+public class NeutronVPNIPSECPoliciesNorthbound extends
+        AbstractNeutronNorthbound<NeutronVPNIPSECPolicy, NeutronVPNIPSECPolicyRequest, INeutronVPNIPSECPolicyCRUD> {
 
     private static final String RESOURCE_NAME = "VPNIPSECPolicy";
 
@@ -88,8 +88,7 @@ public class NeutronVPNIPSECPoliciesNorthbound
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@@ -105,32 +104,32 @@ public class NeutronVPNIPSECPoliciesNorthbound
             @QueryParam("auth_algorithm") String queryAuthAlgorithm,
             @QueryParam("encryption_algorithm") String queryEncryptionAlgorithm,
             @QueryParam("pfs") String queryPFS
-            // pagination and sorting are TODO
-            ) {
+    // pagination and sorting are TODO
+    ) {
         INeutronVPNIPSECPolicyCRUD policyInterface = getNeutronCRUD();
         List<NeutronVPNIPSECPolicy> allNeutronVPNIPSECPolicies = policyInterface.getAll();
-        List<NeutronVPNIPSECPolicy> ans = new ArrayList<NeutronVPNIPSECPolicy>();
+        List<NeutronVPNIPSECPolicy> ans = new ArrayList<>();
         Iterator<NeutronVPNIPSECPolicy> i = allNeutronVPNIPSECPolicies.iterator();
         while (i.hasNext()) {
             NeutronVPNIPSECPolicy oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm())) &&
-                    (queryEncryptionAlgorithm == null || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm())) &&
-                    (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy())) &&
-                    (queryTransformProtocol == null || queryTransformProtocol.equals(oSS.getTransformProtocol())) &&
-                    (queryEncapsulationMode == null || queryEncapsulationMode.equals(oSS.getEncapsulationMode())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+            if ((queryID == null || queryID.equals(oSS.getID()))
+                    && (queryName == null || queryName.equals(oSS.getName()))
+                    && (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm()))
+                    && (queryEncryptionAlgorithm == null
+                            || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm()))
+                    && (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy()))
+                    && (queryTransformProtocol == null || queryTransformProtocol.equals(oSS.getTransformProtocol()))
+                    && (queryEncapsulationMode == null || queryEncapsulationMode.equals(oSS.getEncapsulationMode()))
+                    && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
                 if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
+                    ans.add(extractFields(oSS, fields));
                 } else {
                     ans.add(oSS);
                 }
             }
         }
         //TODO: apply pagination to results
-        return Response.status(HttpURLConnection.HTTP_OK).entity(
-                new NeutronVPNIPSECPolicyRequest(ans)).build();
+        return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronVPNIPSECPolicyRequest(ans)).build();
     }
 
     /**
@@ -139,18 +138,15 @@ public class NeutronVPNIPSECPoliciesNorthbound
     @Path("{policyID}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
             @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response showVPNIPSECPolicy(
-            @PathParam("policyID") String policyUUID,
+    public Response showVPNIPSECPolicy(@PathParam("policyID") String policyUUID,
             // return fields
-            @QueryParam("fields") List<String> fields
-            ) {
+            @QueryParam("fields") List<String> fields) {
         return show(policyUUID, fields);
     }
 
@@ -160,8 +156,7 @@ public class NeutronVPNIPSECPoliciesNorthbound
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
     @TypeHint(NeutronVPNIPSECPolicy.class)
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response createVPNIPSECPolicy(final NeutronVPNIPSECPolicyRequest input) {
         return create(input);
@@ -173,13 +168,11 @@ public class NeutronVPNIPSECPoliciesNorthbound
     @PUT
     @Produces({ MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response updateVPNIPSECPolicy(
-            @PathParam("policyID") String policyUUID, final NeutronVPNIPSECPolicyRequest input
-            ) {
+    public Response updateVPNIPSECPolicy(@PathParam("policyID") String policyUUID,
+            final NeutronVPNIPSECPolicyRequest input) {
         return update(policyUUID, input);
     }
 
@@ -188,12 +181,10 @@ public class NeutronVPNIPSECPoliciesNorthbound
 
     @Path("{policyID}")
     @DELETE
-    @StatusCodes({
-            @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+    @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
-    public Response deleteVPNIPSECPolicy(
-            @PathParam("policyID") String policyUUID) {
+    public Response deleteVPNIPSECPolicy(@PathParam("policyID") String policyUUID) {
         return delete(policyUUID);
     }
 }
index 3c0b47d40e2092e6d83dc8da054209651afa7ad9..c6924a9743ec5f9d4b380ce0b2d1d7bb679d42ce 100644 (file)
@@ -19,10 +19,10 @@ import org.opendaylight.neutron.spi.NeutronVPNIPSECPolicy;
 @XmlAccessorType(XmlAccessType.NONE)
 public class NeutronVPNIPSECPolicyRequest implements INeutronRequest<NeutronVPNIPSECPolicy> {
 
-    @XmlElement(name="ipsecpolicy")
+    @XmlElement(name = "ipsecpolicy")
     NeutronVPNIPSECPolicy singletonVPNIPSECPolicy;
 
-    @XmlElement(name="ipsecpolicies")
+    @XmlElement(name = "ipsecpolicies")
     List<NeutronVPNIPSECPolicy> bulkVPNIPSECPolicies;
 
     NeutronVPNIPSECPolicyRequest() {
@@ -30,7 +30,7 @@ public class NeutronVPNIPSECPolicyRequest implements INeutronRequest<NeutronVPNI
 
     NeutronVPNIPSECPolicyRequest(NeutronVPNIPSECPolicy policy) {
         singletonVPNIPSECPolicy = policy;
-       bulkVPNIPSECPolicies = null;
+        bulkVPNIPSECPolicies = null;
     }
 
     NeutronVPNIPSECPolicyRequest(List<NeutronVPNIPSECPolicy> policies) {
index 8410e61de5fc4dd7458862de07b0221c4abb9c00..b543011b2658977523359b0f213ba632c31f991d 100644 (file)
@@ -19,10 +19,10 @@ import org.opendaylight.neutron.spi.NeutronVPNIPSECSiteConnection;
 @XmlAccessorType(XmlAccessType.NONE)
 public class NeutronVPNIPSECSiteConnectionRequest implements INeutronRequest<NeutronVPNIPSECSiteConnection> {
 
-    @XmlElement(name="ipsec_site_connection")
+    @XmlElement(name = "ipsec_site_connection")
     NeutronVPNIPSECSiteConnection singletonVPNIPSECSiteConnection;
 
-    @XmlElement(name="ipsec_site_connections")
+    @XmlElement(name = "ipsec_site_connections")
     List<NeutronVPNIPSECSiteConnection> bulkVPNIPSECSiteConnections;
 
     NeutronVPNIPSECSiteConnectionRequest() {
@@ -30,7 +30,7 @@ public class NeutronVPNIPSECSiteConnectionRequest implements INeutronRequest<Neu
 
     NeutronVPNIPSECSiteConnectionRequest(NeutronVPNIPSECSiteConnection connection) {
         singletonVPNIPSECSiteConnection = connection;
-       bulkVPNIPSECSiteConnections = null;
+        bulkVPNIPSECSiteConnections = null;
     }
 
     NeutronVPNIPSECSiteConnectionRequest(List<NeutronVPNIPSECSiteConnection> connections) {
index 08b90d58e39d121c07add33225085f02e0b15424..638f44d135824ce88f196b44cf1d5079d5d56891 100644 (file)
@@ -51,8 +51,8 @@ import org.opendaylight.neutron.spi.NeutronVPNIPSECSiteConnection;
  */
 
 @Path("/vpn/ipsecsiteconnections")
-public class NeutronVPNIPSECSiteConnectionsNorthbound
-    extends AbstractNeutronNorthbound<NeutronVPNIPSECSiteConnection, NeutronVPNIPSECSiteConnectionRequest, INeutronVPNIPSECSiteConnectionsCRUD> {
+public class NeutronVPNIPSECSiteConnectionsNorthbound extends AbstractNeutronNorthbound<NeutronVPNIPSECSiteConnection,
+        NeutronVPNIPSECSiteConnectionRequest, INeutronVPNIPSECSiteConnectionsCRUD> {
 
     private static final String RESOURCE_NAME = "VPNIPSECSiteConnections";
 
@@ -97,20 +97,26 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound
             // return fields
             @QueryParam("fields") List<String> fields,
             // filter fields
-            @QueryParam("id") String queryID, @QueryParam("tenant_id") String queryTenantID,
+            @QueryParam("id") String queryID,
+            @QueryParam("tenant_id") String queryTenantID,
             @QueryParam("name") String queryName,
-            @QueryParam("peer_address") String queryPeerAddress, @QueryParam("peer_id") String queryPeerID,
-            @QueryParam("route_mode") String queryRouteMode, @QueryParam("mtu") Integer queryMtu,
-            @QueryParam("auth_mode") String queryAuthMode, @QueryParam("psk") String queryPsk,
-            @QueryParam("initiator") String queryInitiator, @QueryParam("admin_state_up") Boolean queryAdminStateUp,
-            @QueryParam("status") String queryStatus, @QueryParam("ikepolicy_id") String queryIkePolicyID,
+            @QueryParam("peer_address") String queryPeerAddress,
+            @QueryParam("peer_id") String queryPeerID,
+            @QueryParam("route_mode") String queryRouteMode,
+            @QueryParam("mtu") Integer queryMtu,
+            @QueryParam("auth_mode") String queryAuthMode,
+            @QueryParam("psk") String queryPsk,
+            @QueryParam("initiator") String queryInitiator,
+            @QueryParam("admin_state_up") Boolean queryAdminStateUp,
+            @QueryParam("status") String queryStatus,
+            @QueryParam("ikepolicy_id") String queryIkePolicyID,
             @QueryParam("ipsecpolicy_id") String queryIpSecPolicyID,
             @QueryParam("vpnservice_id") String queryVpnServiceID
     // pagination and sorting are TODO
     ) {
         INeutronVPNIPSECSiteConnectionsCRUD labelInterface = getNeutronCRUD();
         List<NeutronVPNIPSECSiteConnection> allNeutronVPNIPSECSiteConnection = labelInterface.getAll();
-        List<NeutronVPNIPSECSiteConnection> ans = new ArrayList<NeutronVPNIPSECSiteConnection>();
+        List<NeutronVPNIPSECSiteConnection> ans = new ArrayList<>();
         Iterator<NeutronVPNIPSECSiteConnection> i = allNeutronVPNIPSECSiteConnection.iterator();
         while (i.hasNext()) {
             NeutronVPNIPSECSiteConnection oSS = i.next();
@@ -155,7 +161,7 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response showVPNIPSECSiteConnection(@PathParam("connectionID") String connectionID,
-    // return fields
+            // return fields
             @QueryParam("fields") List<String> fields) {
         return show(connectionID, fields);
     }
index 5aac8558122527a7d7edaa2a5543058e4887acd0..8561534ee69d9fb4ec8b7863e25ba5ea86566796 100644 (file)
@@ -19,10 +19,10 @@ import org.opendaylight.neutron.spi.NeutronVPNService;
 @XmlAccessorType(XmlAccessType.NONE)
 public class NeutronVPNServiceRequest implements INeutronRequest<NeutronVPNService> {
 
-    @XmlElement(name="vpnservice")
+    @XmlElement(name = "vpnservice")
     NeutronVPNService singletonVPNService;
 
-    @XmlElement(name="vpnservices")
+    @XmlElement(name = "vpnservices")
     List<NeutronVPNService> bulkVPNServices;
 
     NeutronVPNServiceRequest() {
index 0c1b04191316a74bcfb48debef9b2fa3233dc548..d27a31a58b3e93f23baab73753c299e55a281ade 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.neutron.spi.NeutronVPNService;
 
 @Path("/vpn/vpnservices")
 public class NeutronVPNServicesNorthbound
-    extends AbstractNeutronNorthbound<NeutronVPNService, NeutronVPNServiceRequest, INeutronVPNServiceCRUD> {
+        extends AbstractNeutronNorthbound<NeutronVPNService, NeutronVPNServiceRequest, INeutronVPNServiceCRUD> {
 
     private static final String RESOURCE_NAME = "VPNService";
 
@@ -112,7 +112,7 @@ public class NeutronVPNServicesNorthbound
     ) {
         INeutronVPNServiceCRUD VPNServiceInterface = getNeutronCRUD();
         List<NeutronVPNService> allVPNService = VPNServiceInterface.getAll();
-        List<NeutronVPNService> ans = new ArrayList<NeutronVPNService>();
+        List<NeutronVPNService> ans = new ArrayList<>();
         Iterator<NeutronVPNService> i = allVPNService.iterator();
         while (i.hasNext()) {
             NeutronVPNService oSS = i.next();
@@ -147,7 +147,7 @@ public class NeutronVPNServicesNorthbound
             @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
             @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
     public Response showVPNService(@PathParam("serviceID") String serviceID,
-    // return fields
+            // return fields
             @QueryParam("fields") List<String> fields) {
         return show(serviceID, fields);
     }
index ae70668d37f7bc7c8659c51b0b4117c74171e23c..bd9a7874a5baacaaa18fb0dfc2432418c9126599 100644 (file)
@@ -68,25 +68,25 @@ public final class PaginatedRequestFactory {
      */
     @SuppressWarnings("unchecked")
     public static <T extends INeutronObject> INeutronRequest<T> createRequest(Integer limit, String marker,
-                                                                           Boolean pageReverse,
-                                                                           UriInfo uriInfo,
-                                                                           List<T> collection,
-                                                                           Class<T> clazz) {
+            Boolean pageReverse, UriInfo uriInfo, List<T> collection, Class<T> clazz) {
         PaginationResults<T> results = paginate(limit, marker, pageReverse, uriInfo, collection);
 
-        if (clazz.equals(NeutronNetwork.class)){
-            return (INeutronRequest<T>) new NeutronNetworkRequest((List<NeutronNetwork>) results.collection, results.links);
+        if (clazz.equals(NeutronNetwork.class)) {
+            return (INeutronRequest<T>) new NeutronNetworkRequest((List<NeutronNetwork>) results.collection,
+                    results.links);
         }
-        if (clazz.equals(NeutronSubnet.class)){
-            return (INeutronRequest<T>) new NeutronSubnetRequest((List<NeutronSubnet>) results.collection, results.links);
+        if (clazz.equals(NeutronSubnet.class)) {
+            return (INeutronRequest<T>) new NeutronSubnetRequest((List<NeutronSubnet>) results.collection,
+                    results.links);
         }
-        if (clazz.equals(NeutronPort.class)){
+        if (clazz.equals(NeutronPort.class)) {
             return (INeutronRequest<T>) new NeutronPortRequest((List<NeutronPort>) results.collection, results.links);
         }
         return null;
     }
 
-    private static <T extends INeutronObject> PaginationResults<T> paginate(Integer limit, String marker, Boolean pageReverse, UriInfo uriInfo, List<T> collection) {
+    private static <T extends INeutronObject> PaginationResults<T> paginate(Integer limit, String marker,
+            Boolean pageReverse, UriInfo uriInfo, List<T> collection) {
         List<NeutronPageLink> links = new ArrayList<>();
         final int startPos;
         String startMarker;
@@ -105,16 +105,14 @@ public final class PaginatedRequestFactory {
 
             if (!pageReverse) {
                 startPos = offset + 1;
-            }
-            else {
+            } else {
                 startPos = offset - limit;
             }
-        }
-        else {
+        } else {
             startPos = 0;
         }
 
-        if (startPos == 0){
+        if (startPos == 0) {
             firstPage = true;
         }
 
@@ -123,22 +121,20 @@ public final class PaginatedRequestFactory {
             startMarker = lCollection.get(0).getID();
             endMarker = lCollection.get(lCollection.size() - 1).getID();
             lastPage = true;
-        }
-        else if (startPos < 0) {
+        } else if (startPos < 0) {
             if (startPos + limit > 0) {
                 lCollection = lCollection.subList(0, startPos + limit);
                 startMarker = lCollection.get(0).getID();
                 endMarker = lCollection.get(lCollection.size() - 1).getID();
                 firstPage = true;
+            } else {
+                throw new BadRequestException(
+                        "Requested page is out of bounds. Please check the supplied limit and marker");
             }
-            else {
-                throw new BadRequestException("Requested page is out of bounds. Please check the supplied limit and marker");
-            }
-        }
-        else {
+        } else {
             lCollection = lCollection.subList(startPos, startPos + limit);
             startMarker = lCollection.get(0).getID();
-            endMarker = lCollection.get(limit-1).getID();
+            endMarker = lCollection.get(limit - 1).getID();
         }
 
         if (!lastPage) {
@@ -151,7 +147,8 @@ public final class PaginatedRequestFactory {
         if (!firstPage) {
             NeutronPageLink previous = new NeutronPageLink();
             previous.setRef("previous");
-            previous.setHref(uriInfo.getAbsolutePath().toString() + "?limit=" + limit.toString() + "&marker=" + startMarker + "&page_reverse=True");
+            previous.setHref(uriInfo.getAbsolutePath().toString() + "?limit=" + limit.toString() + "&marker="
+                    + startMarker + "&page_reverse=True");
             links.add(previous);
         }
 
index b823c6a86d5fcf34d3cd7bc8f1cb5dec0db9ef78..a951be21ec37ca9d05a8ee0722a9bdf69e592520 100644 (file)
@@ -31,7 +31,6 @@ public class ResourceConflictException extends WebApplicationException {
     private static final long serialVersionUID = 1L;
 
     public ResourceConflictException(String string) {
-        super(Response.status(Response.Status.CONFLICT).entity(string).type(
-                MediaType.TEXT_PLAIN).build());
+        super(Response.status(Response.Status.CONFLICT).entity(string).type(MediaType.TEXT_PLAIN).build());
     }
 }
index 8c17f057b5004b9e7e1b8f516fe5aaf80d96e2ad..8952a45fcaa87ab7ce8831b439f52fc22254fefc 100644 (file)
@@ -31,7 +31,6 @@ public class ResourceNotFoundException extends WebApplicationException {
     private static final long serialVersionUID = 1L;
 
     public ResourceNotFoundException(String string) {
-        super(Response.status(Response.Status.NOT_FOUND).entity(string).type(
-                MediaType.TEXT_PLAIN).build());
+        super(Response.status(Response.Status.NOT_FOUND).entity(string).type(MediaType.TEXT_PLAIN).build());
     }
 }
index 1db2cdce93540677432febc3d765cb3317e0564a..600efcb3a6666d4c5857dd46ca5f61b4f02985a0 100644 (file)
@@ -9,16 +9,17 @@
 package org.opendaylight.neutron.northbound.api;
 
 public enum RestMessages {
-    SUCCESS("Success"), NOCONTAINER("Container does not exist"), NOSUBNET("Subnet does not exist"), NOSTATICROUTE(
-            "Static Route does not exist"), NOHOST("Host does not exist"), NOFLOW("Flow does not exist"), NONODE(
-            "Node does not exist"), NOPOLICY("Policy does not exist"), NORESOURCE("Resource does not exist"), RESOURCECONFLICT(
-            "Operation failed due to Resource Conflict"), NODEFAULT("Container default is not a custom container"), DEFAULTDISABLED(
-            "Container(s) are configured. Container default is not operational"), NOTALLOWEDONDEFAULT(
-            "Container default is a static resource, no modification allowed on it"), UNKNOWNACTION("Unknown action"), INVALIDJSON(
-            "JSON message is invalid"), INVALIDADDRESS("Invalid InetAddress"), AVAILABLESOON(
-            "Resource is not implemented yet"), INTERNALERROR("Internal Error"), SERVICEUNAVAILABLE(
-            "Service is not available. Could be down for maintanence"), INVALIDDATA(
-            "Data is invalid or conflicts with URI");
+    SUCCESS("Success"), NOCONTAINER("Container does not exist"), NOSUBNET("Subnet does not exist"),
+    NOSTATICROUTE("Static Route does not exist"), NOHOST("Host does not exist"), NOFLOW("Flow does not exist"),
+    NONODE("Node does not exist"), NOPOLICY("Policy does not exist"), NORESOURCE("Resource does not exist"),
+    RESOURCECONFLICT("Operation failed due to Resource Conflict"),
+    NODEFAULT("Container default is not a custom container"),
+    DEFAULTDISABLED("Container(s) are configured. Container default is not operational"),
+    NOTALLOWEDONDEFAULT("Container default is a static resource, no modification allowed on it"),
+    UNKNOWNACTION("Unknown action"), INVALIDJSON("JSON message is invalid"), INVALIDADDRESS("Invalid InetAddress"),
+    AVAILABLESOON("Resource is not implemented yet"), INTERNALERROR("Internal Error"),
+    SERVICEUNAVAILABLE("Service is not available. Could be down for maintanence"),
+    INVALIDDATA("Data is invalid or conflicts with URI");
 
     private String message;
 
index f8c80fa3115d02f901823229a2d6fa865697cf7e..6ed2647bd9a190cb6276fac044ef681ff0b40853 100644 (file)
@@ -33,7 +33,6 @@ public class ServiceUnavailableException extends WebApplicationException {
      *
      */
     public ServiceUnavailableException(String string) {
-        super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(
-                string).type(MediaType.TEXT_PLAIN).build());
+        super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(string).type(MediaType.TEXT_PLAIN).build());
     }
 }
index c33ba4c356175e4ab5ca338eba127b9076558331..a6ff0024e9421045b1fc106a32883531a94d8e38 100644 (file)
@@ -30,7 +30,7 @@ public class UnimplementedException extends WebApplicationException {
      *
      */
     public UnimplementedException(String string) {
-        super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(
-                string).type(MediaType.TEXT_PLAIN).build());
+        super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(string).type(MediaType.TEXT_PLAIN)
+                .build());
     }
 }