Class RepositoryManagementServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.repository.RepositoryManagementServiceImpl
- All Implemented Interfaces:
RepositoryManagementService
-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryManagementServiceImpl(RepositoryManagementServiceInternal repositoryManagementServiceInternal, SiteService siteService, AuditServiceInternal auditServiceInternal, SecurityService securityService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddRemote(String siteId, RemoteRepository remoteRepository) cancelFailedPull(String siteId) commitResolution(String siteId, String commitMessage) getDiffForConflictedFile(String siteId, String path) getRepositoryStatus(String siteId) booleanisCorrupted(String siteId, GitRepositories repositoryType) Checks if a given Git repository is corruptedlistRemotes(String siteId) pullFromRemote(String siteId, String remoteName, String remoteBranch, String mergeStrategy) booleanpushToRemote(String siteId, String remoteName, String remoteBranch, boolean force) voidrebuildDatabase(String siteId) booleanremoveRemote(String siteId, String remoteName) voidrepairCorrupted(String siteId, GitRepositories repositoryType) Repairs a corrupted Git repositoryresolveConflict(String siteId, String path, String resolution) booleanunlockRepository(String siteId, GitRepositories repositoryType) Unlock local git repository
-
Constructor Details
-
RepositoryManagementServiceImpl
@ConstructorProperties({"repositoryManagementServiceInternal","siteService","auditServiceInternal","securityService"}) public RepositoryManagementServiceImpl(RepositoryManagementServiceInternal repositoryManagementServiceInternal, SiteService siteService, AuditServiceInternal auditServiceInternal, SecurityService securityService)
-
-
Method Details
-
addRemote
public boolean addRemote(String siteId, RemoteRepository remoteRepository) throws ServiceLayerException, InvalidRemoteUrlException, RemoteRepositoryNotFoundException - Specified by:
addRemotein interfaceRepositoryManagementService- Throws:
ServiceLayerExceptionInvalidRemoteUrlExceptionRemoteRepositoryNotFoundException
-
listRemotes
- Specified by:
listRemotesin interfaceRepositoryManagementService- Throws:
ServiceLayerException
-
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 InvalidRemoteUrlException, ServiceLayerException, InvalidRemoteRepositoryCredentialsException, RemoteRepositoryNotFoundException -
rebuildDatabase
- Specified by:
rebuildDatabasein interfaceRepositoryManagementService- Throws:
SiteNotFoundException
-
removeRemote
public boolean removeRemote(String siteId, String remoteName) throws SiteNotFoundException, RemoteNotRemovableException - Specified by:
removeRemotein interfaceRepositoryManagementService- Throws:
SiteNotFoundExceptionRemoteNotRemovableException
-
getRepositoryStatus
- Specified by:
getRepositoryStatusin interfaceRepositoryManagementService- Throws:
ServiceLayerException
-
resolveConflict
public RepositoryStatus resolveConflict(String siteId, String path, String resolution) throws ServiceLayerException - Specified by:
resolveConflictin interfaceRepositoryManagementService- Throws:
ServiceLayerException
-
getDiffForConflictedFile
public DiffConflictedFile getDiffForConflictedFile(String siteId, String path) throws ServiceLayerException - Specified by:
getDiffForConflictedFilein interfaceRepositoryManagementService- Throws:
ServiceLayerException
-
commitResolution
public RepositoryStatus commitResolution(String siteId, String commitMessage) throws ServiceLayerException - Specified by:
commitResolutionin interfaceRepositoryManagementService- Throws:
ServiceLayerException
-
cancelFailedPull
- Specified by:
cancelFailedPullin interfaceRepositoryManagementService- Throws:
ServiceLayerException
-
unlockRepository
public boolean unlockRepository(String siteId, GitRepositories repositoryType) throws SiteNotFoundException Description copied from interface:RepositoryManagementServiceUnlock local git repository- Specified by:
unlockRepositoryin interfaceRepositoryManagementService- Parameters:
siteId- site identifier, if null or empty it is global repositoryrepositoryType- repository type (GLOBAL, SANDBOX, PUBLISHED)- Returns:
- true if successful
- Throws:
SiteNotFoundException
-
isCorrupted
public boolean isCorrupted(String siteId, GitRepositories repositoryType) throws ServiceLayerException Description copied from interface:RepositoryManagementServiceChecks if a given Git repository is corrupted- Specified by:
isCorruptedin interfaceRepositoryManagementService- 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:RepositoryManagementServiceRepairs a corrupted Git repository- Specified by:
repairCorruptedin interfaceRepositoryManagementService- Parameters:
siteId- the id of the siterepositoryType- the type of the repository- Throws:
ServiceLayerException- if there is any error repairing the repository
-