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