diff --git a/api/src/com/cloud/api/commands/ListGuestOsCmd.java b/api/src/com/cloud/api/commands/ListGuestOsCmd.java index 8f6e4b076e3..6548de98ddf 100644 --- a/api/src/com/cloud/api/commands/ListGuestOsCmd.java +++ b/api/src/com/cloud/api/commands/ListGuestOsCmd.java @@ -27,7 +27,6 @@ import com.cloud.api.ApiConstants; import com.cloud.api.BaseListCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; -import com.cloud.api.BaseCmd.CommandType; import com.cloud.api.response.GuestOSResponse; import com.cloud.api.response.ListResponse; import com.cloud.storage.GuestOS; @@ -48,8 +47,6 @@ public class ListGuestOsCmd extends BaseListCmd { @Parameter(name=ApiConstants.OS_CATEGORY_ID, type=CommandType.LONG, description="list by Os Category id") private Long osCategoryId; - @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor for which to restrict the search") - private String hypervisor; ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// @@ -63,9 +60,7 @@ public class ListGuestOsCmd extends BaseListCmd { return osCategoryId; } - public String getHypervisor() { - return hypervisor; - } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -77,14 +72,7 @@ public class ListGuestOsCmd extends BaseListCmd { @Override public void execute(){ - List result = null; - if (getHypervisor() == null){ - result = _mgr.listGuestOSByCriteria(this); - } - else { - result = _mgr.listGuestOSByHypervisor(this); - } - + List result = _mgr.listGuestOSByCriteria(this); ListResponse response = new ListResponse(); List osResponses = new ArrayList(); for (GuestOS guestOS : result) { diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java index b96ca58681f..bdf0646000c 100644 --- a/api/src/com/cloud/server/ManagementService.java +++ b/api/src/com/cloud/server/ManagementService.java @@ -221,7 +221,6 @@ public interface ManagementService { * @return list of GuestOS */ List listGuestOSByCriteria(ListGuestOsCmd cmd); - List listGuestOSByHypervisor(ListGuestOsCmd listGuestOsCmd); /** * Obtains a list of all guest OS categories. @@ -490,5 +489,5 @@ public interface ManagementService { String[] listEventTypes(); - + } diff --git a/core/src/com/cloud/storage/GuestOSHypervisorVO.java b/core/src/com/cloud/storage/GuestOSHypervisorVO.java deleted file mode 100644 index 5688a62c631..00000000000 --- a/core/src/com/cloud/storage/GuestOSHypervisorVO.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (C) 2011 Citrix.com, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -package com.cloud.storage; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; - -import com.cloud.hypervisor.Hypervisor.HypervisorType; - -@Entity -@Table(name="guest_os_hypervisor") -public class GuestOSHypervisorVO implements GuestOS { - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - @Column(name="id") - long id; - - @Column(name="hypervisor_type", updatable = true, nullable=false) - @Enumerated(value=EnumType.STRING) - HypervisorType hypervisorType; - - @Column(name="guest_os_name") - String guest_os_name; - - @Column(name="guest_os_id") - long guest_os_id; - - public long getId() { - return id; - } - - public HypervisorType getHypervisorType() { - return hypervisorType; - } - - public void setHypervisorType(HypervisorType hypervisor_type) { - this.hypervisorType = hypervisor_type; - } - - public String getGuestOsName() { - return guest_os_name; - } - - public void setGuestOsName(String name) { - this.guest_os_name = name; - } - - public long getGuestOsId() { - return guest_os_id; - } - - public void setGuestOsId(long guest_os_id) { - this.guest_os_id = guest_os_id; - } - - @Override - public long getCategoryId() { - return 0; - } - - @Override - public String getDisplayName() { - return guest_os_name; - } - - @Override - public String getName() { - return guest_os_name; - } -} diff --git a/server/src/com/cloud/configuration/DefaultComponentLibrary.java b/server/src/com/cloud/configuration/DefaultComponentLibrary.java index cf3c8ab0402..b7e9dd855e9 100755 --- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java +++ b/server/src/com/cloud/configuration/DefaultComponentLibrary.java @@ -115,7 +115,6 @@ import com.cloud.storage.StorageManagerImpl; import com.cloud.storage.dao.DiskOfferingDaoImpl; import com.cloud.storage.dao.GuestOSCategoryDaoImpl; import com.cloud.storage.dao.GuestOSDaoImpl; -import com.cloud.storage.dao.GuestOSHypervisorDaoImpl; import com.cloud.storage.dao.LaunchPermissionDaoImpl; import com.cloud.storage.dao.SnapshotDaoImpl; import com.cloud.storage.dao.SnapshotPolicyDaoImpl; @@ -235,7 +234,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com addDao("SyncQueueDao", SyncQueueDaoImpl.class); addDao("SyncQueueItemDao", SyncQueueItemDaoImpl.class); addDao("GuestOSDao", GuestOSDaoImpl.class); - addDao("GuestOSHypervisorDao", GuestOSHypervisorDaoImpl.class); addDao("GuestOSCategoryDao", GuestOSCategoryDaoImpl.class); addDao("StoragePoolDao", StoragePoolDaoImpl.class); addDao("StoragePoolHostDao", StoragePoolHostDaoImpl.class); diff --git a/server/src/com/cloud/server/ManagementServer.java b/server/src/com/cloud/server/ManagementServer.java index 44192e9cfa6..bd10b957b64 100755 --- a/server/src/com/cloud/server/ManagementServer.java +++ b/server/src/com/cloud/server/ManagementServer.java @@ -21,7 +21,6 @@ import java.util.Date; import java.util.List; import java.util.Map; -import com.cloud.api.commands.ListGuestOsCmd; import com.cloud.async.AsyncJobResult; import com.cloud.async.AsyncJobVO; import com.cloud.configuration.ResourceLimitVO; @@ -40,7 +39,6 @@ import com.cloud.network.IPAddressVO; import com.cloud.network.security.SecurityGroupVO; import com.cloud.service.ServiceOfferingVO; import com.cloud.storage.DiskOfferingVO; -import com.cloud.storage.GuestOSHypervisorVO; import com.cloud.storage.GuestOSVO; import com.cloud.storage.StoragePoolVO; import com.cloud.storage.VMTemplateVO; @@ -572,6 +570,4 @@ public interface ManagementServer extends ManagementService { boolean checkIfMaintenable(long hostId); String getHashKey(); - - List listGuestOSByHypervisor(ListGuestOsCmd cmd); } diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 5928e4ac45d..24b173310fe 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -186,7 +186,6 @@ import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.storage.DiskOfferingVO; import com.cloud.storage.GuestOSCategoryVO; -import com.cloud.storage.GuestOSHypervisorVO; import com.cloud.storage.GuestOSVO; import com.cloud.storage.LaunchPermissionVO; import com.cloud.storage.Storage; @@ -205,7 +204,6 @@ import com.cloud.storage.VolumeVO; import com.cloud.storage.dao.DiskOfferingDao; import com.cloud.storage.dao.GuestOSCategoryDao; import com.cloud.storage.dao.GuestOSDao; -import com.cloud.storage.dao.GuestOSHypervisorDao; import com.cloud.storage.dao.LaunchPermissionDao; import com.cloud.storage.dao.StoragePoolDao; import com.cloud.storage.dao.StoragePoolHostDao; @@ -308,7 +306,6 @@ public class ManagementServerImpl implements ManagementServer { private final AlertDao _alertDao; private final CapacityDao _capacityDao; private final GuestOSDao _guestOSDao; - private final GuestOSHypervisorDao _guestOSHypervisorDao; private final GuestOSCategoryDao _guestOSCategoryDao; private final StoragePoolDao _poolDao; private final StoragePoolHostDao _poolHostDao; @@ -386,7 +383,6 @@ public class ManagementServerImpl implements ManagementServer { _alertDao = locator.getDao(AlertDao.class); _capacityDao = locator.getDao(CapacityDao.class); _guestOSDao = locator.getDao(GuestOSDao.class); - _guestOSHypervisorDao = locator.getDao(GuestOSHypervisorDao.class); _guestOSCategoryDao = locator.getDao(GuestOSCategoryDao.class); _poolDao = locator.getDao(StoragePoolDao.class); _poolHostDao = locator.getDao(StoragePoolHostDao.class); @@ -2750,19 +2746,7 @@ public class ManagementServerImpl implements ManagementServer { return _guestOSDao.search(sc, searchFilter); } - - - @Override - public List listGuestOSByHypervisor(ListGuestOsCmd cmd) { - String hypervisor = cmd.getHypervisor(); - HypervisorType ht = HypervisorType.getType(hypervisor); - if (ht == HypervisorType.None){ - throw new InvalidParameterValueException("The Hypervisor type is not recognized " + hypervisor); - } - return _guestOSHypervisorDao.findByHypervisorType(ht); - } - - + @Override public List listGuestOSCategoriesByCriteria(ListGuestOsCategoriesCmd cmd) { Filter searchFilter = new Filter(GuestOSCategoryVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); diff --git a/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java b/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java deleted file mode 100644 index 8710bd2c1a7..00000000000 --- a/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2011 Citrix.com, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -package com.cloud.storage.dao; - -import java.util.List; - -import com.cloud.host.HostVO; -import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.storage.GuestOSHypervisorVO; -import com.cloud.utils.db.GenericDao; - -public interface GuestOSHypervisorDao extends GenericDao { - - - public List findByHypervisorType(HypervisorType hypervisorType); - - -} diff --git a/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java b/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java deleted file mode 100644 index f4955fb7554..00000000000 --- a/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2011 Citrix.com, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -package com.cloud.storage.dao; - -import java.util.List; - -import javax.ejb.Local; - -import com.cloud.host.HostVO; -import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.storage.GuestOSHypervisorVO; -import com.cloud.storage.VMTemplateHostVO; -import com.cloud.utils.db.GenericDaoBase; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; - -@Local (value={GuestOSHypervisorDao.class}) -public class GuestOSHypervisorDaoImpl extends GenericDaoBase implements GuestOSHypervisorDao { - - - protected final SearchBuilder hypervisor_search; - - protected GuestOSHypervisorDaoImpl() { - hypervisor_search = createSearchBuilder(); - hypervisor_search.and("hypervisor_type", hypervisor_search.entity().getHypervisorType(), SearchCriteria.Op.EQ); - hypervisor_search.done(); - } - - - @Override - public List findByHypervisorType(HypervisorType hypervisorType) { - SearchCriteria sc = hypervisor_search.create(); - sc.setParameters("hypervisor_type", hypervisorType); - return listBy(sc); - } - - -}