Search in sources :

Example 1 with Builder

use of org.sonarsource.sonarlint.core.client.api.connected.ConnectedGlobalConfiguration.Builder in project sonarlint-core by SonarSource.

the class ConnectedSonarLintImpl method start.

@Override
public void start(ConnectedConfiguration requestConfig, StreamObserver<Void> response) {
    if (engine != null) {
        engine.stop(false);
        engine = null;
    }
    try {
        Builder builder = ConnectedGlobalConfiguration.builder();
        if (requestConfig.getHomePath() != null) {
            builder.setSonarLintUserHome(Paths.get(requestConfig.getHomePath()));
        }
        builder.setLogOutput(logOutput).setServerId(requestConfig.getStorageId());
        engine = new ConnectedSonarLintEngineImpl(builder.build());
        response.onNext(Void.newBuilder().build());
        response.onCompleted();
    } catch (Exception e) {
        LOGGER.error("Error registering", e);
        response.onError(e);
    }
}
Also used : Builder(org.sonarsource.sonarlint.core.client.api.connected.ConnectedGlobalConfiguration.Builder) ConnectedSonarLintEngineImpl(org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl)

Aggregations

ConnectedSonarLintEngineImpl (org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl)1 Builder (org.sonarsource.sonarlint.core.client.api.connected.ConnectedGlobalConfiguration.Builder)1