Package com.cloud.storage

Examples of com.cloud.storage.Upload


    public void execute(){
        try {
            UserContext.current().setEventDetails("Volume Id: "+getId());
            Long uploadId = _mgr.extractVolume(this);
            if (uploadId != null){
                Upload uploadInfo = _entityMgr.findById(Upload.class, uploadId);
                ExtractResponse response = new ExtractResponse();
                response.setResponseName(getCommandName());
                response.setObjectName("volume");
                response.setIdentityTableName("volumes");
                response.setId(id);
                response.setName(_entityMgr.findById(Volume.class, id).getName());       
                response.setZoneId(zoneId);
                response.setZoneName(_entityMgr.findById(DataCenter.class, zoneId).getName());
                response.setMode(mode);
                response.setUploadId(uploadId);
                response.setState(uploadInfo.getUploadState().toString());
                response.setAccountId(getEntityOwnerId());       
                response.setUrl(uploadInfo.getUploadUrl());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to extract volume");
            }
        } catch (URISyntaxException ex) {
View Full Code Here


    public void execute(){
        try {
            UserContext.current().setEventDetails("Volume Id: "+getId());
            Long uploadId = _mgr.extractVolume(this);
            if (uploadId != null){
                Upload uploadInfo = _entityMgr.findById(Upload.class, uploadId);
                ExtractResponse response = new ExtractResponse();
                response.setResponseName(getCommandName());
                response.setObjectName("volume");
                Volume vol = _entityMgr.findById(Volume.class, id);
                response.setId(vol.getUuid());
                response.setName(vol.getName());
                DataCenter zone = _entityMgr.findById(DataCenter.class, zoneId);
                response.setZoneId(zone.getUuid());
                response.setZoneName(zone.getName());
                response.setMode(mode);
                response.setUploadId(uploadInfo.getUuid());
                response.setState(uploadInfo.getUploadState().toString());
                Account account = _entityMgr.findById(Account.class, getEntityOwnerId());
                response.setAccountId(account.getUuid());
                response.setUrl(uploadInfo.getUploadUrl());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to extract volume");
            }
        } catch (URISyntaxException ex) {
View Full Code Here

TOP

Related Classes of com.cloud.storage.Upload

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.