1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.student.poc.eventproc.event;
18
19 import org.apache.log4j.Logger;
20 import org.kuali.student.poc.eventproc.api.KSEventAuditTrail;
21 import org.kuali.student.r2.common.exceptions.OperationFailedException;
22
23 import java.util.ArrayList;
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27
28
29
30
31
32
33 public abstract class KSEvent implements KSEventAuditTrail {
34 private static final Logger LOGGER = Logger.getLogger(KSEvent.class);
35
36 private KSEventType eventType;
37 private Map<KSEventAttributeKey, String> eventAttributeKeyValueMap;
38
39 private List<KSHandlerResult> handlerResults = new ArrayList<KSHandlerResult>();
40
41 private List<KSEvent> downstreamEvents = new ArrayList<KSEvent>();
42
43 public KSEvent(KSEventType eventType) {
44 this.eventType = eventType;
45 this.eventAttributeKeyValueMap = new HashMap<KSEventAttributeKey, String>();
46 }
47
48 public abstract boolean hasAttribute(KSEventAttributeKey key);
49
50 public KSEventType getEventType() {
51 return eventType;
52 }
53
54 public abstract String getAttributeValueByKey(KSEventAttributeKey key);
55
56 @Override
57 public void addHandlerResult(KSHandlerResult result) {
58 handlerResults.add(result);
59 }
60
61 @Override
62 public void addDownstreamEvent(KSEvent event) {
63 downstreamEvents.add(event);
64 }
65 }