Package org.apache.cloudstack.engine.subsystem.api.storage

Examples of org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy


        return provider;
    }

    @Bean
    public DataMotionStrategy dataMotionStrategy() {
        DataMotionStrategy strategy = new MockStorageMotionStrategy();
        return strategy;
    }
View Full Code Here


        } else if (destData.getDataStore().getDriver().canCopy(srcData, destData)) {
            destData.getDataStore().getDriver().copyAsync(srcData, destData, callback);
            return;
        }

        DataMotionStrategy strategy = storageStrategyFactory.getDataMotionStrategy(srcData, destData);
        if (strategy == null) {
            throw new CloudRuntimeException("Can't find strategy to move data. " + "Source: " + srcData.getType().name() + " '" + srcData.getUuid() + ", Destination: " +
                destData.getType().name() + " '" + destData.getUuid() + "'");
        }

        strategy.copyAsync(srcData, destData, destHost, callback);
    }
View Full Code Here

    }

    @Override
    public void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback) {

        DataMotionStrategy strategy = storageStrategyFactory.getDataMotionStrategy(volumeMap, srcHost, destHost);
        if (strategy == null) {
            List<String> volumeIds = new LinkedList<String>();
            for (final VolumeInfo volumeInfo : volumeMap.keySet()) {
                volumeIds.add(volumeInfo.getUuid());
            }

            throw new CloudRuntimeException("Can't find strategy to move data. " + "Source Host: " + srcHost.getName() + ", Destination Host: " + destHost.getName() +
                ", Volume UUIDs: " + StringUtils.join(volumeIds, ","));
        }

        strategy.copyAsync(volumeMap, vmTo, srcHost, destHost, callback);
    }
View Full Code Here

        return provider;
    }

    @Bean
    public DataMotionStrategy dataMotionStrategy() {
        DataMotionStrategy strategy = new MockStorageMotionStrategy();
        return strategy;
    }
View Full Code Here

        } else if (destData.getDataStore().getDriver().canCopy(srcData, destData)) {
            destData.getDataStore().getDriver().copyAsync(srcData, destData, callback);
            return;
        }

        DataMotionStrategy strategy = storageStrategyFactory.getDataMotionStrategy(srcData, destData);
        if (strategy == null) {
            throw new CloudRuntimeException("Can't find strategy to move data. "+
                    "Source: "+srcData.getType().name()+" '"+srcData.getUuid()+
                    ", Destination: "+destData.getType().name()+" '"+destData.getUuid()+"'");
        }

        strategy.copyAsync(srcData, destData, callback);
    }
View Full Code Here

    @Override
    public void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
            AsyncCompletionCallback<CopyCommandResult> callback) {

        DataMotionStrategy strategy = storageStrategyFactory.getDataMotionStrategy(volumeMap, srcHost, destHost);
        if (strategy == null) {
            List<String> volumeIds = new LinkedList<String>();
            for (final VolumeInfo volumeInfo : volumeMap.keySet()) {
                volumeIds.add(volumeInfo.getUuid());
            }

            throw new CloudRuntimeException("Can't find strategy to move data. "+
                    "Source Host: "+srcHost.getName()+", Destination Host: "+destHost.getName()+
                    ", Volume UUIDs: "+StringUtils.join(volumeIds, ","));
        }

        strategy.copyAsync(volumeMap, vmTo, srcHost, destHost, callback);
    }
View Full Code Here

        return provider;
    }

    @Bean
    public DataMotionStrategy dataMotionStrategy() {
        DataMotionStrategy strategy = new MockStorageMotionStrategy();
        return strategy;
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.engine.subsystem.api.storage.DataMotionStrategy

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.