import org.sonar.server.rule.DeprecatedRulesDefinitionLoader;
import org.sonar.server.rule.RuleDefinitionsLoader;
import org.sonar.server.rule.index.RuleIndex;
-import org.sonar.server.search.EsSearchModule;
+import org.sonar.server.es.EsModule;
import org.sonar.server.setting.DatabaseSettingLoader;
import org.sonar.server.setting.DatabaseSettingsEnabler;
import org.sonar.server.setting.ThreadLocalSettings;
DbClient.class,
// Elasticsearch
- EsSearchModule.class,
+ EsModule.class,
// rules/qprofiles
RuleIndex.class,
COMPONENTS_IN_LEVEL_1_AT_CONSTRUCTION
+ 26 // level 1
+ 53 // content of DaoModule
- + 3 // content of EsSearchModule
+ + 3 // content of EsModule
+ 57 // content of CorePropertyDefinitions
+ 1 // StopFlagContainer
);
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.server.es;
+
+import org.sonar.core.platform.Module;
+import org.sonar.server.permission.index.AuthorizationTypeSupport;
+
+public class EsModule extends Module {
+ @Override
+ protected void configureModule() {
+ add(AuthorizationTypeSupport.class);
+ add(new EsClientProvider());
+ add(EsClientStopper.class);
+ }
+}
import org.sonar.server.app.ProcessCommandWrapperImpl;
import org.sonar.server.app.RestartFlagHolderImpl;
import org.sonar.server.app.WebServerProcessLogging;
+import org.sonar.server.es.EsModule;
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.platform.LogServerVersion;
import org.sonar.server.platform.Platform;
import org.sonar.server.platform.WebServerImpl;
import org.sonar.server.platform.db.EmbeddedDatabaseFactory;
import org.sonar.server.rule.index.RuleIndex;
-import org.sonar.server.search.EsSearchModule;
import org.sonar.server.setting.ThreadLocalSettings;
import org.sonar.server.user.SystemPasscodeImpl;
import org.sonar.server.user.ThreadLocalUserSession;
DaoModule.class,
// Elasticsearch
- EsSearchModule.class,
+ EsModule.class,
// rules/qprofiles
RuleIndex.class,
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ListMultimap;
import java.lang.annotation.Annotation;
-import java.util.Collection;
import java.util.Map;
import java.util.Set;
-import javax.annotation.Nullable;
import org.sonar.api.ExtensionProvider;
import org.sonar.api.Plugin;
import org.sonar.api.SonarRuntime;
import org.sonar.core.platform.PluginInfo;
import org.sonar.core.platform.PluginRepository;
-import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
/**
private final PluginRepository pluginRepository;
private final Set<Class<? extends Annotation>> supportedAnnotationTypes;
- protected ServerExtensionInstaller(SonarRuntime sonarRuntime, PluginRepository pluginRepository,
- @Nullable Collection<Class<? extends Annotation>> supportedAnnotationTypes) {
- checkArgument(supportedAnnotationTypes != null && !supportedAnnotationTypes.isEmpty(),
- "At least one supported annotation type must be specified");
- this.sonarRuntime = sonarRuntime;
- this.pluginRepository = pluginRepository;
- this.supportedAnnotationTypes = ImmutableSet.copyOf(supportedAnnotationTypes);
-
- }
-
protected ServerExtensionInstaller(SonarRuntime sonarRuntime, PluginRepository pluginRepository,
Class<? extends Annotation>... supportedAnnotationTypes) {
requireNonNull(supportedAnnotationTypes, "At least one supported annotation type must be specified");
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.search;
-
-import org.sonar.core.platform.Module;
-import org.sonar.server.es.EsClientProvider;
-import org.sonar.server.es.EsClientStopper;
-import org.sonar.server.permission.index.AuthorizationTypeSupport;
-
-public class EsSearchModule extends Module {
- @Override
- protected void configureModule() {
- add(AuthorizationTypeSupport.class);
- add(new EsClientProvider());
- add(EsClientStopper.class);
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.search;
-
-public class FacetValue {
-
- private final String key;
- private final long value;
-
- public FacetValue(String key, long value) {
- this.key = key;
- this.value = value;
- }
-
- public String getKey() {
- return key;
- }
-
- public long getValue() {
- return value;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- FacetValue that = (FacetValue) o;
- if (key == null) {
- return that.key == null;
- } else {
- return key.equals(that.key);
- }
- }
-
- @Override
- public int hashCode() {
- return key != null ? key.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return String.format("{%s=%d}", getKey(), getValue());
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.server.search;
-
-import javax.annotation.ParametersAreNonnullByDefault;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.server.es;
+
+import org.junit.Test;
+import org.sonar.core.platform.ComponentContainer;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class EsModuleTest {
+ @Test
+ public void verify_count_of_added_components() {
+ ComponentContainer container = new ComponentContainer();
+ new EsModule().configure(container);
+ assertThat(container.size()).isEqualTo(3 + 2);
+ }
+
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.search;
-
-import org.junit.Test;
-import org.sonar.core.platform.ComponentContainer;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class EsSearchModuleTest {
- @Test
- public void verify_count_of_added_components() {
- ComponentContainer container = new ComponentContainer();
- new EsSearchModule().configure(container);
- assertThat(container.size()).isEqualTo(3 + 2);
- }
-
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.search;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class FacetValueTest {
-
- @Test
- public void should_check_for_equality_on_key() {
- FacetValue facetValue = new FacetValue("polop", 42);
- assertThat(facetValue.equals(facetValue)).isTrue();
- assertThat(facetValue.equals(null)).isFalse();
- assertThat(facetValue.equals(new Object())).isFalse();
-
- assertThat(facetValue.equals(new FacetValue("polop", 666))).isTrue();
- assertThat(facetValue.equals(new FacetValue("palap", 42))).isFalse();
-
- FacetValue withNullKey = new FacetValue(null, 42);
- assertThat(facetValue.equals(withNullKey)).isFalse();
- assertThat(withNullKey.equals(withNullKey)).isTrue();
- assertThat(withNullKey.equals(facetValue)).isFalse();
- assertThat(withNullKey.equals(new FacetValue(null, 666))).isTrue();
- }
-
- @Test
- public void should_use_key_hashcode() {
- assertThat(new FacetValue(null, 42).hashCode()).isZero();
- String key = "polop";
- assertThat(new FacetValue(key, 666).hashCode()).isEqualTo(key.hashCode());
- }
-
- @Test
- public void test_toString() {
- assertThat(new FacetValue("polop", 42).toString()).isEqualTo("{polop=42}");
- }
-}