public UploadCommand(UploadCommand that) { template = that.template; url = that.url; installPath = that.installPath; checksum = that.getChecksum(); id = that.id; }
public UploadProgressCommand(UploadCommand cmd, String jobId, RequestType req) { super(cmd); this.jobId = jobId; this.setRequest(req); }
public UploadAnswer(String jobId, int uploadPct, String errorString, Upload.Status uploadStatus, String fileSystemPath, String installPath, long templateSize) { super(); this.jobId = jobId; this.uploadPct = uploadPct; this.errorString = errorString; this.details = errorString; this.uploadStatus = uploadStatus; this.uploadPath = fileSystemPath; this.installPath = fixPath(installPath); this.templateSize = templateSize; }
@Override public UploadAnswer handleUploadCommand(SecondaryStorageResource resource, UploadCommand cmd) { s_logger.warn("Handling the upload " + cmd.getInstallPath() + " " + cmd.getId()); if (cmd instanceof UploadProgressCommand) { return handleUploadProgressCmd((UploadProgressCommand)cmd); } String user = null; String password = null; String jobId = uploadPublicTemplate(cmd.getId(), cmd.getUrl(), cmd.getName(), cmd.getFormat(), cmd.getAccountId(), cmd.getDescription(), cmd.getChecksum(), cmd.getInstallPath(), user, password, cmd.getTemplateSizeInBytes()); sleep(); return new UploadAnswer(jobId, getUploadPct(jobId), getUploadError(jobId), getUploadStatus2(jobId), getUploadLocalPath(jobId), getInstallPath(jobId), getUploadTemplateSize(jobId)); }
private Answer execute(ListTemplateCommand cmd) { String root = getRootDir(); Map<String, TemplateProp> templateInfos = _dlMgr.gatherTemplateInfo(root); return new ListTemplateAnswer(((NfsTO)cmd.getDataStore()).getUrl(), templateInfos); }
public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool, String attachedVmName, Volume.Type volumeType, int timeout) { this(volumeId,volumePath,pool,timeout); this.attachedVmName = attachedVmName; this.volumeType = volumeType; this.setWait(timeout); }
public DownloadCommand(TemplateObjectTO template, String user, String passwd, Long maxDownloadSizeInBytes) { this(template, maxDownloadSizeInBytes); auth = new PasswordAuth(user, passwd); }
public DownloadAnswer(String jobId, int downloadPct, String errorString, Status downloadStatus, String fileSystemPath, String installPath, long templateSize, long templatePhySicalSize, String checkSum) { super(); this.jobId = jobId; this.downloadPct = downloadPct; this.errorString = errorString; this.details = errorString; this.downloadStatus = downloadStatus; this.downloadPath = fileSystemPath; this.installPath = fixPath(installPath); this.templateSize = templateSize; this.templatePhySicalSize = templatePhySicalSize; this.checkSum = checkSum; }
public ListVolumeAnswer(String secUrl, Map<Long, TemplateProp> templateInfos) { super(null, true, "success"); this.setSecUrl(secUrl); this.templateInfos = templateInfos; }
public ListTemplateAnswer(String secUrl, Map<String, TemplateProp> templateInfos) { super(null, true, "success"); this.setSecUrl(secUrl); this.templateInfos = templateInfos; }
public int getWaitInMillSeconds() { return getWait() * 1000; } }
public CopyVolumeCommand(long volumeId, String volumePath, StoragePool pool, String secondaryStorageURL, boolean toSecondaryStorage, int wait, boolean executeInSequence) { this.volumeId = volumeId; this.volumePath = volumePath; this.pool = new StorageFilerTO(pool); this.secondaryStorageURL = secondaryStorageURL; this.toSecondaryStorage = toSecondaryStorage; setWait(wait); this.executeInSequence = executeInSequence; }
public CreateVolumeOVACommand(String secUrl, String volPath, String volName, StoragePool pool, int wait) { this.secUrl = secUrl; this.volPath = volPath; this.volName = volName; this.pool = new StorageFilerTO(pool); setWait(wait); }
public PrimaryStorageDownloadCommand(final String name, final String url, final ImageFormat format, final long accountId, final StoragePool pool, final int wait) { super(name, url, format, accountId); poolId = pool.getId(); poolUuid = pool.getUuid(); primaryPool = new StorageFilerTO(pool); setWait(wait); }
@Test public final void testPrimaryStorageDownloadCommandHTTP() { PrimaryStorageDownloadCommand cmd = samplePrimaryDownloadCommand(); cmd.setUrl("http://s3-eu-west-1.amazonaws.com/cshv3eu/SmallDisk.vhdx"); corePrimaryStorageDownloadCommandTestCycle(cmd); }
public MigrateVolumeCommand(DataTO srcData, DataTO destData, Map<String, String> srcDetails, Map<String, String> destDetails, int timeout) { this.srcData = srcData; this.destData = destData; this.srcDetails = srcDetails; this.destDetails = destDetails; setWait(timeout); }
public void setInstallPath(String installPath) { this.installPath = fixPath(installPath); }
public void setCreds(String userName, String passwd) { auth = new PasswordAuth(userName, passwd); }
public void setInstallPath(String installPath) { this.installPath = fixPath(installPath); }
public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool, int timeout) { this.volumeId = volumeId; this.volumePath = volumePath; this.pool = new StorageFilerTO(pool); this.setWait(timeout); }