atg.deployment.repository
Class RepositoryDeploymentData

java.lang.Object
  extended by atg.deployment.repository.RepositoryDeploymentData
All Implemented Interfaces:
DeploymentData, java.lang.Cloneable

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

RepositoryDeploymentData is used to generate a list of repository items for deployment. To signal that an item is to be added or updated use the addItemForUpdate() method. To signal that an item is to be deleted, use the addItemForDelete() method. This class is NOT threadsafe and should only be used from a single thread.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String REPOSITORY_TYPE
           
 
Constructor Summary
RepositoryDeploymentData(Repository pSourceRepository, MutableRepository pDestRepository)
           
 
Method Summary
 void addItemForDelete(RepositoryItem pItem)
          Convenience method for adding an item for deletion from the destination repository
 void addItemForDelete(java.lang.String pItemDescriptorName, java.lang.String pItemId)
          Convenience method for adding an item for deletion from the destination repository
 void addItemForUpdate(RepositoryItem pItem)
          Convenience method for adding an item for update to the destination repository
 void addItemForUpdate(java.lang.String pItemDescriptorName, java.lang.String pItemId)
          Convenience method for adding an item for update to the destination repository
 void addNewItem(RepositoryItem pItem)
          Convenience method for adding a new item to the destination repository
 void addNewItem(java.lang.String pItemDescriptorName, java.lang.String pItemId)
          Convenience method for adding a new item to the destination repository
 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.
 MutableRepository getDestinationRepository()
           
 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
 Repository getSourceRepository()
           
 java.lang.Integer operationForItem(java.lang.String pItemDescriptorName, java.lang.String pItemId)
          Convenience method checking if an item is already in the DeploymentDatat
 void persist(MutableRepository pDeploymentRepository, MutableRepositoryItem pDeploymentItem)
          Writes the deploymentData item to the repository.
 
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


REPOSITORY_TYPE

public static final java.lang.String REPOSITORY_TYPE
See Also:
Constant Field Values
Constructor Detail

RepositoryDeploymentData

public RepositoryDeploymentData(Repository pSourceRepository,
                                MutableRepository pDestRepository)
Method Detail

getSourceRepository

public Repository getSourceRepository()
Returns:
Returns the value of the sourceRepository property.

getDestinationRepository

public MutableRepository getDestinationRepository()
Returns:
Returns the value of the destinationRepository property.

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

operationForItem

public java.lang.Integer operationForItem(java.lang.String pItemDescriptorName,
                                          java.lang.String pItemId)
                                   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

addNewItem

public void addNewItem(RepositoryItem pItem)
                throws RepositoryException
Convenience method for adding a new item to the destination repository

Throws:
RepositoryException - If the item's item descriptor cannot be accessed
java.lang.IllegalArgumentException - if the item is already in the deployment, if it is transient, or if it does not exist in the source repository

addNewItem

public void addNewItem(java.lang.String pItemDescriptorName,
                       java.lang.String pItemId)
                throws RepositoryException
Convenience method for adding a new item to the destination repository

Throws:
RepositoryException - If the item's item descriptor cannot be accessed
java.lang.IllegalArgumentException - if the item is already in the deployment, if it is transient, or if it does not exist in the source repository

addItemForUpdate

public void addItemForUpdate(RepositoryItem pItem)
                      throws RepositoryException
Convenience method for adding an item for update to the destination repository

Throws:
RepositoryException - If the item's item descriptor cannot be accessed
java.lang.IllegalArgumentException - if the item is already in the deployment, if it is transient, or if it does not exist in the source repository

addItemForUpdate

public void addItemForUpdate(java.lang.String pItemDescriptorName,
                             java.lang.String pItemId)
                      throws RepositoryException
Convenience method for adding an item for update to the destination repository

Throws:
RepositoryException - If the item's item descriptor cannot be accessed
java.lang.IllegalArgumentException - if the item is already in the deployment, if it is transient, or if it does not exist in the source repository

addItemForDelete

public void addItemForDelete(RepositoryItem pItem)
                      throws RepositoryException
Convenience method for adding an item for deletion from the destination repository

Throws:
RepositoryException - If the item's item descriptor cannot be accessed
java.lang.IllegalArgumentException - if the item is already in the deployment, if it is transient, or if it does not exist in the source repository

addItemForDelete

public void addItemForDelete(java.lang.String pItemDescriptorName,
                             java.lang.String pItemId)
                      throws RepositoryException
Convenience method for adding an item for deletion from the destination repository

Throws:
RepositoryException - If the item's item descriptor cannot be accessed
java.lang.IllegalArgumentException - if the item is already in the deployment, if it is transient, or if it does not exist in the source repository

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:
atg.deployment.DistributedDeploymentException - if an error occurs while persisting

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.

Versions are not handled here - we depend on the snapshot setting to get the appropriate versions for a rollback deployment.

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