Project

General

Profile

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
     * Get the type of the event.
51
     * @return the type of the event
52
     */
53
    public int getType() {
54
        return this.type;
55
    }
56
    
57
    /**
58
     * Set the type of the event
59
     * @param type
60
     */
61
    public void setType(int type) {
62
        this.type = type;
63
    }
64
    
65
    /**
66
     * Get the date when the event happened
67
     * @return
68
     */
69
    public Date getDate() {
70
        return date;
71
    }
72
    
73
    /**
74
     * Set the date when the event happened
75
     * @param date
76
     */
77
    public void setDate(Date date) {
78
        this.date = date;
79
    }
80
    
81
    /**
82
     * Get the identifier of the data object involving the event
83
     * @return
84
     */
85
    public Identifier getPid() {
86
        return pid;
87
    }
88
    
89
    /**
90
     * Set the identifier of the data object involving the event.
91
     * @param pid
92
     */
93
    public void setPid(Identifier pid) {
94
        this.pid = pid;
95
    }
96
    
97
    /**
98
     * Get the description of the event
99
     * @return
100
     */
101
    public String getDescription() {
102
        return description;
103
    }
104
    
105
    /**
106
     * Set the description of the event
107
     * @param description
108
     */
109
    public void setDescription(String description) {
110
        this.description = description;
111
    }
112
}
(1-1/3)