View Javadoc
1   package org.exoplatform.commons.search.index;
2   
3   import org.exoplatform.commons.search.domain.Document;
4   import org.exoplatform.container.component.BaseComponentPlugin;
5   
6   import java.io.Serializable;
7   import java.util.List;
8   
9   /**
10   * Created by The eXo Platform SAS
11   * Author : Thibault Clement
12   * tclement@exoplatform.com
13   * 7/22/15
14   */
15  public abstract class IndexingServiceConnector extends BaseComponentPlugin implements Serializable {
16  
17    private String type;
18    private boolean enable = true;
19  
20    /**
21     * Transform an entity to Document in order to be indexed
22     * @param id Id of entity to create
23     * @return List of Document to create
24     * @LevelAPI Experimental
25     */
26    public abstract Document create(String id);
27  
28    /**
29     * Transform an entity to Document in order to be reindexed
30     * @param id Id of entity to reindex
31     * @return List of Document to reindex
32     * @LevelAPI Experimental
33     */
34    public abstract Document update(String id);
35  
36    /**
37     * Transform a list of entities to Document in order to be deleted from create
38     * @param id Ids of entities to delete from
39     * @return List of Ids to delete from create
40     * @LevelAPI Experimental
41     */
42    public abstract String delete (String id);
43  
44    public abstract List<String> getAllIds(int offset, int limit);
45  
46    public String getType() {
47      return type;
48    }
49  
50    public void setType(String type) {
51      this.type = type;
52    }
53  
54    public boolean isEnable() {
55      return enable;
56    }
57  
58    public void setEnable(boolean enable) {
59      this.enable = enable;
60    }
61  }