You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/04 20:32:06 UTC
[14/18] git commit: api_refactor: move listcapabilites to dc
api_refactor: move listcapabilites to dc
Signed-off-by: Rohit Yadav <bh...@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/a34fc1f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/a34fc1f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/a34fc1f1
Branch: refs/heads/api_refactoring
Commit: a34fc1f1a766187e4e4425e284f5dd2bbae0ce85
Parents: d3261e5
Author: Rohit Yadav <bh...@apache.org>
Authored: Tue Dec 4 10:44:17 2012 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Tue Dec 4 10:44:17 2012 -0800
----------------------------------------------------------------------
api/src/com/cloud/server/ManagementService.java | 2 +-
.../configuration/command/ListCapabilitiesCmd.java | 59 ---------------
.../datacenter/command/ListCapabilitiesCmd.java | 59 +++++++++++++++
client/tomcatconf/commands.properties.in | 2 +-
.../src/com/cloud/server/ManagementServerImpl.java | 2 +-
5 files changed, 62 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a34fc1f1/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java
index 2b22397..e9fcf65 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -24,6 +24,7 @@ import java.util.Set;
import com.cloud.alert.Alert;
import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.user.datacenter.command.ListCapabilitiesCmd;
import org.apache.cloudstack.api.user.guest.command.ListGuestOsCmd;
import org.apache.cloudstack.api.user.offering.command.ListDiskOfferingsCmd;
import org.apache.cloudstack.api.user.offering.command.ListServiceOfferingsCmd;
@@ -36,7 +37,6 @@ import org.apache.cloudstack.api.user.template.command.UpdateTemplateCmd;
import org.apache.cloudstack.api.user.vm.command.GetVMPasswordCmd;
import com.cloud.api.commands.ListAlertsCmd;
import org.apache.cloudstack.api.user.job.command.ListAsyncJobsCmd;
-import org.apache.cloudstack.api.user.configuration.command.ListCapabilitiesCmd;
import com.cloud.api.commands.ListCapacityCmd;
import com.cloud.api.commands.ListCfgsByCmd;
import com.cloud.api.commands.ListClustersCmd;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a34fc1f1/api/src/org/apache/cloudstack/api/user/configuration/command/ListCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/configuration/command/ListCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/user/configuration/command/ListCapabilitiesCmd.java
deleted file mode 100644
index 22541a3..0000000
--- a/api/src/org/apache/cloudstack/api/user/configuration/command/ListCapabilitiesCmd.java
+++ /dev/null
@@ -1,59 +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 org.apache.cloudstack.api.user.configuration.command;
-
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.Implementation;
-import com.cloud.api.response.CapabilitiesResponse;
-import com.cloud.user.Account;
-
-@Implementation(description="Lists capabilities", responseObject=CapabilitiesResponse.class)
-public class ListCapabilitiesCmd extends BaseCmd {
- public static final Logger s_logger = Logger.getLogger(ListCapabilitiesCmd.class.getName());
-
- private static final String s_name = "listcapabilitiesresponse";
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
- @Override
- public void execute(){
- Map<String, Object> capabilities = _mgr.listCapabilities(this);
- CapabilitiesResponse response = new CapabilitiesResponse();
- response.setSecurityGroupsEnabled((Boolean)capabilities.get("securityGroupsEnabled"));
- response.setCloudStackVersion((String)capabilities.get("cloudStackVersion"));
- response.setUserPublicTemplateEnabled((Boolean)capabilities.get("userPublicTemplateEnabled"));
- response.setSupportELB((String)capabilities.get("supportELB"));
- response.setProjectInviteRequired((Boolean)capabilities.get("projectInviteRequired"));
- response.setAllowUsersCreateProjects((Boolean)capabilities.get("allowusercreateprojects"));
- response.setDiskOffMaxSize((Long)capabilities.get("customDiskOffMaxSize"));
- response.setObjectName("capability");
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a34fc1f1/api/src/org/apache/cloudstack/api/user/datacenter/command/ListCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/datacenter/command/ListCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/user/datacenter/command/ListCapabilitiesCmd.java
new file mode 100644
index 0000000..aa926c2
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/user/datacenter/command/ListCapabilitiesCmd.java
@@ -0,0 +1,59 @@
+// 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.datacenter.command;
+
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Implementation;
+import com.cloud.api.response.CapabilitiesResponse;
+import com.cloud.user.Account;
+
+@Implementation(description="Lists capabilities", responseObject=CapabilitiesResponse.class)
+public class ListCapabilitiesCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(ListCapabilitiesCmd.class.getName());
+
+ private static final String s_name = "listcapabilitiesresponse";
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ @Override
+ public void execute(){
+ Map<String, Object> capabilities = _mgr.listCapabilities(this);
+ CapabilitiesResponse response = new CapabilitiesResponse();
+ response.setSecurityGroupsEnabled((Boolean)capabilities.get("securityGroupsEnabled"));
+ response.setCloudStackVersion((String)capabilities.get("cloudStackVersion"));
+ response.setUserPublicTemplateEnabled((Boolean)capabilities.get("userPublicTemplateEnabled"));
+ response.setSupportELB((String)capabilities.get("supportELB"));
+ response.setProjectInviteRequired((Boolean)capabilities.get("projectInviteRequired"));
+ response.setAllowUsersCreateProjects((Boolean)capabilities.get("allowusercreateprojects"));
+ response.setDiskOffMaxSize((Long)capabilities.get("customDiskOffMaxSize"));
+ response.setObjectName("capability");
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a34fc1f1/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index f778ddd..dd0c7fa 100755
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -199,7 +199,7 @@ updateConfiguration=com.cloud.api.commands.UpdateCfgCmd;1
listConfigurations=com.cloud.api.commands.ListCfgsByCmd;1
ldapConfig=com.cloud.api.commands.LDAPConfigCmd;1
ldapRemove=com.cloud.api.commands.LDAPRemoveCmd;1
-listCapabilities=org.apache.cloudstack.api.user.configuration.command.ListCapabilitiesCmd;15
+listCapabilities=org.apache.cloudstack.api.user.datacenter.command.ListCapabilitiesCmd;15
#### pod commands
createPod=com.cloud.api.commands.CreatePodCmd;1
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a34fc1f1/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 61950d6..2f8575f 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -42,6 +42,7 @@ import java.util.concurrent.TimeUnit;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
+import org.apache.cloudstack.api.user.datacenter.command.ListCapabilitiesCmd;
import org.apache.cloudstack.api.user.guest.command.ListGuestOsCategoriesCmd;
import org.apache.cloudstack.api.user.guest.command.ListGuestOsCmd;
import org.apache.cloudstack.api.user.iso.command.ListIsosCmd;
@@ -74,7 +75,6 @@ import com.cloud.api.commands.DestroySystemVmCmd;
import com.cloud.api.commands.ExtractVolumeCmd;
import org.apache.cloudstack.api.user.vm.command.GetVMPasswordCmd;
import com.cloud.api.commands.ListAlertsCmd;
-import org.apache.cloudstack.api.user.configuration.command.ListCapabilitiesCmd;
import com.cloud.api.commands.ListCapacityCmd;
import com.cloud.api.commands.ListCfgsByCmd;
import com.cloud.api.commands.ListClustersCmd;