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 void write(IndexEvent event) throws IndexEventLogException;
43
    
44
    /**
45
     * Remove an IndexEvent in storage
46
     * @param identifier
47
     * @throws IndexEventLogException
48
     */
49
    public void remove(String identifier) throws IndexEventLogException;
50
    
51
    
52
    /**
53
     * Gets the list of IndexEvent matching the specified set of filters. The filter parameters can be null
54
     * @param type  the type of the event
55
     * @param pid   the identifier of the data object in the event
56
     * @param start the start time of the time range for query
57
     * @param end   the end time of the time range for query
58
     * @return
59
     * @throws IndexEventLogException
60
     */
61
    public List<IndexEvent> getEvents(int type, Identifier pid, Date start, Date end) throws IndexEventLogException;
62
    
63
    /**
64
     * Get the list of identifiers which were failed to build the solr index since the 
65
     * previous timed indexing (including the ones in the timed indexing).
66
     * @return the list of failure identifiers. The null will be returned if no failure. 
67
     */
68
    public List<String> getFailedPids() throws IndexEventLogException;
69
    
70
    
71
    /**
72
     * Get the latest SystemMetadata modification Date of the objects that were built
73
     * the solr index during the previous timed indexing process.
74
     * @return the date. The null will be returned if there is no such date.
75
     * @throws IndexEventLogException
76
     */
77
    public Date getLastProcessDate() throws IndexEventLogException;
78
    
79
    
80
    /**
81
     * Set the SystemMetadata modification Date of the objects that were built
82
     * the solr index during the previous timed indexing process.
83
     * @throws IndexEventLogException
84
     */
85
    public void setLastProcessDate(Date date) throws IndexEventLogException;
86
 
87
}
(4-4/5)