cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject [4/4] git commit: updated refs/heads/master to 265208a
Date Sat, 22 Mar 2014 19:41:54 GMT
Removed commented-out code

A big block of code commented out for about a year.

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


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

Branch: refs/heads/master
Commit: 3dc4d2ec212bd4ae566f64d9682b4395efa059ec
Parents: dd22568
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Sat Mar 22 09:38:08 2014 +0100
Committer: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Committed: Sat Mar 22 18:34:46 2014 +0100

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java | 268 -------------------
 1 file changed, 268 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3dc4d2ec/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 9915ea9..38f2f0b 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1328,274 +1328,6 @@ public class ApiResponseHelper implements ResponseGenerator {
         return ViewResponseHelper.createIsoResponse(view, tvo.toArray(new TemplateJoinVO[tvo.size()]));
     }
 
-    /*
-    @Override
-    public List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean
readyOnly) {
-
-        final List<TemplateResponse> isoResponses = new ArrayList<TemplateResponse>();
-        VirtualMachineTemplate iso = findTemplateById(isoId);
-        if (iso.getTemplateType() == TemplateType.PERHOST) {
-            TemplateResponse isoResponse = new TemplateResponse();
-            isoResponse.setId(iso.getUuid());
-            isoResponse.setName(iso.getName());
-            isoResponse.setDisplayText(iso.getDisplayText());
-            isoResponse.setPublic(iso.isPublicTemplate());
-            isoResponse.setExtractable(iso.isExtractable() && !(iso.getTemplateType()
== TemplateType.PERHOST));
-            isoResponse.setReady(true);
-            isoResponse.setBootable(iso.isBootable());
-            isoResponse.setFeatured(iso.isFeatured());
-            isoResponse.setCrossZones(iso.isCrossZones());
-            isoResponse.setPublic(iso.isPublicTemplate());
-            isoResponse.setCreated(iso.getCreated());
-            isoResponse.setChecksum(iso.getChecksum());
-            isoResponse.setPasswordEnabled(false);
-            isoResponse.setDetails(iso.getDetails());
-
-            // add account ID and name
-            Account owner = ApiDBUtils.findAccountById(iso.getAccountId());
-            populateAccount(isoResponse, owner.getId());
-            populateDomain(isoResponse, owner.getDomainId());
-
-            // set tag information
-            List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.ISO,
iso.getId());
-            List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
-            for (ResourceTag tag : tags) {
-                ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
-                tagResponses.add(tagResponse);
-            }
-            isoResponse.setTags(tagResponses);
-
-            isoResponse.setObjectName("iso");
-            isoResponses.add(isoResponse);
-            return isoResponses;
-        } else {
-            if (zoneId == null || zoneId == -1) {
-                isoResponses.addAll(createSwiftIsoResponses(iso));
-                if (!isoResponses.isEmpty()) {
-                    return isoResponses;
-                }
-
-                isoResponses.addAll(createS3IsoResponses(iso));
-                if (!isoResponses.isEmpty()) {
-                    return isoResponses;
-                }
-
-                final List<DataCenterVO> dcs = new ArrayList<DataCenterVO>();
-                dcs.addAll(ApiDBUtils.listZones());
-                for (DataCenterVO dc : dcs) {
-                    isoResponses.addAll(createIsoResponses(iso, dc.getId(), readyOnly));
-                }
-                return isoResponses;
-            } else {
-                return createIsoResponses(iso, zoneId, readyOnly);
-            }
-        }
-    }
-
-    private List<? extends TemplateResponse> createS3IsoResponses(final VirtualMachineTemplate
iso) {
-
-        final VMTemplateS3VO s3Iso = ApiDBUtils.findTemplateS3Ref(iso.getId());
-
-        if (s3Iso == null) {
-            return emptyList();
-        }
-
-        final TemplateResponse templateResponse = new TemplateResponse();
-
-        templateResponse.setId(iso.getUuid());
-        templateResponse.setName(iso.getName());
-        templateResponse.setDisplayText(iso.getDisplayText());
-        templateResponse.setPublic(iso.isPublicTemplate());
-        templateResponse.setExtractable(iso.isExtractable());
-        templateResponse.setCreated(s3Iso.getCreated());
-        templateResponse.setReady(true);
-        templateResponse.setBootable(iso.isBootable());
-        templateResponse.setFeatured(iso.isFeatured());
-        templateResponse.setCrossZones(iso.isCrossZones());
-        templateResponse.setChecksum(iso.getChecksum());
-        templateResponse.setDetails(iso.getDetails());
-
-        final GuestOS os = ApiDBUtils.findGuestOSById(iso.getGuestOSId());
-
-        if (os != null) {
-            templateResponse.setOsTypeId(os.getUuid());
-            templateResponse.setOsTypeName(os.getDisplayName());
-        } else {
-            templateResponse.setOsTypeId("");
-            templateResponse.setOsTypeName("");
-        }
-
-        final Account account = ApiDBUtils.findAccountById(iso.getAccountId());
-        populateAccount(templateResponse, account.getId());
-        populateDomain(templateResponse, account.getDomainId());
-
-        boolean isAdmin = false;
-        if ((account == null) || BaseCmd.isAdmin(account.getType())) {
-            isAdmin = true;
-        }
-
-        // If the user is an admin, add the template download status
-        if (isAdmin || account.getId() == iso.getAccountId()) {
-            // add download status
-            templateResponse.setStatus("Successfully Installed");
-        }
-
-        final Long isoSize = s3Iso.getSize();
-        if (isoSize > 0) {
-            templateResponse.setSize(isoSize);
-        }
-
-        templateResponse.setObjectName("iso");
-
-        return singletonList(templateResponse);
-
-    }
-
-    private List<TemplateResponse> createSwiftIsoResponses(VirtualMachineTemplate iso)
{
-        long isoId = iso.getId();
-        List<TemplateResponse> isoResponses = new ArrayList<TemplateResponse>();
-        VMTemplateSwiftVO isoSwift = ApiDBUtils.findTemplateSwiftRef(isoId);
-        if (isoSwift == null) {
-            return isoResponses;
-        }
-        TemplateResponse isoResponse = new TemplateResponse();
-        isoResponse.setId(iso.getUuid());
-        isoResponse.setName(iso.getName());
-        isoResponse.setDisplayText(iso.getDisplayText());
-        isoResponse.setPublic(iso.isPublicTemplate());
-        isoResponse.setExtractable(iso.isExtractable() && !(iso.getTemplateType()
== TemplateType.PERHOST));
-        isoResponse.setCreated(isoSwift.getCreated());
-        isoResponse.setReady(true);
-        isoResponse.setBootable(iso.isBootable());
-        isoResponse.setFeatured(iso.isFeatured());
-        isoResponse.setCrossZones(iso.isCrossZones());
-        isoResponse.setPublic(iso.isPublicTemplate());
-        isoResponse.setChecksum(iso.getChecksum());
-        isoResponse.setDetails(iso.getDetails());
-
-        // TODO: implement
-        GuestOS os = ApiDBUtils.findGuestOSById(iso.getGuestOSId());
-        if (os != null) {
-            isoResponse.setOsTypeId(os.getUuid());
-            isoResponse.setOsTypeName(os.getDisplayName());
-        } else {
-            isoResponse.setOsTypeId("-1");
-            isoResponse.setOsTypeName("");
-        }
-        Account account = ApiDBUtils.findAccountById(iso.getAccountId());
-        populateAccount(isoResponse, account.getId());
-        populateDomain(isoResponse, account.getDomainId());
-        boolean isAdmin = false;
-        if ((account == null) || BaseCmd.isAdmin(account.getType())) {
-            isAdmin = true;
-        }
-
-        // If the user is an admin, add the template download status
-        if (isAdmin || account.getId() == iso.getAccountId()) {
-            // add download status
-            isoResponse.setStatus("Successfully Installed");
-        }
-        Long isoSize = isoSwift.getSize();
-        if (isoSize > 0) {
-            isoResponse.setSize(isoSize);
-        }
-        isoResponse.setObjectName("iso");
-        isoResponses.add(isoResponse);
-        return isoResponses;
-    }
-
-    @Override
-    public List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long
zoneId, boolean readyOnly) {
-        long isoId = iso.getId();
-        List<TemplateResponse> isoResponses = new ArrayList<TemplateResponse>();
-        VMTemplateHostVO isoHost = ApiDBUtils.findTemplateHostRef(isoId, zoneId, readyOnly);
-        if (isoHost == null) {
-            return isoResponses;
-        }
-        TemplateResponse isoResponse = new TemplateResponse();
-        isoResponse.setId(iso.getUuid());
-        isoResponse.setName(iso.getName());
-        isoResponse.setDisplayText(iso.getDisplayText());
-        isoResponse.setPublic(iso.isPublicTemplate());
-        isoResponse.setExtractable(iso.isExtractable() && !(iso.getTemplateType()
== TemplateType.PERHOST));
-        isoResponse.setCreated(isoHost.getCreated());
-        isoResponse.setReady(isoHost.getDownloadState() == Status.DOWNLOADED);
-        isoResponse.setBootable(iso.isBootable());
-        isoResponse.setFeatured(iso.isFeatured());
-        isoResponse.setCrossZones(iso.isCrossZones());
-        isoResponse.setPublic(iso.isPublicTemplate());
-        isoResponse.setChecksum(iso.getChecksum());
-        isoResponse.setDetails(iso.getDetails());
-
-        // TODO: implement
-        GuestOS os = ApiDBUtils.findGuestOSById(iso.getGuestOSId());
-        if (os != null) {
-            isoResponse.setOsTypeId(os.getUuid());
-            isoResponse.setOsTypeName(os.getDisplayName());
-        } else {
-            isoResponse.setOsTypeId("-1");
-            isoResponse.setOsTypeName("");
-        }
-
-        Account account = ApiDBUtils.findAccountById(iso.getAccountId());
-        populateAccount(isoResponse, account.getId());
-        populateDomain(isoResponse, account.getDomainId());
-
-        Account caller = UserContext.current().getCaller();
-        boolean isAdmin = false;
-        if ((caller == null) || BaseCmd.isAdmin(caller.getType())) {
-            isAdmin = true;
-        }
-        // Add the zone ID
-        DataCenter datacenter = ApiDBUtils.findZoneById(zoneId);
-        if (datacenter != null) {
-            isoResponse.setZoneId(datacenter.getUuid());
-            isoResponse.setZoneName(datacenter.getName());
-        }
-
-        // If the user is an admin, add the template download status
-        if (isAdmin || caller.getId() == iso.getAccountId()) {
-            // add download status
-            if (isoHost.getDownloadState() != Status.DOWNLOADED) {
-                String isoStatus = "Processing";
-                if (isoHost.getDownloadState() == VMTemplateHostVO.Status.DOWNLOADED) {
-                    isoStatus = "Download Complete";
-                } else if (isoHost.getDownloadState() == VMTemplateHostVO.Status.DOWNLOAD_IN_PROGRESS)
{
-                    if (isoHost.getDownloadPercent() == 100) {
-                        isoStatus = "Installing ISO";
-                    } else {
-                        isoStatus = isoHost.getDownloadPercent() + "% Downloaded";
-                    }
-                } else {
-                    isoStatus = isoHost.getErrorString();
-                }
-                isoResponse.setStatus(isoStatus);
-            } else {
-                isoResponse.setStatus("Successfully Installed");
-            }
-        }
-
-        Long isoSize = isoHost.getSize();
-        if (isoSize > 0) {
-            isoResponse.setSize(isoSize);
-        }
-
-        // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.ISO,
iso.getId());
-
-        List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
-        for (ResourceTag tag : tags) {
-            ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
-            tagResponses.add(tagResponse);
-        }
-        isoResponse.setTags(tagResponses);
-
-        isoResponse.setObjectName("iso");
-        isoResponses.add(isoResponse);
-        return isoResponses;
-    }
-     */
-
     @Override
     public SecurityGroupResponse createSecurityGroupResponse(SecurityGroup group) {
         List<SecurityGroupJoinVO> viewSgs = ApiDBUtils.newSecurityGroupView(group);


Mime
View raw message