]> source.dussan.org Git - sonarqube.git/blob
ed87df8c2ba8615cf834de85279834ea4d4b48c6
[sonarqube.git] /
1 package org.sonar.server.usergroups.ws;
2
3 import org.sonar.server.exceptions.BadRequestException;
4 import org.sonar.server.management.ManagedInstanceService;
5
6 public class ManagedInstanceChecker {
7
8   private final ManagedInstanceService managedInstanceService;
9
10   public ManagedInstanceChecker(ManagedInstanceService managedInstanceService) {
11     this.managedInstanceService = managedInstanceService;
12   }
13
14   public void checkInstanceIsNotExternallyManaged() {
15     BadRequestException.checkRequest(!managedInstanceService.isInstanceExternallyManaged(), "Operation not allowed when instance is externally managed.");
16   }
17 }