001package com.avaje.ebeanservice.docstore.none;
002
003import com.avaje.ebean.DocStoreQueueEntry;
004import com.avaje.ebean.DocumentStore;
005import com.avaje.ebean.PagedList;
006import com.avaje.ebean.Query;
007import com.avaje.ebean.QueryEachConsumer;
008import com.avaje.ebean.QueryEachWhileConsumer;
009import com.avaje.ebeanservice.docstore.api.DocQueryRequest;
010
011import java.io.IOException;
012import java.util.List;
013import java.util.Map;
014
015/**
016 * DocumentStore that barfs it is used.
017 */
018public class NoneDocStore implements DocumentStore {
019
020  public static IllegalStateException implementationNotInClassPath() {
021    throw new IllegalStateException("DocStore implementation not included in the classPath. You need to add the maven dependency for avaje-ebeanorm-elastic");
022  }
023
024  @Override
025  public void indexSettings(String indexName, Map<String, Object> settings) {
026    throw implementationNotInClassPath();
027  }
028
029  @Override
030  public void dropIndex(String newIndex) {
031    throw implementationNotInClassPath();
032  }
033
034  @Override
035  public void createIndex(String indexName, String alias) {
036    throw implementationNotInClassPath();
037  }
038
039  @Override
040  public void indexAll(Class<?> countryClass) {
041    throw implementationNotInClassPath();
042  }
043
044  @Override
045  public long copyIndex(Class<?> beanType, String newIndex) {
046    throw implementationNotInClassPath();
047  }
048
049  @Override
050  public long copyIndex(Class<?> beanType, String newIndex, long epochMillis) {
051    throw implementationNotInClassPath();
052  }
053
054  @Override
055  public long copyIndex(Query<?> query, String newIndex, int bulkBatchSize) {
056    throw implementationNotInClassPath();
057  }
058
059  @Override
060  public <T> void indexByQuery(Query<T> query) {
061    throw implementationNotInClassPath();
062  }
063
064  @Override
065  public <T> void indexByQuery(Query<T> query, int bulkBatchSize) {
066    throw implementationNotInClassPath();
067  }
068
069  @Override
070  public <T> T find(DocQueryRequest<T> request) {
071    throw implementationNotInClassPath();
072  }
073
074  @Override
075  public <T> PagedList<T> findPagedList(DocQueryRequest<T> request) {
076    throw implementationNotInClassPath();
077  }
078
079  @Override
080  public <T> List<T> findList(DocQueryRequest<T> request) {
081    throw implementationNotInClassPath();
082  }
083
084  @Override
085  public <T> void findEach(DocQueryRequest<T> query, QueryEachConsumer<T> consumer) {
086    throw implementationNotInClassPath();
087  }
088
089  @Override
090  public <T> void findEachWhile(DocQueryRequest<T> query, QueryEachWhileConsumer<T> consumer) {
091    throw implementationNotInClassPath();
092  }
093
094  @Override
095  public long process(List<DocStoreQueueEntry> queueEntries) throws IOException {
096    throw implementationNotInClassPath();
097  }
098}