use of org.sonar.server.project.RekeyedProject in project sonarqube by SonarSource.
the class ComponentService method updateKey.
public void updateKey(DbSession dbSession, ProjectDto project, String newKey) {
userSession.checkProjectPermission(UserRole.ADMIN, project);
checkProjectKey(newKey);
dbClient.componentKeyUpdaterDao().updateKey(dbSession, project.getUuid(), newKey);
projectIndexers.commitAndIndexProjects(dbSession, singletonList(project), ProjectIndexer.Cause.PROJECT_KEY_UPDATE);
Project newProject = new Project(project.getUuid(), newKey, project.getName(), project.getDescription(), project.getTags());
projectLifeCycleListeners.onProjectsRekeyed(singleton(new RekeyedProject(newProject, project.getKey())));
}
Aggregations