cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [4/6] git commit: srx: Annotate api classes, remove IdentityMapper
Date Sat, 05 Jan 2013 01:14:22 GMT
srx: Annotate api classes, remove IdentityMapper

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/65a1284e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/65a1284e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/65a1284e

Branch: refs/heads/api_refactoring
Commit: 65a1284e83bd0179a27c3b99426d6026b21f2aa9
Parents: 4dd5f14
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Fri Jan 4 17:00:10 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Fri Jan 4 17:00:10 2013 -0800

----------------------------------------------------------------------
 .../api/commands/ConfigureSrxFirewallCmd.java      |    5 ++---
 .../cloud/api/commands/DeleteSrxFirewallCmd.java   |    6 +++---
 .../api/commands/ListSrxFirewallNetworksCmd.java   |    5 +++--
 .../cloud/api/commands/ListSrxFirewallsCmd.java    |    4 ++--
 .../cloud/api/response/SrxFirewallResponse.java    |    3 +++
 .../cloud/network/ExternalFirewallDeviceVO.java    |    3 ++-
 6 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65a1284e/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java
b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java
index 002fad7..482fcc8 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java
@@ -21,7 +21,6 @@ import org.apache.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.PlugService;
@@ -49,8 +48,8 @@ public class ConfigureSrxFirewallCmd extends BaseAsyncCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="external_load_balancer_devices")
-    @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.LONG, required=true,
description="SRX firewall device ID")
+    @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.UUID, entityType =
SrxFirewallResponse.class,
+            required=true, description="SRX firewall device ID")
     private Long fwDeviceId;
 
     @Parameter(name=ApiConstants.FIREWALL_DEVICE_CAPACITY, type=CommandType.LONG, required=false,
description="capacity of the firewall device, Capacity will be interpreted as number of networks
device can handle")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65a1284e/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java
b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java
index 4595c22..1dc792a 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java
@@ -21,12 +21,12 @@ import org.apache.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.PlugService;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.SuccessResponse;
+import com.cloud.api.response.SrxFirewallResponse;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
@@ -47,8 +47,8 @@ public class DeleteSrxFirewallCmd extends BaseAsyncCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="external_firewall_devices")
-    @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.LONG, required=true,
description="srx firewall device ID")
+    @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.UUID, entityType =
SrxFirewallResponse.class,
+            required=true, description="srx firewall device ID")
     private Long fwDeviceId;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65a1284e/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java
b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java
index 80881d4..9c2b396 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java
@@ -25,6 +25,7 @@ import org.apache.log4j.Logger;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.NetworkResponse;
+import com.cloud.api.response.SrxFirewallResponse;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.InvalidParameterValueException;
@@ -45,8 +46,8 @@ public class ListSrxFirewallNetworksCmd extends BaseListCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="external_firewall_devices")
-    @Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required
= true, description="netscaler load balancer device ID")
+    @Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType
= SrxFirewallResponse.class,
+            required = true, description="netscaler load balancer device ID")
     private Long fwDeviceId;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65a1284e/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java
b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java
index 36ecaea..6508cc8 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java
@@ -50,8 +50,8 @@ public class ListSrxFirewallsCmd extends BaseListCmd {
             description="the Physical Network ID")
     private Long physicalNetworkId;
 
-    @IdentityMapper(entityTableName="external_firewall_devices")
-    @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.LONG,  description="SRX
firewall device ID")
+    @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.UUID, entityType =
SrxFirewallResponse.class,
+            description="SRX firewall device ID")
     private Long fwDeviceId;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65a1284e/plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java
b/plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java
index 8ac488f..56aab70 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java
@@ -17,10 +17,13 @@
 package com.cloud.api.response;
 
 import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.EntityReference;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
 import org.apache.cloudstack.api.BaseResponse;
+import com.cloud.network.ExternalFirewallDeviceVO;
 
+@EntityReference(value=ExternalFirewallDeviceVO.class)
 @SuppressWarnings("unused")
 public class SrxFirewallResponse extends BaseResponse {
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65a1284e/server/src/com/cloud/network/ExternalFirewallDeviceVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalFirewallDeviceVO.java b/server/src/com/cloud/network/ExternalFirewallDeviceVO.java
index a4b6741..83be8c4 100644
--- a/server/src/com/cloud/network/ExternalFirewallDeviceVO.java
+++ b/server/src/com/cloud/network/ExternalFirewallDeviceVO.java
@@ -16,6 +16,7 @@
 // under the License.
 package com.cloud.network;
 
+import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
 import java.util.UUID;
@@ -35,7 +36,7 @@ import javax.persistence.Table;
 
 @Entity
 @Table(name="external_firewall_devices")
-public class ExternalFirewallDeviceVO implements InternalIdentity {
+public class ExternalFirewallDeviceVO implements InternalIdentity, Identity {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Column(name = "id")


Mime
View raw message