1
|
/**
|
2
|
* '$RCSfile$'
|
3
|
* Purpose: A class represents an event for the solr indexing.
|
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
|
|
26
|
import org.dataone.service.types.v1.Identifier;
|
27
|
|
28
|
|
29
|
/**
|
30
|
* A class represents an event for the solr indexing.
|
31
|
* @author tao
|
32
|
*
|
33
|
*/
|
34
|
public class IndexEvent {
|
35
|
|
36
|
public static final int SUCCESSINSERT = 0;
|
37
|
public static final int FAILUREINSERT = 6;
|
38
|
public static final int SUCCESSDELETE = 12;
|
39
|
public static final int FAILUREDELETE = 18;
|
40
|
public static final int STARTTIMEDINDEX = 24;
|
41
|
public static final int FINISHTIMEDINDEX = 30;
|
42
|
private int type = -1;
|
43
|
private Date date = null;
|
44
|
private Identifier pid = null;
|
45
|
private String description = null;
|
46
|
|
47
|
|
48
|
|
49
|
|
50
|
/**
|
51
|
* Get the type of the event.
|
52
|
* @return the type of the event
|
53
|
*/
|
54
|
public int getType() {
|
55
|
return this.type;
|
56
|
}
|
57
|
|
58
|
/**
|
59
|
* Set the type of the event
|
60
|
* @param type
|
61
|
*/
|
62
|
public void setType(int type) {
|
63
|
this.type = type;
|
64
|
}
|
65
|
|
66
|
/**
|
67
|
* Get the date when the event happened
|
68
|
* @return
|
69
|
*/
|
70
|
public Date getDate() {
|
71
|
return date;
|
72
|
}
|
73
|
|
74
|
/**
|
75
|
* Set the date when the event happened
|
76
|
* @param date
|
77
|
*/
|
78
|
public void setDate(Date date) {
|
79
|
this.date = date;
|
80
|
}
|
81
|
|
82
|
/**
|
83
|
* Get the identifier of the data object involving the event
|
84
|
* @return
|
85
|
*/
|
86
|
public Identifier getPid() {
|
87
|
return pid;
|
88
|
}
|
89
|
|
90
|
/**
|
91
|
* Set the identifier of the data object involving the event.
|
92
|
* @param pid
|
93
|
*/
|
94
|
public void setPid(Identifier pid) {
|
95
|
this.pid = pid;
|
96
|
}
|
97
|
|
98
|
/**
|
99
|
* Get the description of the event
|
100
|
* @return
|
101
|
*/
|
102
|
public String getDescription() {
|
103
|
return description;
|
104
|
}
|
105
|
|
106
|
/**
|
107
|
* Set the description of the event
|
108
|
* @param description
|
109
|
*/
|
110
|
public void setDescription(String description) {
|
111
|
this.description = description;
|
112
|
}
|
113
|
|
114
|
|
115
|
}
|