use of org.sonar.db.audit.model.ComponentNewValue in project sonarqube by SonarSource.
the class ComponentDao method setPrivateForRootComponentUuid.
public void setPrivateForRootComponentUuid(DbSession session, String projectUuid, boolean isPrivate, @Nullable String qualifier, String componentKey, String componentName) {
ComponentNewValue componentNewValue = new ComponentNewValue(projectUuid, componentName, componentKey, isPrivate, qualifier);
auditPersister.updateComponentVisibility(session, componentNewValue);
mapper(session).setPrivateForRootComponentUuid(projectUuid, isPrivate);
}
use of org.sonar.db.audit.model.ComponentNewValue in project sonarqube by SonarSource.
the class ComponentDao method update.
public void update(DbSession session, ComponentUpdateDto component, String qualifier) {
auditPersister.updateComponent(session, new ComponentNewValue(component.getUuid(), component.getBName(), component.getBKey(), component.isBEnabled(), component.getBPath(), qualifier));
mapper(session).update(component);
}
use of org.sonar.db.audit.model.ComponentNewValue in project sonarqube by SonarSource.
the class ProjectDao method update.
public void update(DbSession session, ProjectDto project) {
auditPersister.updateComponent(session, new ComponentNewValue(project));
mapper(session).update(project);
}
use of org.sonar.db.audit.model.ComponentNewValue in project sonarqube by SonarSource.
the class PurgeDao method deleteProject.
public void deleteProject(DbSession session, String uuid, String qualifier, String name, String key) {
PurgeProfiler profiler = new PurgeProfiler();
PurgeMapper purgeMapper = mapper(session);
PurgeCommands purgeCommands = new PurgeCommands(session, profiler, system2);
long start = System2.INSTANCE.now();
List<String> branchUuids = session.getMapper(BranchMapper.class).selectByProjectUuid(uuid).stream().map(BranchDto::getUuid).filter(branchUuid -> !uuid.equals(branchUuid)).collect(Collectors.toList());
branchUuids.forEach(id -> deleteRootComponent(id, purgeMapper, purgeCommands));
deleteRootComponent(uuid, purgeMapper, purgeCommands);
auditPersister.deleteComponent(session, new ComponentNewValue(uuid, name, key, qualifier));
logProfiling(profiler, start);
}
use of org.sonar.db.audit.model.ComponentNewValue in project sonarqube by SonarSource.
the class PurgeDaoWithAuditTest method delete_project_persist_audit_with_uuid_and_name.
@Test
public void delete_project_persist_audit_with_uuid_and_name() {
ComponentDto project = db.components().insertPrivateProject();
underTestWithPersister.deleteProject(dbSession, project.uuid(), project.qualifier(), project.name(), project.getKey());
verify(auditPersister).deleteComponent(any(DbSession.class), newValueCaptor.capture());
ComponentNewValue componentNewValue = newValueCaptor.getValue();
assertThat(componentNewValue).extracting(ComponentNewValue::getComponentUuid, ComponentNewValue::getComponentName, ComponentNewValue::getComponentKey, ComponentNewValue::getQualifier).containsExactly(project.uuid(), project.name(), project.getKey(), "TRK");
}
Aggregations