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