Project

General

Profile

1 7795 tao
/**
2
 *  '$RCSfile$'
3
 *    Purpose: An interface to store and query the IndexEvent.
4
 *    Copyright: 2013 Regents of the University of California and the
5
 *             National Center for Ecological Analysis and Synthesis
6
 *    Authors: Jing Tao
7
 *
8
 * This program is free software; you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation; either version 2 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
 */
22 7794 tao
package edu.ucsb.nceas.metacat.index.event;
23
24
import java.util.Date;
25
import java.util.List;
26
27 7815 leinfelder
import org.dataone.service.types.v1.Event;
28 7794 tao
import org.dataone.service.types.v1.Identifier;
29
30 7828 leinfelder
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent;
31
32 7794 tao
/**
33
 * An interface to store and query the IndexEvent.
34
 * @author tao
35
 *
36
 */
37
public interface IndexEventLog {
38
39
    /**
40
     * Write an IndexEvent into a storage
41
     * @param event
42 7797 tao
     * @return the serial number for this event
43 7794 tao
     * @throws IndexEventLogException
44
     */
45 7814 leinfelder
    public void write(IndexEvent event) throws IndexEventLogException;
46 7794 tao
47 7810 leinfelder
    /**
48
     * Remove an IndexEvent in storage
49
     * @param identifier
50
     * @throws IndexEventLogException
51
     */
52 7815 leinfelder
    public void remove(Identifier identifier) throws IndexEventLogException;
53 7794 tao
54
    /**
55
     * Gets the list of IndexEvent matching the specified set of filters. The filter parameters can be null
56
     * @param type  the type of the event
57
     * @param pid   the identifier of the data object in the event
58
     * @param start the start time of the time range for query
59
     * @param end   the end time of the time range for query
60
     * @return
61
     * @throws IndexEventLogException
62
     */
63 7815 leinfelder
    public List<IndexEvent> getEvents(Event action, Identifier pid, Date start, Date end) throws IndexEventLogException;
64 7796 tao
65 7797 tao
    /**
66 7805 tao
     * Get the latest SystemMetadata modification Date of the objects that were built
67
     * the solr index during the previous timed indexing process.
68
     * @return the date. The null will be returned if there is no such date.
69
     * @throws IndexEventLogException
70 7797 tao
     */
71 7805 tao
    public Date getLastProcessDate() throws IndexEventLogException;
72
73
74
    /**
75
     * Set the SystemMetadata modification Date of the objects that were built
76
     * the solr index during the previous timed indexing process.
77
     * @throws IndexEventLogException
78
     */
79
    public void setLastProcessDate(Date date) throws IndexEventLogException;
80
81 7794 tao
}