View Javadoc
1   /*******************************************************************************
2    *   Gisgraphy Project 
3    * 
4    *   This library is free software; you can redistribute it and/or
5    *   modify it under the terms of the GNU Lesser General Public
6    *   License as published by the Free Software Foundation; either
7    *   version 2.1 of the License, or (at your option) any later version.
8    * 
9    *   This library is distributed in the hope that it will be useful,
10   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   *   Lesser General Public License for more details.
13   * 
14   *   You should have received a copy of the GNU Lesser General Public
15   *   License along with this library; if not, write to the Free Software
16   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
17   * 
18   *  Copyright 2008  Gisgraphy project 
19   *  David Masclet <davidmasclet@gisgraphy.com>
20   *  
21   *  
22   *******************************************************************************/
23  package com.gisgraphy.domain.repository;
24  
25  import com.gisgraphy.domain.geoloc.entity.event.IEvent;
26  
27  /**
28   * We don't use the Hibernate Listeners because we don't want to handle every
29   * hibernate operations just a few one (we don't want to check if that class or
30   * that one should be sync Synchronise the Gis Object with the full text search
31   * engine.
32   * 
33   * @author <a href="mailto:david.masclet@gisgraphy.com">David Masclet</a>
34   */
35  public interface ISolRSynchroniser {
36  
37      /**
38       * handle an event in order to synchronise Data (the event may be add,
39       * update, delete a GIS object)
40       * 
41       * @param event
42       *            The event to handle
43       */
44      public void handleEvent(IEvent event);
45  
46      /**
47       * Send a commit to the full text search engine
48       * 
49       * @return true if success or false other case. it does not throw exception
50       *         because the commit may not be required because of the auto commit
51       *         functionnality in solr. it is up to the caller to deal with this
52       */
53      public boolean commit();
54  
55      /**
56       * Send a optimize command to the full text search engine
57       */
58      public void optimize();
59  
60      /**
61       * /!\USE IT WITH CARE/!\ : The Database and The full text search engine may
62       * be de-synchronised, because this method does not delete data in Database
63       * Delete all the data in the fulltext search engine <u>AND COMMIT</u>
64       */
65      public void deleteAll();
66  
67  }