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 boolean
checkout(int tenantId, String localRepoPath)
Method inherited from ArtifactRepository for initializing checkoutboolean
checkout(int tenantId, String filePath, int depth)
Partial checkout with defined depth.void
cleanupAutoCheckout()
void
cleanupTenantContext(int tenantId)
removed tenant's information from the cacheboolean
commit(int tenantId, String localRepoPath)
Commits any changes in the local repository to the relevant remote repositoryList<org.wso2.carbon.deployment.synchronizer.util.RepositoryConfigParameter>
getParameters()
String
getRepositoryType()
Return the repository typevoid
init(int tenantId)
Called at tenant load to do initialization related to the tenantvoid
initAutoCheckout(boolean b)
boolean
update(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.DeploymentSynchronizerException
Called at tenant load to do initialization related to the tenant- Specified by:
init
in 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.DeploymentSynchronizerException
Commits any changes in the local repository to the relevant remote repository- Specified by:
commit
in 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.DeploymentSynchronizerException
Method inherited from ArtifactRepository for initializing checkout- Specified by:
checkout
in 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:
initAutoCheckout
in interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository
- Throws:
org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizerException
-
cleanupAutoCheckout
public void cleanupAutoCheckout()
- Specified by:
cleanupAutoCheckout
in interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository
-
getRepositoryType
public String getRepositoryType()
Return the repository type- Specified by:
getRepositoryType
in 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:
getParameters
in interfaceorg.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 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.DeploymentSynchronizerException
Partial update with defined depth.Currently not supported in GIT.- Specified by:
update
in 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:
cleanupTenantContext
in interfaceorg.wso2.carbon.deployment.synchronizer.ArtifactRepository
- Parameters:
tenantId
- tenant Id
-
-