Examples of CopyCommand


Examples of org.apache.cloudstack.storage.command.CopyCommand

            return answer;
        }
        SnapshotObjectTO snapshotOnCacheStore = (SnapshotObjectTO)answer.getNewData();
        snapshotOnCacheStore.setDataStore(cacheStore);
        ((SnapshotObjectTO) destData).setDataStore(imageStore);
        CopyCommand newCpyCmd = new CopyCommand(snapshotOnCacheStore, destData, cmd.getWaitInMillSeconds(), cmd.executeInSequence());
        return copyToObjectStore(newCpyCmd);
    }
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CopyCommand

            if (needCacheStorage(srcData, destData)) {
                Scope destScope = pickCacheScopeForCopy(srcData, destData);
                srcForCopy = cacheData = cacheMgr.createCacheObject(srcData, destScope);
            }

            CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait, _mgmtServer.getExecuteInSequence());
            EndPoint ep = selector.select(srcForCopy, destData);
            answer = ep.sendMessage(cmd);

            if (cacheData != null) {
                if (srcData.getType() == DataObjectType.VOLUME && destData.getType() == DataObjectType.VOLUME) {
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CopyCommand

            String value = configDao.getValue(Config.CreateVolumeFromSnapshotWait.toString());
            int _createVolumeFromSnapshotWait = NumbersUtil.parseInt(value,
                    Integer.parseInt(Config.CreateVolumeFromSnapshotWait.getDefaultValue()));

            CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, _mgmtServer.getExecuteInSequence());
            EndPoint ep = selector.select(snapObj, volObj);
            Answer answer = ep.sendMessage(cmd);

            return answer;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CopyCommand

            }
        }
    }

    protected Answer cloneVolume(DataObject template, DataObject volume) {
        CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0, _mgmtServer.getExecuteInSequence());
        try {
            EndPoint ep = selector.select(volume.getDataStore());
            Answer answer = ep.sendMessage(cmd);
            return answer;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CopyCommand

            objOnImageStore.processEvent(Event.OperationSuccessed, answer);

            objOnImageStore.processEvent(Event.CopyingRequested);

            CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence());
            EndPoint ep = selector.select(objOnImageStore, destData);
            answer = ep.sendMessage(cmd);

            if (answer == null || !answer.getResult()) {
                if (answer != null) {
                    s_logger.debug("copy to primary store failed: " + answer.getDetails());
                }
                objOnImageStore.processEvent(Event.OperationFailed);
                imageStore.delete(objOnImageStore);
                return answer;
            }

            objOnImageStore.processEvent(Event.OperationSuccessed);
            imageStore.delete(objOnImageStore);
            return answer;
        } else {
            DataObject cacheData = cacheMgr.createCacheObject(srcData, destScope);
            CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence());
            EndPoint ep = selector.select(cacheData, destData);
            Answer answer = ep.sendMessage(cmd);
            // delete volume on cache store
            if (cacheData != null) {
                cacheMgr.deleteCacheObject(cacheData);
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CopyCommand

            needCache = true;
            SnapshotInfo snapshot = (SnapshotInfo) srcData;
            srcData = cacheSnapshotChain(snapshot);
        }

        CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait, _mgmtServer.getExecuteInSequence());
        EndPoint ep = selector.select(srcData, destData);
        Answer answer = ep.sendMessage(cmd);
       
        // clean up snapshot copied to staging
        if (needCache && srcData != null) {
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CopyCommand

        try {
            if (needCacheStorage(srcData, destData)) {
                Scope selectedScope = pickCacheScopeForCopy(srcData, destData);
                cacheData = cacheMgr.getCacheObject(srcData, selectedScope);

                CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence());
                cmd.setCacheTO(cacheData.getTO());
                EndPoint ep = selector.select(srcData, destData, StorageAction.BACKUPSNAPSHOT);
                answer = ep.sendMessage(cmd);
            } else {
                CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence());
                EndPoint ep = selector.select(srcData, destData, StorageAction.BACKUPSNAPSHOT);
                answer = ep.sendMessage(cmd);
            }

            if (cacheData != null) {
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.commands.range.CopyCommand

  public void perform() {
    DesignerCommand command = null;
    IHTMLGraphicalViewer viewer = getViewer();
    if (viewer.isInRangeMode()) {
      command = new CopyCommand(viewer);
      command.execute();
    } else {
      Command nodeCopy = new CopyNodeCommand(viewer);
      nodeCopy.execute();
    }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.commands.range.CopyCommand

            .getCurrentViewer());
        e.doit = false;
        break;
      } else if ((e.stateMask & SWT.CONTROL) != 0) {
        // "copy"
        command = new CopyCommand((IHTMLGraphicalViewer) this
            .getCurrentViewer());
        e.doit = false;
        break;
      }
      break;
View Full Code Here

Examples of org.exoplatform.services.jcr.webdav.command.CopyCommand

         {

            if (srcWorkspace.equals(destWorkspace))
            {
               Session session = session(repoName, destWorkspace, lockTokens);
               return new CopyCommand(itemExisted).copy(session, srcNodePath, destNodePath);
            }

            Session destSession = session(repoName, destWorkspace, lockTokens);
            return new CopyCommand(itemExisted).copy(destSession, srcWorkspace, srcNodePath, destNodePath);

         }
         else if (depth.getIntValue() == 0)
         {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.