Revision 7828
Added by ben leinfelder over 11 years ago
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/event/IndexEvent.java | ||
---|---|---|
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.Event; |
|
27 |
import org.dataone.service.types.v1.Identifier; |
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* A class represents an event for the solr indexing. |
|
32 |
* @author tao |
|
33 |
* |
|
34 |
*/ |
|
35 |
public class IndexEvent { |
|
36 |
|
|
37 |
private Event action = null; |
|
38 |
private Date date = null; |
|
39 |
private Identifier identifier = null; |
|
40 |
private String description = null; |
|
41 |
|
|
42 |
/** |
|
43 |
* Get the action of the event. |
|
44 |
* @return the action of the event |
|
45 |
*/ |
|
46 |
public Event getAction() { |
|
47 |
return this.action; |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* Set the action of the event |
|
52 |
* @param action |
|
53 |
*/ |
|
54 |
public void setAction(Event action) { |
|
55 |
this.action = action; |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* Get the date when the event happened |
|
60 |
* @return |
|
61 |
*/ |
|
62 |
public Date getDate() { |
|
63 |
return date; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* Set the date when the event happened |
|
68 |
* @param date |
|
69 |
*/ |
|
70 |
public void setDate(Date date) { |
|
71 |
this.date = date; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Get the identifier of the data object involving the event |
|
76 |
* @return |
|
77 |
*/ |
|
78 |
public Identifier getIdentifier() { |
|
79 |
return identifier; |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* Set the identifier of the data object involving the event. |
|
84 |
* @param pid |
|
85 |
*/ |
|
86 |
public void setIdentifier(Identifier pid) { |
|
87 |
this.identifier = pid; |
|
88 |
} |
|
89 |
|
|
90 |
/** |
|
91 |
* Get the description of the event |
|
92 |
* @return |
|
93 |
*/ |
|
94 |
public String getDescription() { |
|
95 |
return description; |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* Set the description of the event |
|
100 |
* @param description |
|
101 |
*/ |
|
102 |
public void setDescription(String description) { |
|
103 |
this.description = description; |
|
104 |
} |
|
105 |
|
|
106 |
|
|
107 |
} |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/event/HazelcastIndexEventLog.java | ||
---|---|---|
28 | 28 |
import org.dataone.service.types.v1.Event; |
29 | 29 |
import org.dataone.service.types.v1.Identifier; |
30 | 30 |
|
31 |
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent; |
|
31 | 32 |
import edu.ucsb.nceas.metacat.index.DistributedMapsFactory; |
32 | 33 |
|
33 | 34 |
/** |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/event/IndexEventFileLog.java | ||
---|---|---|
36 | 36 |
import org.dataone.service.types.v1.Event; |
37 | 37 |
import org.dataone.service.types.v1.Identifier; |
38 | 38 |
|
39 |
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent; |
|
39 | 40 |
|
41 |
|
|
40 | 42 |
/** |
41 | 43 |
* A class represents a file log for the index events. |
42 | 44 |
* @author tao |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/event/IndexEventLog.java | ||
---|---|---|
27 | 27 |
import org.dataone.service.types.v1.Event; |
28 | 28 |
import org.dataone.service.types.v1.Identifier; |
29 | 29 |
|
30 |
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent; |
|
31 |
|
|
30 | 32 |
/** |
31 | 33 |
* An interface to store and query the IndexEvent. |
32 | 34 |
* @author tao |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java | ||
---|---|---|
77 | 77 |
import org.w3c.dom.Document; |
78 | 78 |
import org.xml.sax.SAXException; |
79 | 79 |
|
80 |
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent; |
|
80 | 81 |
import edu.ucsb.nceas.metacat.index.event.EventlogFactory; |
81 |
import edu.ucsb.nceas.metacat.index.event.IndexEvent; |
|
82 | 82 |
import edu.ucsb.nceas.metacat.index.resourcemap.ResourceMapSubprocessor; |
83 | 83 |
|
84 | 84 |
/** |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/DistributedMapsFactory.java | ||
---|---|---|
44 | 44 |
import com.hazelcast.core.IMap; |
45 | 45 |
import com.hazelcast.core.ISet; |
46 | 46 |
|
47 |
import edu.ucsb.nceas.metacat.index.event.IndexEvent; |
|
47 |
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent;
|
|
48 | 48 |
|
49 | 49 |
|
50 | 50 |
/** |
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/IndexGenerator.java | ||
---|---|---|
50 | 50 |
import com.hazelcast.core.IMap; |
51 | 51 |
import com.hazelcast.core.ISet; |
52 | 52 |
|
53 |
import edu.ucsb.nceas.metacat.common.index.event.IndexEvent; |
|
53 | 54 |
import edu.ucsb.nceas.metacat.index.event.EventlogFactory; |
54 |
import edu.ucsb.nceas.metacat.index.event.IndexEvent; |
|
55 | 55 |
import edu.ucsb.nceas.metacat.index.event.IndexEventLogException; |
56 | 56 |
|
57 | 57 |
|
metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/index/event/IndexEvent.java | ||
---|---|---|
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.common.index.event; |
|
23 |
|
|
24 |
import java.util.Date; |
|
25 |
|
|
26 |
import org.dataone.service.types.v1.Event; |
|
27 |
import org.dataone.service.types.v1.Identifier; |
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* A class represents an event for the solr indexing. |
|
32 |
* @author tao |
|
33 |
* |
|
34 |
*/ |
|
35 |
public class IndexEvent { |
|
36 |
|
|
37 |
private Event action = null; |
|
38 |
private Date date = null; |
|
39 |
private Identifier identifier = null; |
|
40 |
private String description = null; |
|
41 |
|
|
42 |
/** |
|
43 |
* Get the action of the event. |
|
44 |
* @return the action of the event |
|
45 |
*/ |
|
46 |
public Event getAction() { |
|
47 |
return this.action; |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* Set the action of the event |
|
52 |
* @param action |
|
53 |
*/ |
|
54 |
public void setAction(Event action) { |
|
55 |
this.action = action; |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* Get the date when the event happened |
|
60 |
* @return |
|
61 |
*/ |
|
62 |
public Date getDate() { |
|
63 |
return date; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* Set the date when the event happened |
|
68 |
* @param date |
|
69 |
*/ |
|
70 |
public void setDate(Date date) { |
|
71 |
this.date = date; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Get the identifier of the data object involving the event |
|
76 |
* @return |
|
77 |
*/ |
|
78 |
public Identifier getIdentifier() { |
|
79 |
return identifier; |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* Set the identifier of the data object involving the event. |
|
84 |
* @param pid |
|
85 |
*/ |
|
86 |
public void setIdentifier(Identifier pid) { |
|
87 |
this.identifier = pid; |
|
88 |
} |
|
89 |
|
|
90 |
/** |
|
91 |
* Get the description of the event |
|
92 |
* @return |
|
93 |
*/ |
|
94 |
public String getDescription() { |
|
95 |
return description; |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* Set the description of the event |
|
100 |
* @param description |
|
101 |
*/ |
|
102 |
public void setDescription(String description) { |
|
103 |
this.description = description; |
|
104 |
} |
|
105 |
|
|
106 |
|
|
107 |
} |
|
0 | 108 |
Also available in: Unified diff
move IndexEvent into metacat-common. Perparation for Metacat responding to events and writing them to a persistent store. https://projects.ecoinformatics.org/ecoinfo/issues/5944