cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtutkow...@apache.org
Subject [24/50] git commit: updated refs/heads/sf-plugins to 157efc3
Date Sat, 19 Sep 2015 01:31:30 GMT
Correcting a rebase issue concerning the ApiHelper class and its use


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

Branch: refs/heads/sf-plugins
Commit: 8cd282788d92819976bbb4d20c7a956ca711f81f
Parents: ab60186
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Tue Jul 14 18:36:56 2015 -0600
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Fri Sep 18 19:28:20 2015 -0600

----------------------------------------------------------------------
 .../solidfire/spring-solidfire-context.xml         |  1 +
 .../CreateReferenceToSolidFireClusterCmd.java      |  3 ++-
 .../CreateSolidFireVirtualNetworkCmd.java          |  3 ++-
 .../DeleteReferenceToSolidFireClusterCmd.java      |  3 ++-
 .../DeleteSolidFireVirtualNetworkCmd.java          |  3 ++-
 .../admin/solidfire/ListSolidFireClustersCmd.java  |  3 ++-
 .../UpdateReferenceToSolidFireClusterCmd.java      |  3 ++-
 .../UpdateSolidFireVirtualNetworkCmd.java          |  3 ++-
 .../user/solidfire/CreateSolidFireVolumeCmd.java   |  5 +++--
 .../user/solidfire/DeleteSolidFireVolumeCmd.java   |  5 +++--
 .../solidfire/ListSolidFireVirtualNetworksCmd.java |  4 ++--
 .../user/solidfire/ListSolidFireVolumesCmd.java    |  5 +++--
 .../user/solidfire/UpdateSolidFireVolumeCmd.java   |  5 +++--
 .../apache/cloudstack/api/helper/ApiHelper.java    |  6 ------
 .../solidfire/ApiSolidFireServiceImpl2.java        | 17 +++++++++--------
 15 files changed, 38 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
b/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
index 334393d..d056571 100644
--- a/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
+++ b/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
@@ -27,6 +27,7 @@
                       http://www.springframework.org/schema/context/spring-context-3.0.xsd"
                       >
 
+      <bean id="apiHelper" class="org.apache.cloudstack.api.helper.ApiHelper" />
       <bean id="apiSolidFireServiceImpl2" class="org.apache.cloudstack.solidfire.ApiSolidFireServiceImpl2"/>
       <bean id="sfClusterDao" class="org.apache.cloudstack.solidfire.dataaccess.dao.SfClusterDaoImpl"
/>
       <bean id="sfVolumeDao" class="org.apache.cloudstack.solidfire.dataaccess.dao.SfVolumeDaoImpl"
/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
index ecc2b9d..65b82dd 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
@@ -64,6 +64,7 @@ public class CreateReferenceToSolidFireClusterCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class,
description = ApiHelper.ZONE_ID_DESC, required = true)
     private long _zoneId;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -88,7 +89,7 @@ public class CreateReferenceToSolidFireClusterCmd extends BaseCmd {
             SfCluster sfCluster = _apiSolidFireService2.createReferenceToSolidFireCluster(_mvip,
_username, _password, _totalCapacity,
                     _totalMinIops, _totalMaxIops, _totalBurstIops, _zoneId);
 
-            ApiSolidFireClusterResponse response = ApiHelper.instance().getApiSolidFireClusterResponse(sfCluster);
+            ApiSolidFireClusterResponse response = _apiHelper.getApiSolidFireClusterResponse(sfCluster);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apicreatereferencetosolidfirecluster");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
index c91d4d3..3d428ea 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
@@ -63,6 +63,7 @@ public class CreateSolidFireVirtualNetworkCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class,
description = ApiHelper.ACCOUNT_ID_DESC, required = true)
     private long _accountId;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -86,7 +87,7 @@ public class CreateSolidFireVirtualNetworkCmd extends BaseCmd {
 
             SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.createSolidFireVirtualNetwork(_clusterName,
_name, _tag, _startIp, _size, _netmask, _svip, _accountId);
 
-            ApiSolidFireVirtualNetworkResponse response = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork,
ResponseView.Full);
+            ApiSolidFireVirtualNetworkResponse response = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork,
ResponseView.Full);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apicreatesolidfirevirtualnetwork");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
index 058df8d..77673fd 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
@@ -41,6 +41,7 @@ public class DeleteReferenceToSolidFireClusterCmd extends BaseCmd {
     @Parameter(name = ApiHelper.NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC,
required = true)
     private String _name;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -64,7 +65,7 @@ public class DeleteReferenceToSolidFireClusterCmd extends BaseCmd {
 
             SfCluster sfCluster = _apiSolidFireService2.deleteReferenceToSolidFireCluster(_name);
 
-            ApiSolidFireClusterResponse response = ApiHelper.instance().getApiSolidFireClusterResponse(sfCluster);
+            ApiSolidFireClusterResponse response = _apiHelper.getApiSolidFireClusterResponse(sfCluster);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apideletereferencetosolidfirecluster");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
index 8ea4a67..b21e6c6 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
@@ -43,6 +43,7 @@ public class DeleteSolidFireVirtualNetworkCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVirtualNetworkResponse.class,
description = ApiHelper.VIRTUAL_NETWORK_ID_DESC, required = true)
     private long _id;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -72,7 +73,7 @@ public class DeleteSolidFireVirtualNetworkCmd extends BaseCmd {
 
             SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.deleteSolidFireVirtualNetwork(_id);
 
-            ApiSolidFireVirtualNetworkResponse response = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork,
ResponseView.Full);
+            ApiSolidFireVirtualNetworkResponse response = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork,
ResponseView.Full);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apideletesolidfirevirtualnetwork");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
index 3cdf73f..dea0a8e 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
@@ -43,6 +43,7 @@ public class ListSolidFireClustersCmd extends BaseListCmd {
     @Parameter(name = ApiHelper.NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC)
     private String _name;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -74,7 +75,7 @@ public class ListSolidFireClustersCmd extends BaseListCmd {
                 sfClusters = _apiSolidFireService2.listSolidFireClusters();
             }
 
-            List<ApiSolidFireClusterResponse> responses = ApiHelper.instance().getApiSolidFireClusterResponse(sfClusters);
+            List<ApiSolidFireClusterResponse> responses = _apiHelper.getApiSolidFireClusterResponse(sfClusters);
 
             ListResponse<ApiSolidFireClusterResponse> listReponse = new ListResponse<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
index 2423f3b..0411205 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
@@ -53,6 +53,7 @@ public class UpdateReferenceToSolidFireClusterCmd extends BaseCmd {
     @Parameter(name = ApiHelper.TOTAL_BURST_IOPS, type = CommandType.LONG, description =
ApiHelper.TOTAL_BURST_IOPS_DESC, required = true)
     private long _totalBurstIops;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -77,7 +78,7 @@ public class UpdateReferenceToSolidFireClusterCmd extends BaseCmd {
             SfCluster sfCluster = _apiSolidFireService2.updateReferenceToSolidFireCluster(_name,
_totalCapacity,
                     _totalMinIops, _totalMaxIops, _totalBurstIops);
 
-            ApiSolidFireClusterResponse response = ApiHelper.instance().getApiSolidFireClusterResponse(sfCluster);
+            ApiSolidFireClusterResponse response = _apiHelper.getApiSolidFireClusterResponse(sfCluster);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apiupdatereferencetosolidfirecluster");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
index e52e056..210b640 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
@@ -62,6 +62,7 @@ public class UpdateSolidFireVirtualNetworkCmd extends BaseCmd {
     @Parameter(name = ApiHelper.SVIP, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_SVIP_DESC,
required = true)
     private String _svip;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -91,7 +92,7 @@ public class UpdateSolidFireVirtualNetworkCmd extends BaseCmd {
 
             SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.updateSolidFireVirtualNetwork(_id,
_name, _tag, _startIp, _size, _netmask, _svip);
 
-            ApiSolidFireVirtualNetworkResponse response = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork,
ResponseView.Full);
+            ApiSolidFireVirtualNetworkResponse response = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork,
ResponseView.Full);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apiupdatesolidfirevirtualnetwork");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
index e189e12..1f68346 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
@@ -62,6 +62,7 @@ public class CreateSolidFireVolumeCmd extends BaseCmd {
             description = ApiHelper.VIRTUAL_NETWORK_ID_DESC, required = true)
     private long _sfVirtualNetworkId;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -85,9 +86,9 @@ public class CreateSolidFireVolumeCmd extends BaseCmd {
 
             SfVolume sfVolume = _apiSolidFireService2.createSolidFireVolume(_name, _size,
_minIops, _maxIops, _burstIops, _accountId, _sfVirtualNetworkId);
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full
: ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            ApiSolidFireVolumeResponse response = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolume,
responseView);
+            ApiSolidFireVolumeResponse response = _apiHelper.getApiSolidFireVolumeResponse(sfVolume,
responseView);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apicreatesolidfirevolume");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
index a3f6bb9..772b75c 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
@@ -44,6 +44,7 @@ public class DeleteSolidFireVolumeCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVolumeResponse.class,
description = ApiHelper.VOLUME_ID_DESC, required = true)
     private long _id;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -77,9 +78,9 @@ public class DeleteSolidFireVolumeCmd extends BaseCmd {
 
             SfVolume sfVolume = _apiSolidFireService2.deleteSolidFireVolume(_id);
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full
: ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            ApiSolidFireVolumeResponse response = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolume,
responseView);
+            ApiSolidFireVolumeResponse response = _apiHelper.getApiSolidFireVolumeResponse(sfVolume,
responseView);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apideletesolidfirevolume");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
index 2ec91a1..358dfe6 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
@@ -86,9 +86,9 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
                 sfVirtualNetworks = _apiSolidFireService2.listSolidFireVirtualNetworks(_zoneId,
_accountId);
             }
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full
: ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            List<ApiSolidFireVirtualNetworkResponse> responses = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetworks,
responseView);
+            List<ApiSolidFireVirtualNetworkResponse> responses = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetworks,
responseView);
 
             ListResponse<ApiSolidFireVirtualNetworkResponse> listReponse = new ListResponse<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
index 2e8c56e..3890f11 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
@@ -45,6 +45,7 @@ public class ListSolidFireVolumesCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVolumeResponse.class,
description = ApiHelper.VOLUME_ID_DESC)
     private Long _id;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -76,9 +77,9 @@ public class ListSolidFireVolumesCmd extends BaseListCmd {
                 sfVolumes = _apiSolidFireService2.listSolidFireVolumes();
             }
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full
: ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            List<ApiSolidFireVolumeResponse> responses = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolumes,
responseView);
+            List<ApiSolidFireVolumeResponse> responses = _apiHelper.getApiSolidFireVolumeResponse(sfVolumes,
responseView);
 
             ListResponse<ApiSolidFireVolumeResponse> listReponse = new ListResponse<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
index 0e494d9..3b1e6b7 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
@@ -56,6 +56,7 @@ public class UpdateSolidFireVolumeCmd extends BaseCmd {
     @Parameter(name = ApiHelper.BURST_IOPS, type = CommandType.LONG, description = ApiHelper.BURST_IOPS_DESC,
required = true)
     private long _burstIops;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -88,9 +89,9 @@ public class UpdateSolidFireVolumeCmd extends BaseCmd {
 
             SfVolume sfVolume = _apiSolidFireService2.updateSolidFireVolume(_id, _size, _minIops,
_maxIops, _burstIops);
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full
: ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            ApiSolidFireVolumeResponse response = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolume,
responseView);
+            ApiSolidFireVolumeResponse response = _apiHelper.getApiSolidFireVolumeResponse(sfVolume,
responseView);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apiupdatesolidfirevolume");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
index 89c48eb..b042499 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
@@ -27,8 +27,6 @@ import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class ApiHelper {
-    private static ApiHelper s_apiHelperInstance = new ApiHelper();
-
     public static final String MVIP = "mvip";
     public static final String SVIP = "svip";
     public static final String CLUSTER_NAME = "clustername";
@@ -80,10 +78,6 @@ public class ApiHelper {
     private ApiHelper() {
     }
 
-    public static ApiHelper instance() {
-        return s_apiHelperInstance;
-    }
-
     public ApiSolidFireClusterResponse getApiSolidFireClusterResponse(SfCluster sfCluster)
{
         ApiSolidFireClusterResponse sfResponse = new ApiSolidFireClusterResponse();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cd28278/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index 7c585a8..58ebc4b 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -109,6 +109,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     @Inject private AccountDao _accountDao;
     @Inject private AccountDetailsDao _accountDetailsDao;
     @Inject private AccountManager _accountMgr;
+    @Inject private ApiHelper _apiHelper;
     @Inject private DataCenterDao _zoneDao;
     @Inject private SfClusterDao _sfClusterDao;
     @Inject private SfVirtualNetworkDao _sfVirtualNetworkDao;
@@ -259,7 +260,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
 
         final List<SfVirtualNetworkVO> sfVirtualNetworkVOs;
 
-        if (ApiHelper.instance().isRootAdmin()) {
+        if (_apiHelper.isRootAdmin()) {
             if (zoneId != null) {
                 if (accountId != null) {
                     sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(accountId),
zoneId);
@@ -283,10 +284,10 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements
APIChecker,
             }
 
             if (zoneId != null) {
-                sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId()),
zoneId);
+                sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(_apiHelper.getCallingAccount().getId()),
zoneId);
             }
             else {
-                sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId());
+                sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(_apiHelper.getCallingAccount().getId());
             }
         }
 
@@ -396,13 +397,13 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements
APIChecker,
 
         final List<SfVolumeVO> sfVolumeVOs;
 
-        if (ApiHelper.instance().isRootAdmin()) {
+        if (_apiHelper.isRootAdmin()) {
             sfVolumeVOs = _sfVolumeDao.listAll();
         }
         else {
             sfVolumeVOs = new ArrayList<>();
 
-            List<SfVirtualNetworkVO> sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId());
+            List<SfVirtualNetworkVO> sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(_apiHelper.getCallingAccount().getId());
 
             if (sfVirtualNetworkVOs != null) {
                 for (SfVirtualNetwork sfVirtualNetwork : sfVirtualNetworkVOs) {
@@ -569,15 +570,15 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements
APIChecker,
     }
 
     private void verifyRootAdmin() {
-        if (!ApiHelper.instance().isRootAdmin()) {
+        if (!_apiHelper.isRootAdmin()) {
             throw new PermissionDeniedException("Only a root admin can perform this operation.");
         }
     }
 
     private void verifyPermissionsForAccount(long accountId) {
-        Account account = ApiHelper.instance().getCallingAccount();
+        Account account = _apiHelper.getCallingAccount();
 
-        if (ApiHelper.instance().isRootAdmin(account.getId())) {
+        if (_apiHelper.isRootAdmin(account.getId())) {
             return; // permissions OK
         }
 


Mime
View raw message