Class GitBasedArtifactRepository

  • All Implemented Interfaces:
    org.wso2.carbon.deployment.synchronizer.ArtifactRepository

    public class GitBasedArtifactRepository
    extends Object
    implements org.wso2.carbon.deployment.synchronizer.ArtifactRepository
    Git based artifact repository
    • Constructor Detail

      • GitBasedArtifactRepository

        public GitBasedArtifactRepository()
    • Method Detail

      • init

        public void init​(int tenantId)
                  throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
        Called at tenant load to do initialization related to the tenant
        Specified by:
        init in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Parameters:
        tenantId - id of the tenant
        Throws:
        org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException - in case of an error
      • commit

        public boolean commit​(int tenantId,
                              String localRepoPath)
                       throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
        Commits any changes in the local repository to the relevant remote repository
        Specified by:
        commit in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Parameters:
        localRepoPath - tenant's local repository path
        Returns:
        true if commit is successful, else false
        Throws:
        org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException - in case of an error
      • checkout

        public boolean checkout​(int tenantId,
                                String localRepoPath)
                         throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
        Method inherited from ArtifactRepository for initializing checkout
        Specified by:
        checkout in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Parameters:
        localRepoPath - local repository path of the tenant
        Returns:
        true if success, else false
        Throws:
        org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException - if an error occurs
      • initAutoCheckout

        public void initAutoCheckout​(boolean b)
                              throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
        Specified by:
        initAutoCheckout in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Throws:
        org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
      • cleanupAutoCheckout

        public void cleanupAutoCheckout()
        Specified by:
        cleanupAutoCheckout in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
      • getRepositoryType

        public String getRepositoryType()
        Return the repository type
        Specified by:
        getRepositoryType in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Returns:
        repository type, i.e. git
      • getParameters

        public List<org.wso2.carbon.deployment.synchronizer.util.RepositoryConfigParameter> getParameters()
        Specified by:
        getParameters in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
      • checkout

        public boolean checkout​(int tenantId,
                                String filePath,
                                int depth)
                         throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
        Partial checkout with defined depth. Currently not supported in GIT.
        Specified by:
        checkout in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Parameters:
        tenantId - tenant id
        filePath - local repository path
        depth - depth to checkout (0 - 3)
        Returns:
        if success true, else false
        Throws:
        org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException - if an error occurs
      • update

        public boolean update​(int tenantId,
                              String rootPath,
                              String filePath,
                              int depth)
                       throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
        Partial update with defined depth.Currently not supported in GIT.
        Specified by:
        update in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Parameters:
        tenantId - tenant Id
        rootPath - root path to the local repository
        filePath - path to sub directory to update
        depth - depth to update (0 - 3)
        Returns:
        if success true, else false
        Throws:
        org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException - if an error occurs
      • cleanupTenantContext

        public void cleanupTenantContext​(int tenantId)
        removed tenant's information from the cache
        Specified by:
        cleanupTenantContext in interface org.wso2.carbon.deployment.synchronizer.ArtifactRepository
        Parameters:
        tenantId - tenant Id