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, boolean archvied, Date start, Date end) throws IndexEventLogException;
|
55
|
|
56
|
/**
|
57
|
* Set the event with the specified serial number to be archived
|
58
|
* @param serialNumber
|
59
|
*/
|
60
|
public void setArchived(long serialNumber) throws IndexEventLogException;
|
61
|
|
62
|
/**
|
63
|
* Set the all events with the specified identifier to be archived
|
64
|
* @param pid
|
65
|
*/
|
66
|
public void setArchived(Identifier pid) throws IndexEventLogException;
|
67
|
}
|