Class GitBasedArtifactRepository
- java.lang.Object
-
- org.wso2.carbon.deployment.synchronizer.git.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 Summary
Constructors Constructor Description GitBasedArtifactRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckout(int tenantId, String localRepoPath)Method inherited from ArtifactRepository for initializing checkoutbooleancheckout(int tenantId, String filePath, int depth)Partial checkout with defined depth.voidcleanupAutoCheckout()voidcleanupTenantContext(int tenantId)removed tenant's information from the cachebooleancommit(int tenantId, String localRepoPath)Commits any changes in the local repository to the relevant remote repositoryList<org.wso2.carbon.deployment.synchronizer.util.RepositoryConfigParameter>getParameters()StringgetRepositoryType()Return the repository typevoidinit(int tenantId)Called at tenant load to do initialization related to the tenantvoidinitAutoCheckout(boolean b)booleanupdate(int tenantId, String rootPath, String filePath, int depth)Partial update with defined depth.Currently not supported in GIT.
-
-
-
Method Detail
-
init
public void init(int tenantId) throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerExceptionCalled at tenant load to do initialization related to the tenant- Specified by:
initin interfaceorg.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.DeploymentSynchronizerExceptionCommits any changes in the local repository to the relevant remote repository- Specified by:
commitin interfaceorg.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.DeploymentSynchronizerExceptionMethod inherited from ArtifactRepository for initializing checkout- Specified by:
checkoutin interfaceorg.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:
initAutoCheckoutin interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository- Throws:
org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
-
cleanupAutoCheckout
public void cleanupAutoCheckout()
- Specified by:
cleanupAutoCheckoutin interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository
-
getRepositoryType
public String getRepositoryType()
Return the repository type- Specified by:
getRepositoryTypein interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository- Returns:
- repository type, i.e. git
-
getParameters
public List<org.wso2.carbon.deployment.synchronizer.util.RepositoryConfigParameter> getParameters()
- Specified by:
getParametersin interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository
-
checkout
public boolean checkout(int tenantId, String filePath, int depth) throws org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerExceptionPartial checkout with defined depth. Currently not supported in GIT.- Specified by:
checkoutin interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository- Parameters:
tenantId- tenant idfilePath- local repository pathdepth- 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.DeploymentSynchronizerExceptionPartial update with defined depth.Currently not supported in GIT.- Specified by:
updatein interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository- Parameters:
tenantId- tenant IdrootPath- root path to the local repositoryfilePath- path to sub directory to updatedepth- 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:
cleanupTenantContextin interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository- Parameters:
tenantId- tenant Id
-
-