org.wso2.carbon.deployment.synchronizer
Interface ArtifactRepository


public interface ArtifactRepository

Represents a remote repository instance. The DeploymentSynchronizer interacts with the remote repository through this interface.


Method Summary
 boolean checkout(int tenantId, String filePath)
          Checkout all or updated artifacts from the remote repository to the local file system
 boolean checkout(int tenantId, String filePath, int depth)
          Checkout artifacts from the remote repository with given depth to the local file system
 void cleanupAutoCheckout()
          Clean up any actions taken during initializing auto checkout
 void cleanupTenantContext(int tenantId)
          Cleanup the cached tenant context for the tenant specified by tenantId
 boolean commit(int tenantId, String filePath)
          Commit the artifacts in the local repository to the remote repository
 List<RepositoryConfigParameter> getParameters()
          Get the list of configuration parameters specific for each Repository.
 String getRepositoryType()
          Get the Repository Type of the Synchronizer
 void init(int tenantId)
          Initializes the remote artifact repository and prepare to synchronize the local repository against it.
 void initAutoCheckout(boolean useEventing)
          Setup the remote repository for auto checkouts
 boolean update(int tenantId, String rootPath, String filePathToUpdate, int depth)
          Invoke the update operation on the specified file in the repository, with given depth
 

Method Detail

init

void init(int tenantId)
          throws DeploymentSynchronizerException
Initializes the remote artifact repository and prepare to synchronize the local repository against it.

Parameters:
tenantId - ID of the tenant to which the synchronizer/repository belongs
Throws:
DeploymentSynchronizerException - If an error occurs while initializing the repository

commit

boolean commit(int tenantId,
               String filePath)
               throws DeploymentSynchronizerException
Commit the artifacts in the local repository to the remote repository

Parameters:
tenantId - tenant Id
filePath - File path of the local repository
Returns:
true if file changes were committed, false otherwise
Throws:
DeploymentSynchronizerException - on error

checkout

boolean checkout(int tenantId,
                 String filePath)
                 throws DeploymentSynchronizerException
Checkout all or updated artifacts from the remote repository to the local file system

Parameters:
tenantId - tenant Id
filePath - File path of the local repository
Returns:
true if files were checked out or updated, false otherwise
Throws:
DeploymentSynchronizerException - on error

initAutoCheckout

void initAutoCheckout(boolean useEventing)
                      throws DeploymentSynchronizerException
Setup the remote repository for auto checkouts

Parameters:
useEventing - If eventing based auto checkout has been requested
Throws:
DeploymentSynchronizerException - on error

cleanupAutoCheckout

void cleanupAutoCheckout()
Clean up any actions taken during initializing auto checkout


getRepositoryType

String getRepositoryType()
Get the Repository Type of the Synchronizer

Returns:
The Repository Type

getParameters

List<RepositoryConfigParameter> getParameters()
Get the list of configuration parameters specific for each Repository.

Returns:
List of RepositoryConfigParameters

checkout

boolean checkout(int tenantId,
                 String filePath,
                 int depth)
                 throws DeploymentSynchronizerException
Checkout artifacts from the remote repository with given depth to the local file system

Parameters:
tenantId - tenant Id
filePath - File path of the local repository
depth - - given depth to get the update
Returns:
true if files were checked out or updated, false otherwise
Throws:
DeploymentSynchronizerException - on error

update

boolean update(int tenantId,
               String rootPath,
               String filePathToUpdate,
               int depth)
               throws DeploymentSynchronizerException
Invoke the update operation on the specified file in the repository, with given depth

Parameters:
tenantId - tenant Id
rootPath - - root path of the repository of which the dep-sychronizer is registered
filePathToUpdate - - location of the file in the repository
depth - Depth given to update, (eg 0 - empty, 3 - infinite)
Returns:
true if files were updated, false otherwise
Throws:
DeploymentSynchronizerException - on error

cleanupTenantContext

void cleanupTenantContext(int tenantId)
Cleanup the cached tenant context for the tenant specified by tenantId

Parameters:
tenantId - tenant Id


Copyright © 2015 WSO2. All rights reserved.