]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaws - removed unused class
authorStephane Gamard <stephane.gamard@searchbox.com>
Fri, 16 May 2014 14:31:26 +0000 (16:31 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Mon, 19 May 2014 05:44:53 +0000 (07:44 +0200)
sonar-server/src/main/java/org/sonar/server/search/NestedIndex.java [deleted file]

diff --git a/sonar-server/src/main/java/org/sonar/server/search/NestedIndex.java b/sonar-server/src/main/java/org/sonar/server/search/NestedIndex.java
deleted file mode 100644 (file)
index 47c20d8..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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.elasticsearch.action.update.UpdateRequest;
-import org.elasticsearch.client.Client;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.sonar.core.cluster.WorkQueue;
-import org.sonar.core.persistence.Dto;
-
-import java.io.Serializable;
-
-public abstract class NestedIndex<D, E extends Dto<K>, K extends Serializable>
-  extends BaseIndex<D, E, K> {
-
-  private static final Logger LOG = LoggerFactory.getLogger(NestedIndex.class);
-
-  protected BaseIndex<?, ?, ?> parentIndex;
-
-  public NestedIndex(IndexDefinition indexDefinition, BaseNormalizer<E, K> normalizer, WorkQueue workQueue,
-                     BaseIndex<?, ?, ?> index) {
-    super(indexDefinition, normalizer, workQueue, index.getNode());
-    this.parentIndex = index;
-  }
-
-  protected Client getClient() {
-    return parentIndex.getClient();
-  }
-
-  /* Base CRUD methods */
-
-  protected abstract String getParentKeyValue(K key);
-
-  protected abstract String getParentIndexType();
-
-  protected abstract String getIndexField();
-
-
-  @Override
-  protected String getKeyValue(K key) {
-    return key.toString();
-  }
-
-  @Override
-  public D getByKey(K key) {
-    return toDoc(getClient().prepareGet(this.getIndexName(), this.indexDefinition.getIndexType(), this.getKeyValue(key))
-      .get());
-  }
-
-  @Override
-  protected void updateDocument(UpdateRequest request, K key) throws Exception {
-    LOG.debug("UPDATE _id:{} in index {}", key, this.getIndexName());
-    getClient().update(request
-      .index(this.getIndexName())
-      .id(this.getParentKeyValue(key))
-      .type("rules2")).get();
-  }
-
-}