Exemple #1
0
 public void updateUserPipelineSelections(
     String id, Long userId, CaseInsensitiveString pipelineToAdd) {
   PipelineSelections currentSelections = findOrCreateCurrentPipelineSelectionsFor(id, userId);
   if (!currentSelections.isBlacklist()) {
     currentSelections.addPipelineToSelections(pipelineToAdd);
     pipelineRepository.saveSelectedPipelines(currentSelections);
   }
 }
Exemple #2
0
  public long persistSelectedPipelines(
      String id, Long userId, List<String> selectedPipelines, boolean isBlacklist) {
    PipelineSelections pipelineSelections = findOrCreateCurrentPipelineSelectionsFor(id, userId);

    if (isBlacklist) {
      List<String> unselectedPipelines = invertSelections(selectedPipelines);
      pipelineSelections.update(unselectedPipelines, clock.currentTime(), userId, isBlacklist);
    } else {
      pipelineSelections.update(selectedPipelines, clock.currentTime(), userId, isBlacklist);
    }

    return pipelineRepository.saveSelectedPipelines(pipelineSelections);
  }