cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [17/18] git commit: api_refactor: move diskoffering to offering
Date Tue, 04 Dec 2012 19:32:06 GMT
api_refactor: move diskoffering to offering

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

Branch: refs/heads/api_refactoring
Commit: 6fe1b5f9b08796fdfbe770d8334610978a4e7a44
Parents: 1b8dc65
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Tue Dec 4 10:37:14 2012 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Tue Dec 4 10:37:14 2012 -0800

----------------------------------------------------------------------
 api/src/com/cloud/server/ManagementService.java    |    2 +-
 .../user/disk/command/ListDiskOfferingsCmd.java    |   94 ---------------
 .../offering/command/ListDiskOfferingsCmd.java     |   94 +++++++++++++++
 client/tomcatconf/commands.properties.in           |    2 +-
 .../src/com/cloud/server/ManagementServerImpl.java |    2 +-
 5 files changed, 97 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fe1b5f9/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 f6d7efa..a697b38 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -25,6 +25,7 @@ import java.util.Set;
 import com.cloud.alert.Alert;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.user.guest.command.ListGuestOsCmd;
+import org.apache.cloudstack.api.user.offering.command.ListDiskOfferingsCmd;
 import org.apache.cloudstack.api.user.ssh.command.CreateSSHKeyPairCmd;
 import org.apache.cloudstack.api.user.ssh.command.DeleteSSHKeyPairCmd;
 import com.cloud.api.commands.DestroySystemVmCmd;
@@ -38,7 +39,6 @@ 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;
-import org.apache.cloudstack.api.user.disk.command.ListDiskOfferingsCmd;
 import org.apache.cloudstack.api.user.event.command.ListEventsCmd;
 import org.apache.cloudstack.api.user.guest.command.ListGuestOsCategoriesCmd;
 import com.cloud.api.commands.ListHostsCmd;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fe1b5f9/api/src/org/apache/cloudstack/api/user/disk/command/ListDiskOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/disk/command/ListDiskOfferingsCmd.java
b/api/src/org/apache/cloudstack/api/user/disk/command/ListDiskOfferingsCmd.java
deleted file mode 100644
index ec8f884..0000000
--- a/api/src/org/apache/cloudstack/api/user/disk/command/ListDiskOfferingsCmd.java
+++ /dev/null
@@ -1,94 +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.disk.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.DiskOfferingResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.offering.DiskOffering;
-
-@Implementation(description="Lists all available disk offerings.", responseObject=DiskOfferingResponse.class)
-public class ListDiskOfferingsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDiskOfferingsCmd.class.getName());
-
-    private static final String s_name = "listdiskofferingsresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of
the domain of the disk offering.")
-    private Long domainId;
-
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of the disk offering")
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the
disk offering")
-    private String diskOfferingName;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getDiskOfferingName() {
-        return diskOfferingName;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public void execute(){
-        List<? extends DiskOffering> result = _mgr.searchForDiskOfferings(this);
-        ListResponse<DiskOfferingResponse> response = new ListResponse<DiskOfferingResponse>();
-        List<DiskOfferingResponse> diskOfferingResponses = new ArrayList<DiskOfferingResponse>();
-        for (DiskOffering offering : result) {
-            DiskOfferingResponse diskOffResp = _responseGenerator.createDiskOfferingResponse(offering);
-            diskOffResp.setObjectName("diskoffering");
-            diskOfferingResponses.add(diskOffResp);
-        }
-
-        response.setResponses(diskOfferingResponses);
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fe1b5f9/api/src/org/apache/cloudstack/api/user/offering/command/ListDiskOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/offering/command/ListDiskOfferingsCmd.java
b/api/src/org/apache/cloudstack/api/user/offering/command/ListDiskOfferingsCmd.java
new file mode 100644
index 0000000..85d4249
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/user/offering/command/ListDiskOfferingsCmd.java
@@ -0,0 +1,94 @@
+// 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.offering.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import com.cloud.api.response.DiskOfferingResponse;
+import com.cloud.api.response.ListResponse;
+import com.cloud.offering.DiskOffering;
+
+@Implementation(description="Lists all available disk offerings.", responseObject=DiskOfferingResponse.class)
+public class ListDiskOfferingsCmd extends BaseListCmd {
+    public static final Logger s_logger = Logger.getLogger(ListDiskOfferingsCmd.class.getName());
+
+    private static final String s_name = "listdiskofferingsresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of
the domain of the disk offering.")
+    private Long domainId;
+
+    @IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of the disk offering")
+    private Long id;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the
disk offering")
+    private String diskOfferingName;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getDomainId() {
+        return domainId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getDiskOfferingName() {
+        return diskOfferingName;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public void execute(){
+        List<? extends DiskOffering> result = _mgr.searchForDiskOfferings(this);
+        ListResponse<DiskOfferingResponse> response = new ListResponse<DiskOfferingResponse>();
+        List<DiskOfferingResponse> diskOfferingResponses = new ArrayList<DiskOfferingResponse>();
+        for (DiskOffering offering : result) {
+            DiskOfferingResponse diskOffResp = _responseGenerator.createDiskOfferingResponse(offering);
+            diskOffResp.setObjectName("diskoffering");
+            diskOfferingResponses.add(diskOffResp);
+        }
+
+        response.setResponses(diskOfferingResponses);
+        response.setResponseName(getCommandName());
+        this.setResponseObject(response);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fe1b5f9/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index b97650f..7101155 100755
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -116,7 +116,7 @@ listServiceOfferings=org.apache.cloudstack.api.user.serviceoffering.command.List
 createDiskOffering=com.cloud.api.commands.CreateDiskOfferingCmd;1
 updateDiskOffering=com.cloud.api.commands.UpdateDiskOfferingCmd;1
 deleteDiskOffering=com.cloud.api.commands.DeleteDiskOfferingCmd;1
-listDiskOfferings=org.apache.cloudstack.api.user.disk.command.ListDiskOfferingsCmd;15
+listDiskOfferings=org.apache.cloudstack.api.user.offering.command.ListDiskOfferingsCmd;15
 
 #### vlan commands
 createVlanIpRange=com.cloud.api.commands.CreateVlanIpRangeCmd;1

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fe1b5f9/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 fef59bf..eb14d46 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -46,6 +46,7 @@ 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;
 import org.apache.cloudstack.api.user.job.command.ListAsyncJobsCmd;
+import org.apache.cloudstack.api.user.offering.command.ListDiskOfferingsCmd;
 import org.apache.cloudstack.api.user.serviceoffering.command.ListServiceOfferingsCmd;
 import org.apache.cloudstack.api.user.ssh.command.DeleteSSHKeyPairCmd;
 import org.apache.cloudstack.api.user.ssh.command.RegisterSSHKeyPairCmd;
@@ -77,7 +78,6 @@ 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;
-import org.apache.cloudstack.api.user.disk.command.ListDiskOfferingsCmd;
 import org.apache.cloudstack.api.user.event.command.ListEventsCmd;
 import com.cloud.api.commands.ListHostsCmd;
 import com.cloud.api.commands.ListPodsByCmd;


Mime
View raw message