1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.audit;
20
21 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
22 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.Optional;
26 import org.apache.syncope.common.lib.BaseBean;
27 import org.apache.syncope.common.lib.types.AuditElements;
28
29 public class EventCategory implements BaseBean {
30
31 private static final long serialVersionUID = -4340060002701633401L;
32
33 private AuditElements.EventCategoryType type;
34
35 private String category;
36
37 private String subcategory;
38
39 private final List<String> events = new ArrayList<>();
40
41
42
43
44 public EventCategory() {
45 this(AuditElements.EventCategoryType.LOGIC);
46 }
47
48
49
50
51
52
53 public EventCategory(final AuditElements.EventCategoryType type) {
54 super();
55 this.type = type;
56 }
57
58 public AuditElements.EventCategoryType getType() {
59 return type;
60 }
61
62 public void setType(final AuditElements.EventCategoryType type) {
63 this.type = Optional.ofNullable(type).orElse(AuditElements.EventCategoryType.CUSTOM);
64 }
65
66 public String getCategory() {
67 return category;
68 }
69
70 public void setCategory(final String category) {
71 this.category = category;
72 }
73
74 public String getSubcategory() {
75 return subcategory;
76 }
77
78 public void setSubcategory(final String subcategory) {
79 this.subcategory = subcategory;
80 }
81
82 @JacksonXmlElementWrapper(localName = "events")
83 @JacksonXmlProperty(localName = "event")
84 public List<String> getEvents() {
85 return events;
86 }
87 }