Search in sources :

Example 1 with RekeyedProject

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())));
}
Also used : RekeyedProject(org.sonar.server.project.RekeyedProject) Project(org.sonar.server.project.Project) RekeyedProject(org.sonar.server.project.RekeyedProject)

Aggregations

Project (org.sonar.server.project.Project)1 RekeyedProject (org.sonar.server.project.RekeyedProject)1