cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/55] [abbrv] git commit: api_refactor: refactor list hypervisor api
Date Tue, 04 Dec 2012 10:02:55 GMT
Updated Branches:
  refs/heads/api_refactoring a2306f491 -> 91d199b8d


api_refactor: refactor list hypervisor api

- Fix refactored apis, mappings in commands*.in

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/91d199b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/91d199b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/91d199b8

Branch: refs/heads/api_refactoring
Commit: 91d199b8d8b740ce6f6cd588f675bad460e25aac
Parents: cabbc7b
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Tue Dec 4 00:34:26 2012 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Tue Dec 4 00:34:26 2012 -0800

----------------------------------------------------------------------
 .../com/cloud/api/commands/ListHypervisorsCmd.java |   84 --------------
 .../hypervisor/command/ListHypervisorsCmd.java     |   85 +++++++++++++++
 client/tomcatconf/commands.properties.in           |    2 +-
 3 files changed, 86 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/91d199b8/api/src/com/cloud/api/commands/ListHypervisorsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/ListHypervisorsCmd.java b/api/src/com/cloud/api/commands/ListHypervisorsCmd.java
deleted file mode 100644
index ec460f3..0000000
--- a/api/src/com/cloud/api/commands/ListHypervisorsCmd.java
+++ /dev/null
@@ -1,84 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.HypervisorResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.user.Account;
-
-@Implementation(description = "List hypervisors", responseObject = HypervisorResponse.class)
-public class ListHypervisorsCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
-    private static final String s_name = "listhypervisorsresponse";
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, description = "the zone
id for listing hypervisors.")
-    private Long zoneId;
-
-    // ///////////////////////////////////////////////////
-    // ///////////////// Accessors ///////////////////////
-    // ///////////////////////////////////////////////////
-
-    public Long getZoneId() {
-        return this.zoneId;
-    }
-
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute() {
-        List<String> result = _mgr.getHypervisors(getZoneId());
-        ListResponse<HypervisorResponse> response = new ListResponse<HypervisorResponse>();
-        ArrayList<HypervisorResponse> responses = new ArrayList<HypervisorResponse>();
-        if (result != null) {
-            for (String hypervisor : result) {
-                HypervisorResponse hypervisorResponse = new HypervisorResponse();
-                hypervisorResponse.setName(hypervisor);
-                hypervisorResponse.setObjectName("hypervisor");
-                responses.add(hypervisorResponse);
-            }
-        }
-        response.setResponses(responses);
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/91d199b8/api/src/org/apache/cloudstack/api/user/hypervisor/command/ListHypervisorsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/hypervisor/command/ListHypervisorsCmd.java
b/api/src/org/apache/cloudstack/api/user/hypervisor/command/ListHypervisorsCmd.java
new file mode 100644
index 0000000..abab724
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/user/hypervisor/command/ListHypervisorsCmd.java
@@ -0,0 +1,85 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.user.hypervisor.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.cloud.api.commands.UpgradeRouterCmd;
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import com.cloud.api.response.HypervisorResponse;
+import com.cloud.api.response.ListResponse;
+import com.cloud.user.Account;
+
+@Implementation(description = "List hypervisors", responseObject = HypervisorResponse.class)
+public class ListHypervisorsCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
+    private static final String s_name = "listhypervisorsresponse";
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    // ///////////////////////////////////////////////////
+    // ////////////// API parameters /////////////////////
+    // ///////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="data_center")
+    @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, description = "the zone
id for listing hypervisors.")
+    private Long zoneId;
+
+    // ///////////////////////////////////////////////////
+    // ///////////////// Accessors ///////////////////////
+    // ///////////////////////////////////////////////////
+
+    public Long getZoneId() {
+        return this.zoneId;
+    }
+
+    // ///////////////////////////////////////////////////
+    // ///////////// API Implementation///////////////////
+    // ///////////////////////////////////////////////////
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute() {
+        List<String> result = _mgr.getHypervisors(getZoneId());
+        ListResponse<HypervisorResponse> response = new ListResponse<HypervisorResponse>();
+        ArrayList<HypervisorResponse> responses = new ArrayList<HypervisorResponse>();
+        if (result != null) {
+            for (String hypervisor : result) {
+                HypervisorResponse hypervisorResponse = new HypervisorResponse();
+                hypervisorResponse.setName(hypervisor);
+                hypervisorResponse.setObjectName("hypervisor");
+                responses.add(hypervisorResponse);
+            }
+        }
+        response.setResponses(responses);
+        response.setResponseName(getCommandName());
+        this.setResponseObject(response);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/91d199b8/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 0e1ccc2..ac748ab 100755
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -290,7 +290,7 @@ listInstanceGroups=org.apache.cloudstack.api.user.vmgroup.command.ListVMGroupsCm
 uploadCustomCertificate=com.cloud.api.commands.UploadCustomCertificateCmd;1
 
 ### other commands
-listHypervisors=com.cloud.api.commands.ListHypervisorsCmd;15
+listHypervisors=org.apache.cloudstack.api.user.hypervisor.command.ListHypervisorsCmd;15
 
 ### VPN
 createRemoteAccessVpn=org.apache.cloudstack.api.user.vpn.command.CreateRemoteAccessVpnCmd;15


Mime
View raw message