org.wso2.carbon.deployment.synchronizer.registry
Class RegistryBasedArtifactRepository

java.lang.Object
  extended by org.wso2.carbon.deployment.synchronizer.registry.RegistryBasedArtifactRepository
All Implemented Interfaces:
ArtifactRepository

public class RegistryBasedArtifactRepository
extends Object
implements ArtifactRepository

Use this class in conjunction with the DeploymentSynchronizer to synchronize a file system repository against a repository stored in the registry.


Constructor Summary
RegistryBasedArtifactRepository()
           
RegistryBasedArtifactRepository(org.wso2.carbon.registry.core.session.UserRegistry registry, String registryPath, String basePath)
           
 
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
 boolean equals(Object o)
           
 List<RepositoryConfigParameter> getParameters()
          Get the list of configuration parameters specific for each Repository.
 String getRepositoryType()
          Get the Repository Type of the Synchronizer
 int hashCode()
           
 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 filePath, int depth)
          Invoke the update operation on the specified file in the repository, with given depth
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryBasedArtifactRepository

public RegistryBasedArtifactRepository()

RegistryBasedArtifactRepository

public RegistryBasedArtifactRepository(org.wso2.carbon.registry.core.session.UserRegistry registry,
                                       String registryPath,
                                       String basePath)
Method Detail

init

public void init(int tenantId)
          throws DeploymentSynchronizerException
Description copied from interface: ArtifactRepository
Initializes the remote artifact repository and prepare to synchronize the local repository against it.

Specified by:
init in interface ArtifactRepository
Parameters:
tenantId - ID of the tenant to which the synchronizer/repository belongs
Throws:
DeploymentSynchronizerException - If an error occurs while initializing the repository

commit

public boolean commit(int tenantId,
                      String filePath)
               throws DeploymentSynchronizerException
Description copied from interface: ArtifactRepository
Commit the artifacts in the local repository to the remote repository

Specified by:
commit in interface ArtifactRepository
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

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

Specified by:
checkout in interface ArtifactRepository
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

public void initAutoCheckout(boolean useEventing)
                      throws DeploymentSynchronizerException
Description copied from interface: ArtifactRepository
Setup the remote repository for auto checkouts

Specified by:
initAutoCheckout in interface ArtifactRepository
Parameters:
useEventing - If eventing based auto checkout has been requested
Throws:
DeploymentSynchronizerException - on error

cleanupAutoCheckout

public void cleanupAutoCheckout()
Description copied from interface: ArtifactRepository
Clean up any actions taken during initializing auto checkout

Specified by:
cleanupAutoCheckout in interface ArtifactRepository

getRepositoryType

public String getRepositoryType()
Description copied from interface: ArtifactRepository
Get the Repository Type of the Synchronizer

Specified by:
getRepositoryType in interface ArtifactRepository
Returns:
The Repository Type

getParameters

public List<RepositoryConfigParameter> getParameters()
Description copied from interface: ArtifactRepository
Get the list of configuration parameters specific for each Repository.

Specified by:
getParameters in interface ArtifactRepository
Returns:
List of RepositoryConfigParameters

checkout

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

Specified by:
checkout in interface ArtifactRepository
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

public boolean update(int tenantId,
                      String rootPath,
                      String filePath,
                      int depth)
               throws DeploymentSynchronizerException
Description copied from interface: ArtifactRepository
Invoke the update operation on the specified file in the repository, with given depth

Specified by:
update in interface ArtifactRepository
Parameters:
tenantId - tenant Id
rootPath - - root path of the repository of which the dep-sychronizer is registered
filePath - - 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

public void cleanupTenantContext(int tenantId)
Description copied from interface: ArtifactRepository
Cleanup the cached tenant context for the tenant specified by tenantId

Specified by:
cleanupTenantContext in interface ArtifactRepository
Parameters:
tenantId - tenant Id

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2015 WSO2. All rights reserved.