com.zeroturnaround.liverebel.api.impl
Class UploadImpl

java.lang.Object
  extended by com.zeroturnaround.liverebel.api.impl.UploadImpl
All Implemented Interfaces:
Upload

public class UploadImpl
extends Object
implements Upload

Holds the configuration of the upload.

Author:
Igor Bljahhin

Constructor Summary
UploadImpl(CommandCenter center, RestConnection connection, JsonParser parser, boolean verbose, File file)
           
 
Method Summary
 UploadInfo execute()
          Uploads new version of an application.
protected  UploadInfo execute(File newVersion, com.zeroturnaround.liverebel.util.LiveRebelXml newLiveRebelXml, File oldVersion, String oldVersionId)
           
 String getApplicationId()
           
 File getBaseArchive()
           
 String getBaseVersionId()
           
 File getFile()
           
 String getVersionId()
           
protected  com.zeroturnaround.liverebel.util.diff.simple.VersionListing getVersionListing(String applicationId, String versionId)
           
 boolean isFull()
           
protected  com.zeroturnaround.liverebel.util.diff.simple.VersionListing loadLatestVersionListing(String applicationId)
           
protected  com.zeroturnaround.liverebel.util.diff.simple.VersionListing loadVersionListing(String applicationId, String versionId)
           
protected  UploadInfo performBinaryDiffUpload(File oldVersion, File newVersion, com.zeroturnaround.liverebel.util.LiveRebelXml newLiveRebelXml)
           
protected  UploadInfo performFullUpload(File newVersion)
           
protected  UploadInfo performSimpleDiffUpload(File newVersion, com.zeroturnaround.liverebel.util.LiveRebelXml newLiveRebelXml, com.zeroturnaround.liverebel.util.diff.simple.VersionListing oldVersionListing)
           
 Upload setApplicationId(String applicationId)
          Overrides the application id.
 Upload setBaseArchive(File baseArchive)
          Set the file on which the diff will be based.
 Upload setBaseVersionId(String baseVersionId)
          Set the version on which the diff will be based.
 Upload setFull(boolean full)
          Enables full upload, otherwise if base version or base archive is set, only differencies will be uploaded
 Upload setVersionId(String versionId)
          Override the version id.
protected  UploadInfo upload(String applicationId, String fromVersion, File diff)
           
protected  UploadInfo uploadSimpleDiff(String applicationId, String oldVersionId, String newVersionId, File diff)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadImpl

public UploadImpl(CommandCenter center,
                  RestConnection connection,
                  JsonParser parser,
                  boolean verbose,
                  File file)
Method Detail

execute

public UploadInfo execute()
                   throws DuplicationException,
                          IOException
Description copied from interface: Upload
Uploads new version of an application.

Specified by:
execute in interface Upload
Returns:
uploaded application version
Throws:
DuplicationException - if the given version already exists on the server
IOException

getApplicationId

public String getApplicationId()

getBaseArchive

public File getBaseArchive()

getBaseVersionId

public String getBaseVersionId()

getFile

public File getFile()

getVersionId

public String getVersionId()

isFull

public boolean isFull()

setApplicationId

public Upload setApplicationId(String applicationId)
Description copied from interface: Upload
Overrides the application id.

Specified by:
setApplicationId in interface Upload
Parameters:
applicationId - application identificator
Returns:
an object for configuring the upload

setBaseArchive

public Upload setBaseArchive(File baseArchive)
Description copied from interface: Upload
Set the file on which the diff will be based.

Specified by:
setBaseArchive in interface Upload
Parameters:
baseArchive - file on which this diff is based
Returns:
an object for configuring the upload

setBaseVersionId

public Upload setBaseVersionId(String baseVersionId)
Description copied from interface: Upload
Set the version on which the diff will be based.

Specified by:
setBaseVersionId in interface Upload
Parameters:
baseVersionId - version on which this diff is based
Returns:
an object for configuring the upload

setFull

public Upload setFull(boolean full)
Description copied from interface: Upload
Enables full upload, otherwise if base version or base archive is set, only differencies will be uploaded

Specified by:
setFull in interface Upload
Parameters:
full - send full archive
Returns:
an object for configuring the upload

setVersionId

public Upload setVersionId(String versionId)
Description copied from interface: Upload
Override the version id.

Specified by:
setVersionId in interface Upload
Parameters:
versionId - version identificator
Returns:
an object for configuring the upload

execute

protected UploadInfo execute(File newVersion,
                             com.zeroturnaround.liverebel.util.LiveRebelXml newLiveRebelXml,
                             File oldVersion,
                             String oldVersionId)
                      throws DuplicationException,
                             IOException
Throws:
DuplicationException
IOException

getVersionListing

protected com.zeroturnaround.liverebel.util.diff.simple.VersionListing getVersionListing(String applicationId,
                                                                                         String versionId)

loadLatestVersionListing

protected com.zeroturnaround.liverebel.util.diff.simple.VersionListing loadLatestVersionListing(String applicationId)

loadVersionListing

protected com.zeroturnaround.liverebel.util.diff.simple.VersionListing loadVersionListing(String applicationId,
                                                                                          String versionId)

performBinaryDiffUpload

protected UploadInfo performBinaryDiffUpload(File oldVersion,
                                             File newVersion,
                                             com.zeroturnaround.liverebel.util.LiveRebelXml newLiveRebelXml)
                                      throws IOException
Throws:
IOException

performFullUpload

protected UploadInfo performFullUpload(File newVersion)

performSimpleDiffUpload

protected UploadInfo performSimpleDiffUpload(File newVersion,
                                             com.zeroturnaround.liverebel.util.LiveRebelXml newLiveRebelXml,
                                             com.zeroturnaround.liverebel.util.diff.simple.VersionListing oldVersionListing)
                                      throws IOException
Throws:
IOException

upload

protected UploadInfo upload(String applicationId,
                            String fromVersion,
                            File diff)
                     throws DuplicationException
Throws:
DuplicationException

uploadSimpleDiff

protected UploadInfo uploadSimpleDiff(String applicationId,
                                      String oldVersionId,
                                      String newVersionId,
                                      File diff)
                               throws DuplicationException
Throws:
DuplicationException


Copyright © 2013. All Rights Reserved.