@Test public void testElasticsearchAccess() throws VitamException, IOException { final List<ElasticsearchNode> nodes = new ArrayList<>(); nodes.add(new ElasticsearchNode(ElasticsearchRule.getHost(), elasticsearchRule.getPort())); final ElasticsearchAccess elastic = new ElasticsearchAccess(ElasticsearchRule.VITAM_CLUSTER, nodes); assertEquals(ElasticsearchRule.VITAM_CLUSTER, elastic.getClusterName()); assertEquals(ElasticsearchRule.VITAM_CLUSTER, elastic.getInfo()); assertEquals(nodes, elastic.getNodes()); assertNotNull(elastic.getClient()); elastic.close(); }
public ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException { ParametersChecker.checkParameter("clusterName, elasticsearch nodes list are a mandatory parameters", clusterName, nodes); if (nodes.isEmpty()) { throw new VitamException("elasticsearch nodes list is empty"); } this.clusterName = clusterName; this.nodes = nodes; default_builder = settings(); }
ElasticsearchAccess implements DatabaseConnection { public ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException { ParametersChecker.checkParameter("clusterName, elasticsearch nodes list are a mandatory parameters", clusterName, nodes); if (nodes.isEmpty()) { throw new VitamException("elasticsearch nodes list is empty"); } this.clusterName = clusterName; this.nodes = nodes; default_builder = settings(); } }
ElasticsearchAccess implements DatabaseConnection { public ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException { ParametersChecker.checkParameter("clusterName, elasticsearch nodes list are a mandatory parameters", clusterName, nodes); if (nodes.isEmpty()) { throw new VitamException("elasticsearch nodes list is empty"); } this.clusterName = clusterName; this.nodes = nodes; default_builder = settings(); } ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes); }
ElasticsearchAccess implements DatabaseConnection { public ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException { ParametersChecker.checkParameter("clusterName, elasticsearch nodes list are a mandatory parameters", clusterName, nodes); if (nodes.isEmpty()) { throw new VitamException("elasticsearch nodes list is empty"); } this.clusterName = clusterName; this.nodes = nodes; default_builder = settings(); } ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes); void purgeIndex(String collectionName, Integer tenant); boolean existsIndex(String indexName); GetAliasesResponse getAlias(String alias); boolean createIndex(String aliasName, String indexName, String mapping); boolean createIndex(String indexName, String mapping); boolean existsAlias(String aliasName); boolean switchAliasIndex(String aliasName, String oldIndex, String newIndexName); void purgeIndex(String indexName); final void refreshIndex(final String collectionName, Integer tenantId); final void indexEntry(final String collectionName, final Integer tenantId,
        final String id,
        final T vitamDocument); final void indexEntries(final String collectionName, final Integer tenantId,
        final Collection<? extends Document> documents); void updateEntry(String collectionName, Integer tenantId, String id,
        T vitamDocument); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query, final QueryBuilder filter); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query, final QueryBuilder filter, String[] esProjection, final List<SortBuilder> sorts,
        int offset, Integer limit); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query, final QueryBuilder filter, String[] esProjection, final List<SortBuilder> sorts,
        int offset, Integer limit,
        final List<AggregationBuilder> facets, final String scrollId, final Integer scrollTimeout); void clearScroll(String scrollId); void close(); String getClusterName(); RestHighLevelClient getClient(); List<ElasticsearchNode> getNodes(); @Override boolean checkConnection(); @Override String getInfo(); final Map<String, String> createIndexAndAliasIfAliasNotExists(String collectionName, String mapping); final Map<String, String> createIndexAndAliasIfAliasNotExists(String collectionName, String mapping,
        Integer tenantId); final String createIndexWithoutAlias(String collectionName, String mapping,
        Integer tenantId); final void switchIndex(String aliasName, String indexNameToSwitchWith); final void deleteIndexByAlias(final String collectionName, Integer tenantId); final boolean deleteIndex(final String indexFullName); void delete(String collectionName, List<String> ids, Integer tenant); }
ElasticsearchAccess implements DatabaseConnection { public ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException { ParametersChecker.checkParameter("clusterName, elasticsearch nodes list are a mandatory parameters", clusterName, nodes); if (nodes.isEmpty()) { throw new VitamException("elasticsearch nodes list is empty"); } this.clusterName = clusterName; this.nodes = nodes; default_builder = settings(); } ElasticsearchAccess(final String clusterName, List<ElasticsearchNode> nodes); void purgeIndex(String collectionName, Integer tenant); boolean existsIndex(String indexName); GetAliasesResponse getAlias(String alias); boolean createIndex(String aliasName, String indexName, String mapping); boolean createIndex(String indexName, String mapping); boolean existsAlias(String aliasName); boolean switchAliasIndex(String aliasName, String oldIndex, String newIndexName); void purgeIndex(String indexName); final void refreshIndex(final String collectionName, Integer tenantId); final void indexEntry(final String collectionName, final Integer tenantId,
        final String id,
        final T vitamDocument); final void indexEntries(final String collectionName, final Integer tenantId,
        final Collection<? extends Document> documents); void updateEntry(String collectionName, Integer tenantId, String id,
        T vitamDocument); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query, final QueryBuilder filter); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query, final QueryBuilder filter, String[] esProjection, final List<SortBuilder> sorts,
        int offset, Integer limit); final SearchResponse search(final String collectionName, final Integer tenantId,
        final QueryBuilder query, final QueryBuilder filter, String[] esProjection, final List<SortBuilder> sorts,
        int offset, Integer limit,
        final List<AggregationBuilder> facets, final String scrollId, final Integer scrollTimeout); void clearScroll(String scrollId); void close(); String getClusterName(); RestHighLevelClient getClient(); List<ElasticsearchNode> getNodes(); @Override boolean checkConnection(); @Override String getInfo(); final Map<String, String> createIndexAndAliasIfAliasNotExists(String collectionName, String mapping); final Map<String, String> createIndexAndAliasIfAliasNotExists(String collectionName, String mapping,
        Integer tenantId); final String createIndexWithoutAlias(String collectionName, String mapping,
        Integer tenantId); final void switchIndex(String aliasName, String indexNameToSwitchWith); final void deleteIndexByAlias(final String collectionName, Integer tenantId); final boolean deleteIndex(final String indexFullName); void delete(String collectionName, List<String> ids, Integer tenant); static final int DEFAULT_SCROLL_TIMEOUT; static final int DEFAULT_LIMIT_SCROLL; static final String SCROLL_ACTIVATE_KEYWORD; }