Class RepositoryManagementServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.repository.internal.RepositoryManagementServiceInternalImpl
- All Implemented Interfaces:
RepositoryManagementServiceInternal
public class RepositoryManagementServiceInternalImpl
extends Object
implements RepositoryManagementServiceInternal
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.core.task.TaskExecutor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddRemote(String siteId, RemoteRepository remoteRepository) booleancancelFailedPull(String siteId) booleancommitResolution(String siteId, String commitMessage) getDiffForConflictedFile(String siteId, String path) getRepositoryStatus(String siteId) protected voidGit operation to add all modified filesprotected voidGit operation to commit all pending changesprotected voidGit operation to remove all missing filesbooleanisCorrupted(String siteId, GitRepositories repositoryType) Checks if a given Git repository is corruptedlistRemotes(String siteId, String sandboxBranch) pullFromRemote(String siteId, String remoteName, String remoteBranch, String mergeStrategy) booleanpushToRemote(String siteId, String remoteName, String remoteBranch, boolean force) booleanremoveRemote(String siteId, String remoteName) voidrepairCorrupted(String siteId, GitRepositories repositoryType) Repairs a corrupted Git repositorybooleanresolveConflict(String siteId, String path, String resolution) voidsetBatchSizeGitLog(int batchSizeGitLog) voidsetContentRepository(ContentRepository contentRepository) voidsetContentRepositoryV2(ContentRepository contentRepositoryV2) voidsetEncryptor(org.craftercms.commons.crypto.TextEncryptor encryptor) voidsetGeneralLockService(GeneralLockService generalLockService) voidsetGitRepositoryHelper(GitRepositoryHelper gitRepositoryHelper) voidsetNotificationService(NotificationService notificationService) voidsetRemoteRepositoryDao(RemoteRepositoryDAO remoteRepositoryDao) voidsetRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) voidsetRetryingRepositoryOperationFacade(RetryingRepositoryOperationFacade retryingRepositoryOperationFacade) voidsetSecurityService(SecurityService securityService) voidsetSiteService(SiteService siteService) voidsetStudioConfiguration(StudioConfiguration studioConfiguration) voidsetTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) voidsetUserServiceInternal(UserServiceInternal userServiceInternal) booleanunlockRepository(String siteId, GitRepositories repositoryType) Unlock local git repository
-
Field Details
-
taskExecutor
protected org.springframework.core.task.TaskExecutor taskExecutor
-
-
Constructor Details
-
RepositoryManagementServiceInternalImpl
public RepositoryManagementServiceInternalImpl()
-
-
Method Details
-
addRemote
public boolean addRemote(String siteId, RemoteRepository remoteRepository) throws ServiceLayerException, InvalidRemoteUrlException, RemoteRepositoryNotFoundException - Specified by:
addRemotein interfaceRepositoryManagementServiceInternal- Throws:
ServiceLayerExceptionInvalidRemoteUrlExceptionRemoteRepositoryNotFoundException
-
listRemotes
- Specified by:
listRemotesin interfaceRepositoryManagementServiceInternal
-
pullFromRemote
public MergeResult pullFromRemote(String siteId, String remoteName, String remoteBranch, String mergeStrategy) throws InvalidRemoteUrlException, ServiceLayerException, InvalidRemoteRepositoryCredentialsException, RemoteRepositoryNotFoundException -
pushToRemote
public boolean pushToRemote(String siteId, String remoteName, String remoteBranch, boolean force) throws ServiceLayerException, InvalidRemoteUrlException, InvalidRemoteRepositoryCredentialsException, RemoteRepositoryNotFoundException -
removeRemote
- Specified by:
removeRemotein interfaceRepositoryManagementServiceInternal- Throws:
RemoteNotRemovableException
-
getRepositoryStatus
- Specified by:
getRepositoryStatusin interfaceRepositoryManagementServiceInternal- Throws:
ServiceLayerException
-
resolveConflict
public boolean resolveConflict(String siteId, String path, String resolution) throws ServiceLayerException - Specified by:
resolveConflictin interfaceRepositoryManagementServiceInternal- Throws:
ServiceLayerException
-
getDiffForConflictedFile
public DiffConflictedFile getDiffForConflictedFile(String siteId, String path) throws ServiceLayerException - Specified by:
getDiffForConflictedFilein interfaceRepositoryManagementServiceInternal- Throws:
ServiceLayerException
-
commitResolution
- Specified by:
commitResolutionin interfaceRepositoryManagementServiceInternal- Throws:
ServiceLayerException
-
gitRemove
protected void gitRemove(org.eclipse.jgit.api.Git git, String siteId, Set<String> files) throws org.eclipse.jgit.api.errors.GitAPIException Git operation to remove all missing files- Parameters:
git- the git clientsiteId- the site identifierfiles- set of files to remove- Throws:
org.eclipse.jgit.api.errors.GitAPIException
-
gitAdd
protected void gitAdd(org.eclipse.jgit.api.Git git, String siteId, Set<String> files) throws org.eclipse.jgit.api.errors.GitAPIException Git operation to add all modified files- Parameters:
git- the git clientsiteId- the site identifierfiles- set of files to add- Throws:
org.eclipse.jgit.api.errors.GitAPIException
-
gitCommit
protected void gitCommit(org.eclipse.jgit.api.Git git, String siteId, String commitMessage) throws UserNotFoundException, ServiceLayerException, org.eclipse.jgit.api.errors.GitAPIException Git operation to commit all pending changes- Parameters:
git- the git clientsiteId- the site identifiercommitMessage- commit message- Throws:
UserNotFoundExceptionServiceLayerExceptionorg.eclipse.jgit.api.errors.GitAPIException
-
cancelFailedPull
- Specified by:
cancelFailedPullin interfaceRepositoryManagementServiceInternal- Throws:
ServiceLayerException
-
unlockRepository
Description copied from interface:RepositoryManagementServiceInternalUnlock local git repository- Specified by:
unlockRepositoryin interfaceRepositoryManagementServiceInternal- Parameters:
siteId- site identifier, if null or empty it is global repositoryrepositoryType- repository type (GLOBAL, SANDBOX, PUBLISHED)- Returns:
- true if successful
-
isCorrupted
public boolean isCorrupted(String siteId, GitRepositories repositoryType) throws ServiceLayerException Description copied from interface:RepositoryManagementServiceInternalChecks if a given Git repository is corrupted- Specified by:
isCorruptedin interfaceRepositoryManagementServiceInternal- Parameters:
siteId- the id of the siterepositoryType- the type of the repository- Returns:
- true if the repo is corrupted
- Throws:
ServiceLayerException- if there is any error checking the repository
-
repairCorrupted
public void repairCorrupted(String siteId, GitRepositories repositoryType) throws ServiceLayerException Description copied from interface:RepositoryManagementServiceInternalRepairs a corrupted Git repository- Specified by:
repairCorruptedin interfaceRepositoryManagementServiceInternal- Parameters:
siteId- the id of the siterepositoryType- the type of the repository- Throws:
ServiceLayerException- if there is any error repairing the repository
-
setRemoteRepositoryDao
-
setStudioConfiguration
-
setNotificationService
-
setSecurityService
-
setUserServiceInternal
-
setContentRepository
-
setEncryptor
public void setEncryptor(org.craftercms.commons.crypto.TextEncryptor encryptor) -
setGeneralLockService
-
setSiteService
-
setGitRepositoryHelper
-
setContentRepositoryV2
-
setBatchSizeGitLog
public void setBatchSizeGitLog(int batchSizeGitLog) -
setRetryingRepositoryOperationFacade
public void setRetryingRepositoryOperationFacade(RetryingRepositoryOperationFacade retryingRepositoryOperationFacade) -
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) -
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
-