2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
18
package org.apache.solr.core;
20
import org.apache.solr.search.SolrIndexSearcher;
21
import org.apache.solr.util.plugin.NamedListInitializedPlugin;
23
import org.slf4j.Logger;
24
import org.slf4j.LoggerFactory;
27
* @version $Id: SolrEventListener.java 1052938 2010-12-26 20:21:48Z rmuir $
29
public interface SolrEventListener extends NamedListInitializedPlugin{
30
static final Logger log = LoggerFactory.getLogger(SolrCore.class);
33
public void postCommit();
35
/** The searchers passed here are only guaranteed to be valid for the duration
36
* of this method call, so care should be taken not to spawn threads or asynchronous
37
* tasks with references to these searchers.
39
* Implementations should add the {@link org.apache.solr.common.params.EventParams#EVENT} parameter and set it to a value of either:
41
* <li>{@link org.apache.solr.common.params.EventParams#FIRST_SEARCHER} - First Searcher event</li>
42
* <li>{@link org.apache.solr.common.params.EventParams#NEW_SEARCHER} - New Searcher event</li>
47
if (currentSearcher != null) {
48
nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER);
50
nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER);
55
* @see org.apache.solr.core.AbstractSolrEventListener#addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList)
57
* @param newSearcher The new {@link org.apache.solr.search.SolrIndexSearcher} to use
58
* @param currentSearcher The existing {@link org.apache.solr.search.SolrIndexSearcher}. null if this is a firstSearcher event.
61
public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher);