view src/goodjava/lucene/logging/BasicOpDoer.java @ 1640:570f3d483a31

host - move https.luan into src
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 21 Dec 2021 16:54:26 -0700
parents 52241b69c339
children
line wrap: on
line source

package goodjava.lucene.logging;

import java.io.IOException;
import java.util.Map;
import org.apache.lucene.search.Query;
import goodjava.lucene.api.GoodIndexWriter;


public class BasicOpDoer implements OpDoer {
	protected final GoodIndexWriter writer;
	protected boolean isActive = true;

	public BasicOpDoer(GoodIndexWriter writer) {
		this.writer = writer;
	}

	public void commit() throws IOException {
		if( !isActive )
			return;
		writer.commit();
	}

	public void deleteAll(long time) throws IOException {
		if( !isActive )
			return;
		writer.deleteAll();
	}

	public void deleteDocuments(long time,Query query) throws IOException {
		if( !isActive )
			return;
		writer.deleteDocuments(query);
	}

	public void addDocument(long time,Map<String,Object> storedFields) throws IOException {
		if( !isActive )
			return;
		writer.addDocument(storedFields);
	}

	public void updateDocument(long time,String keyFieldName,Map<String,Object> storedFields) throws IOException {
		if( !isActive )
			return;
		writer.updateDocument(keyFieldName,storedFields);
	}

	public void tag(long time,String tag) throws IOException {}

}