diff src/luan/modules/lucene/LuanOpDoer.java @ 1563:8fbcc4747091

remove LuanFunction.luan
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 09 Nov 2020 01:37:57 -0700
parents 52241b69c339
children
line wrap: on
line diff
--- a/src/luan/modules/lucene/LuanOpDoer.java	Sun Nov 08 16:50:59 2020 -0700
+++ b/src/luan/modules/lucene/LuanOpDoer.java	Mon Nov 09 01:37:57 2020 -0700
@@ -6,63 +6,66 @@
 import goodjava.lucene.api.GoodIndexWriter;
 import goodjava.lucene.logging.OpDoer;
 import goodjava.lucene.logging.BasicOpDoer;
+import luan.Luan;
 import luan.LuanFunction;
 import luan.LuanException;
 import luan.LuanRuntimeException;
 
 
 final class LuanOpDoer implements OpDoer {
+	private final Luan luan;
 	private final OpDoer opDoer;
 	private final LuanFunction fn;
 
-	LuanOpDoer(GoodIndexWriter writer,LuanFunction fn) {
+	LuanOpDoer(GoodIndexWriter writer,Luan luan,LuanFunction fn) {
 		this.opDoer = new BasicOpDoer(writer);
+		this.luan = luan;
 		this.fn = fn;
 	}
 
-	public void commit() throws IOException {
+	@Override public void commit() throws IOException {
 		try {
-			fn.call(new CommitAction(opDoer));
+			fn.call(luan,new CommitAction(opDoer));
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
 		}
 	}
 
-	public void deleteAll(long time) throws IOException {
+	@Override public void deleteAll(long time) throws IOException {
 		try {
-			fn.call(new DeleteAllAction(opDoer,time));
+			fn.call(luan,new DeleteAllAction(opDoer,time));
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
 		}
 	}
 
-	public void deleteDocuments(long time,Query query) throws IOException {
+	@Override public void deleteDocuments(long time,Query query) throws IOException {
 		try {
-			fn.call(new DeleteDocumentsAction(opDoer,time,query));
+			fn.call(luan,new DeleteDocumentsAction(opDoer,time,query));
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
 		}
 	}
 
-	public void addDocument(long time,Map<String,Object> storedFields) throws IOException {
+	@Override public void addDocument(long time,Map<String,Object> storedFields) throws IOException {
 		try {
-			fn.call(new AddDocumentAction(opDoer,time,storedFields));
+			fn.call(luan,new AddDocumentAction(opDoer,time,storedFields));
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
 		}
 	}
 
-	public void updateDocument(long time,String keyFieldName,Map<String,Object> storedFields) throws IOException {
+	@Override public void updateDocument(long time,String keyFieldName,Map<String,Object> storedFields) throws IOException {
 		try {
-			fn.call(new UpdateDocumentAction(opDoer,time,keyFieldName,storedFields));
+			fn.call(luan,new UpdateDocumentAction(opDoer,time,keyFieldName,storedFields));
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
 		}
 	}
 
-	public void tag(long time,String tag) throws IOException {
+	@Override public void tag(long time,String tag) throws IOException {
 		try {
-			fn.call(new TagAction(opDoer,time,tag));
+			fn.call(luan,new TagAction(opDoer,time,tag));
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
 		}