Project

General

Profile

1
/**
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
package edu.ucsb.nceas.metacat.index.event;
23

    
24
import java.util.Date;
25
import java.util.List;
26

    
27
import org.dataone.service.types.v1.Identifier;
28

    
29
/**
30
 * An interface to store and query the IndexEvent.
31
 * @author tao
32
 *
33
 */
34
public interface IndexEventLog {
35
    
36
    /**
37
     * Write an IndexEvent into a storage
38
     * @param event
39
     * @return the serial number for this event
40
     * @throws IndexEventLogException
41
     */
42
    public long write(IndexEvent event) throws IndexEventLogException;
43
    
44
    
45
    /**
46
     * Gets the list of IndexEvent matching the specified set of filters. The filter parameters can be null
47
     * @param type  the type of the event
48
     * @param pid   the identifier of the data object in the event
49
     * @param start the start time of the time range for query
50
     * @param end   the end time of the time range for query
51
     * @return
52
     * @throws IndexEventLogException
53
     */
54
    public List<IndexEvent> getEvents(int type, Identifier pid, Date start, Date end) throws IndexEventLogException;
55
    
56
    /**
57
     * Get the list of identifiers which were failed to build the solr index since the 
58
     * previous timed indexing (including the ones in the timed indexing).
59
     * @return the list of failure identifiers. The null will be returned if no failure. 
60
     */
61
    public List<Identifier> getFailedPids() throws IndexEventLogException;
62
    
63
    
64
    /**
65
     * Get the latest SystemMetadata modification Date of the objects that were built
66
     * the solr index during the previous timed indexing process.
67
     * @return the date. The null will be returned if there is no such date.
68
     * @throws IndexEventLogException
69
     */
70
    public Date getLastProcessDate() throws IndexEventLogException;
71
    
72
    
73
    /**
74
     * Set the SystemMetadata modification Date of the objects that were built
75
     * the solr index during the previous timed indexing process.
76
     * @throws IndexEventLogException
77
     */
78
    public void setLastProcessDate(Date date) throws IndexEventLogException;
79
 
80
}
(4-4/5)