@Test public void switchIndexOKTest() throws Exception { doNothing().when(indexationHelper).switchIndex(anyString(), anyString(), any()); logbookOperationsImpl.switchIndex("alias", "index_name"); }
@Override public void switchIndex(String alias, String newIndexName) throws DatabaseException { try { indexationHelper.switchIndex(alias, newIndexName, LogbookCollections.OPERATION.getEsClient()); } catch (DatabaseException exc) { LOGGER.error("Cannot switch alias {} to index {}", alias, newIndexName, exc); throw exc; } }
LogbookOperationsImpl implements LogbookOperations { @Override public void switchIndex(String alias, String newIndexName) throws DatabaseException { try { indexationHelper.switchIndex(alias, newIndexName, LogbookCollections.OPERATION.getEsClient()); } catch (DatabaseException exc) { LOGGER.error("Cannot switch alias {} to index {}", alias, newIndexName, exc); throw exc; } } }
LogbookOperationsImpl implements LogbookOperations { @Override public void switchIndex(String alias, String newIndexName) throws DatabaseException { try { indexationHelper.switchIndex(alias, newIndexName, LogbookCollections.OPERATION.getEsClient()); } catch (DatabaseException exc) { LOGGER.error("Cannot switch alias {} to index {}", alias, newIndexName, exc); throw exc; } } LogbookOperationsImpl(LogbookDbAccess mongoDbAccess); @VisibleForTesting  LogbookOperationsImpl(LogbookDbAccess mongoDbAccess, WorkspaceClientFactory workspaceClientFactory,
        StorageClientFactory storageClientFactory, IndexationHelper indexationHelper); }
LogbookOperationsImpl implements LogbookOperations { @Override public void switchIndex(String alias, String newIndexName) throws DatabaseException { try { indexationHelper.switchIndex(alias, newIndexName, LogbookCollections.OPERATION.getEsClient()); } catch (DatabaseException exc) { LOGGER.error("Cannot switch alias {} to index {}", alias, newIndexName, exc); throw exc; } } LogbookOperationsImpl(LogbookDbAccess mongoDbAccess); @VisibleForTesting  LogbookOperationsImpl(LogbookDbAccess mongoDbAccess, WorkspaceClientFactory workspaceClientFactory,
        StorageClientFactory storageClientFactory, IndexationHelper indexationHelper); @Override void create(LogbookOperationParameters parameters); @Override void update(LogbookOperationParameters parameters); @Override List<LogbookOperation> select(JsonNode select); @Override RequestResponse<LogbookOperation> selectOperations(JsonNode select); @Override RequestResponse<LogbookOperation> selectOperations(JsonNode select, boolean sliced); @Override List<LogbookOperation> select(JsonNode select, boolean sliced); @Override LogbookOperation getById(String idProcess); @Override final void createBulkLogbookOperation(final LogbookOperationParameters[] operationArray); @Override final void updateBulkLogbookOperation(final LogbookOperationParameters[] operationArray); @Override MongoCursor<LogbookOperation> selectOperationsByLastPersistenceDateInterval(LocalDateTime startDate,
        LocalDateTime endDate); @Override LogbookOperation findFirstTraceabilityOperationOKAfterDate(final LocalDateTime date); @Override LogbookOperation findLastTraceabilityOperationOK(); @Override IndexationResult reindex(IndexParameters indexParameters); @Override void switchIndex(String alias, String newIndexName); }
LogbookOperationsImpl implements LogbookOperations { @Override public void switchIndex(String alias, String newIndexName) throws DatabaseException { try { indexationHelper.switchIndex(alias, newIndexName, LogbookCollections.OPERATION.getEsClient()); } catch (DatabaseException exc) { LOGGER.error("Cannot switch alias {} to index {}", alias, newIndexName, exc); throw exc; } } LogbookOperationsImpl(LogbookDbAccess mongoDbAccess); @VisibleForTesting  LogbookOperationsImpl(LogbookDbAccess mongoDbAccess, WorkspaceClientFactory workspaceClientFactory,
        StorageClientFactory storageClientFactory, IndexationHelper indexationHelper); @Override void create(LogbookOperationParameters parameters); @Override void update(LogbookOperationParameters parameters); @Override List<LogbookOperation> select(JsonNode select); @Override RequestResponse<LogbookOperation> selectOperations(JsonNode select); @Override RequestResponse<LogbookOperation> selectOperations(JsonNode select, boolean sliced); @Override List<LogbookOperation> select(JsonNode select, boolean sliced); @Override LogbookOperation getById(String idProcess); @Override final void createBulkLogbookOperation(final LogbookOperationParameters[] operationArray); @Override final void updateBulkLogbookOperation(final LogbookOperationParameters[] operationArray); @Override MongoCursor<LogbookOperation> selectOperationsByLastPersistenceDateInterval(LocalDateTime startDate,
        LocalDateTime endDate); @Override LogbookOperation findFirstTraceabilityOperationOKAfterDate(final LocalDateTime date); @Override LogbookOperation findLastTraceabilityOperationOK(); @Override IndexationResult reindex(IndexParameters indexParameters); @Override void switchIndex(String alias, String newIndexName);  }