atg.deployment.file
Class FileDeploymentData

java.lang.Object
  extended by atg.deployment.file.FileDeploymentData
All Implemented Interfaces:
DeploymentData, java.lang.Cloneable

public class FileDeploymentData
extends java.lang.Object
implements DeploymentData, java.lang.Cloneable

FileDeploymentData is used to generate a list of files for deployment. To signal that a file is to be added use the addNewFile() method. To signal that a file is to be updated use the addFileForUpdate() method. To signal that an item is to be deleted, use the addFileForDelete() method. This class is NOT threadsafe and should not be used by multiple threads.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String FILE_TYPE
           
 java.util.LinkedHashMap mFileURIsToAddInput
           
 java.util.LinkedHashMap mFileURIsToAddRollbackInput
           
 java.util.LinkedHashMap mFileURIsToDeleteInput
           
 java.util.LinkedHashMap mFileURIsToDeleteRollbackInput
           
 java.util.LinkedHashMap mFileURIsToUpdateInput
           
 java.util.LinkedHashMap mFileURIsToUpdateRollbackInput
           
static java.lang.String PATH_PREFIX
           
static java.lang.String URI_PREFIX
           
 
Constructor Summary
FileDeploymentData(VirtualFileSystem pSourceFileSystem, FileDeploymentDestination pDestination)
           
FileDeploymentData(VirtualFileSystem pSourceFileSystem, FileDeploymentDestination pDestination, java.lang.String pDestinationFileSystemPath)
           
 
Method Summary
 void addFileForDelete(VirtualFile pFile)
          Convenience method for adding a file for deletion from the destination
 void addFileForDelete(VirtualFile pFile, java.lang.String pForwardSourceDevelopmentLineID, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for deletion from the destination
 void addFileForDeleteByFileString(java.lang.String pFileString)
          Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.
 void addFileForDeleteByFileString(java.lang.String pFileString, java.lang.String pForwardSourceDevelopmentLineID, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.
 void addFileForDeleteByPath(java.lang.String pFilePath)
          Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.
 void addFileForDeleteByPath(java.lang.String pFilePath, java.lang.String pForwardSourceDevelopmentLine, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.
 void addFileForDeleteByURI(java.lang.String pFileURI)
          Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.
 void addFileForDeleteByURI(java.lang.String pFileURI, java.lang.String pForwardSourceDevelopmentLine, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.
 void addFileForUpdate(VirtualFile pFile)
          Convenience method for adding a file for update to the destination
 void addFileForUpdate(VirtualFile pFile, java.lang.String pForwardSourceDevelopmentLineID, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for update to the destination
 void addFileForUpdateByFileString(java.lang.String pFileString)
          Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.
 void addFileForUpdateByFileString(java.lang.String pFileString, java.lang.String pForwardSourceDevelopmentLineID, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.
 void addFileForUpdateByPath(java.lang.String pFilePath)
          Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.
 void addFileForUpdateByPath(java.lang.String pFilePath, java.lang.String pForwardSourceDevelopmentLine, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.
 void addFileForUpdateByURI(java.lang.String pFileURI)
          Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.
 void addFileForUpdateByURI(java.lang.String pFileURI, java.lang.String pForwardSourceDevelopmentLine, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.
 void addNewFile(VirtualFile pFile)
          Convenience method for adding a new file to the deployment destination
 void addNewFile(VirtualFile pFile, java.lang.String pForwardSourceDevelopmentLineID, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a new file to the deployment destination
 void addNewFileByFileString(java.lang.String pFileString)
          Convenience method for adding a new file to the deployment destination.
 void addNewFileByFileString(java.lang.String pFileString, java.lang.String pForwardSourceDevelopmentLineID, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a new file to the deployment destination.
 void addNewFileByPath(java.lang.String pFilePath)
          Convenience method for adding a new file to the deployment destination.
 void addNewFileByPath(java.lang.String pFilePath, java.lang.String pForwardSourceDevelopmentLine, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a new file to the deployment destination.
 void addNewFileByURI(java.lang.String pFileURI)
          Convenience method for adding a new file to the deployment destination.
 void addNewFileByURI(java.lang.String pFileURI, java.lang.String pForwardSourceDevelopmentLine, java.lang.String pRollbackSourceDevelopmentLineID)
          Convenience method for adding a new file to the deployment destination.
 java.lang.Object clone()
          Returns a clone of this object.
 void convertToRollbackData()
          Converts a particular DeploymentData from a list of items modified in a deployment to a rollback for that deployment.
 FileDeploymentDestination getDestination()
           
 java.lang.String getDestinationFileSystemPath()
           
 int getMarkerCount()
          Returns the number of markers for deployment
 java.util.Collection getNextSetOfMarkers(int pCurrentIndex, int pBatchSize)
          Returns some set of markers, starting at pCurrentIndex, of a number up to pBatchsize.
 RepositoryItem getRepositoryItem()
          Returns the deployment data repository item
 VirtualFileSystem getSourceFileSystem()
           
 java.lang.Integer operationForItemByPath(java.lang.String pFilePath)
          Convenience method checking if an item is already in the DeploymentDatat
 java.lang.Integer[] operationForItemByURI(java.lang.String pFileURI)
          Convenience method checking if an item is already in the DeploymentDatat
 void persist(MutableRepository pDeploymentRepository, MutableRepositoryItem pDeploymentItem)
          Writes the deploymentData item to the repository.
 void setDestination(FileDeploymentDestination pDestination)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


FILE_TYPE

public static final java.lang.String FILE_TYPE
See Also:
Constant Field Values

URI_PREFIX

public static final java.lang.String URI_PREFIX
See Also:
Constant Field Values

PATH_PREFIX

public static final java.lang.String PATH_PREFIX
See Also:
Constant Field Values

mFileURIsToAddInput

public java.util.LinkedHashMap mFileURIsToAddInput

mFileURIsToUpdateInput

public java.util.LinkedHashMap mFileURIsToUpdateInput

mFileURIsToDeleteInput

public java.util.LinkedHashMap mFileURIsToDeleteInput

mFileURIsToAddRollbackInput

public java.util.LinkedHashMap mFileURIsToAddRollbackInput

mFileURIsToUpdateRollbackInput

public java.util.LinkedHashMap mFileURIsToUpdateRollbackInput

mFileURIsToDeleteRollbackInput

public java.util.LinkedHashMap mFileURIsToDeleteRollbackInput
Constructor Detail

FileDeploymentData

public FileDeploymentData(VirtualFileSystem pSourceFileSystem,
                          FileDeploymentDestination pDestination)

FileDeploymentData

public FileDeploymentData(VirtualFileSystem pSourceFileSystem,
                          FileDeploymentDestination pDestination,
                          java.lang.String pDestinationFileSystemPath)
Method Detail

getNextSetOfMarkers

public java.util.Collection getNextSetOfMarkers(int pCurrentIndex,
                                                int pBatchSize)
Returns some set of markers, starting at pCurrentIndex, of a number up to pBatchsize. Returns ArrayLists.

Specified by:
getNextSetOfMarkers in interface DeploymentData

getSourceFileSystem

public VirtualFileSystem getSourceFileSystem()
Returns:
Returns the value of the sourceFileSystem property.

getDestinationFileSystemPath

public java.lang.String getDestinationFileSystemPath()
Returns:
Returns the value of the DestinationFileSystemPath property.

getDestination

public FileDeploymentDestination getDestination()
Returns:
Returns the value of the Destination property.

setDestination

public void setDestination(FileDeploymentDestination pDestination)
Parameters:
pDestination - Sets the property value of the Destination property.

operationForItemByURI

public java.lang.Integer[] operationForItemByURI(java.lang.String pFileURI)
                                          throws RepositoryException
Convenience method checking if an item is already in the DeploymentDatat

Returns:
null if the item is not in the DD. Otherwise, an integer representation of the operation for the item, based on the Marker constants.
Throws:
RepositoryException

operationForItemByPath

public java.lang.Integer operationForItemByPath(java.lang.String pFilePath)
                                         throws RepositoryException
Convenience method checking if an item is already in the DeploymentDatat

Returns:
null if the item is not in the DD. Otherwise, an integer representation of the operation for the item, based on the Marker constants.
Throws:
RepositoryException

addNewFileByURI

public void addNewFileByURI(java.lang.String pFileURI)
Convenience method for adding a new file to the deployment destination. This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFileByURI

public void addNewFileByURI(java.lang.String pFileURI,
                            java.lang.String pForwardSourceDevelopmentLine,
                            java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a new file to the deployment destination. This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdateByURI

public void addFileForUpdateByURI(java.lang.String pFileURI)
Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdateByURI

public void addFileForUpdateByURI(java.lang.String pFileURI,
                                  java.lang.String pForwardSourceDevelopmentLine,
                                  java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDeleteByURI

public void addFileForDeleteByURI(java.lang.String pFileURI)
Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDeleteByURI

public void addFileForDeleteByURI(java.lang.String pFileURI,
                                  java.lang.String pForwardSourceDevelopmentLine,
                                  java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFileByPath

public void addNewFileByPath(java.lang.String pFilePath)
Convenience method for adding a new file to the deployment destination. This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFileByPath

public void addNewFileByPath(java.lang.String pFilePath,
                             java.lang.String pForwardSourceDevelopmentLine,
                             java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a new file to the deployment destination. This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdateByPath

public void addFileForUpdateByPath(java.lang.String pFilePath)
Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdateByPath

public void addFileForUpdateByPath(java.lang.String pFilePath,
                                   java.lang.String pForwardSourceDevelopmentLine,
                                   java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDeleteByPath

public void addFileForDeleteByPath(java.lang.String pFilePath)
Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDeleteByPath

public void addFileForDeleteByPath(java.lang.String pFilePath,
                                   java.lang.String pForwardSourceDevelopmentLine,
                                   java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFileByFileString

public void addNewFileByFileString(java.lang.String pFileString)
Convenience method for adding a new file to the deployment destination. This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFileByFileString

public void addNewFileByFileString(java.lang.String pFileString,
                                   java.lang.String pForwardSourceDevelopmentLineID,
                                   java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a new file to the deployment destination. This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdateByFileString

public void addFileForUpdateByFileString(java.lang.String pFileString)
Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdateByFileString

public void addFileForUpdateByFileString(java.lang.String pFileString,
                                         java.lang.String pForwardSourceDevelopmentLineID,
                                         java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for update to the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDeleteByFileString

public void addFileForDeleteByFileString(java.lang.String pFileString)
Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDeleteByFileString

public void addFileForDeleteByFileString(java.lang.String pFileString,
                                         java.lang.String pForwardSourceDevelopmentLineID,
                                         java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for deletion from the destination This method does not validate the existence of the file in the source VFS.

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFile

public void addNewFile(VirtualFile pFile)
Convenience method for adding a new file to the deployment destination

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addNewFile

public void addNewFile(VirtualFile pFile,
                       java.lang.String pForwardSourceDevelopmentLineID,
                       java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a new file to the deployment destination

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdate

public void addFileForUpdate(VirtualFile pFile)
Convenience method for adding a file for update to the destination

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForUpdate

public void addFileForUpdate(VirtualFile pFile,
                             java.lang.String pForwardSourceDevelopmentLineID,
                             java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for update to the destination

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDelete

public void addFileForDelete(VirtualFile pFile)
Convenience method for adding a file for deletion from the destination

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

addFileForDelete

public void addFileForDelete(VirtualFile pFile,
                             java.lang.String pForwardSourceDevelopmentLineID,
                             java.lang.String pRollbackSourceDevelopmentLineID)
Convenience method for adding a file for deletion from the destination

Throws:
java.lang.IllegalArgumentException - if the file is already in the deployment or file file does not exist in the source file system

persist

public void persist(MutableRepository pDeploymentRepository,
                    MutableRepositoryItem pDeploymentItem)
             throws atg.deployment.DistributedDeploymentException
Writes the deploymentData item to the repository. Note that this does not persist the markers.

Specified by:
persist in interface DeploymentData
Throws:
RepositoryException - if an error occurs while persisting
atg.deployment.DistributedDeploymentException

getRepositoryItem

public RepositoryItem getRepositoryItem()
Returns the deployment data repository item

Specified by:
getRepositoryItem in interface DeploymentData
Returns:
the deployment data repository item

getMarkerCount

public int getMarkerCount()
Returns the number of markers for deployment

Specified by:
getMarkerCount in interface DeploymentData

convertToRollbackData

public void convertToRollbackData()
Converts a particular DeploymentData from a list of items modified in a deployment to a rollback for that deployment. Note that this changes the internal state. The specific changes are:

add -> delete
update -> update
delete -> add

Note that this function is reversible - calling it twice is the same as not calling it.

Specified by:
convertToRollbackData in interface DeploymentData

clone

public java.lang.Object clone()
Returns a clone of this object.

Specified by:
clone in interface DeploymentData
Overrides:
clone in class java.lang.Object