|
26 | 26 | import org.audit4j.core.annotation.SelectionType;
|
27 | 27 | import org.audit4j.core.dto.AnnotationAuditEvent;
|
28 | 28 | import org.audit4j.core.dto.AuditEvent;
|
29 |
| -import org.audit4j.core.dto.Element; |
| 29 | +import org.audit4j.core.dto.Field; |
30 | 30 | import org.audit4j.core.handler.Handler;
|
31 | 31 |
|
32 | 32 |
|
@@ -57,37 +57,33 @@ public void process(AnnotationAuditEvent auditDto) {
|
57 | 57 | final AsyncAuditAnnotationAttributes attributes = new AsyncAuditAnnotationAttributes();
|
58 | 58 | final AuditFieldAnnotationAttribute fieldAttributes = new AuditFieldAnnotationAttribute();
|
59 | 59 | List<Handler> handlers = null;
|
60 |
| - List<Element> actionItems = null; |
| 60 | + List<Field> fields = null; |
61 | 61 | AuditEvent event = new AuditEvent();
|
62 | 62 | String action = "";
|
63 |
| - String methodName = ""; |
64 |
| - |
65 | 63 | if (attributes.hasAnnotation(auditDto.getClass())) {
|
66 |
| - handlers = attributes.getHandlers(auditDto.getClass()); |
| 64 | + handlers = Context.getHandlers(); |
67 | 65 |
|
68 |
| - final String selection = attributes.getSelection(auditDto.getClass()); |
| 66 | + final SelectionType selection = attributes.getSelection(auditDto.getClass()); |
69 | 67 | if (selection.equals(SelectionType.ALL)) {
|
70 |
| - actionItems = fieldAttributes.getAllActionItems(auditDto.getMethod(), auditDto.getArgs()); |
| 68 | + fields = fieldAttributes.getAllFields(auditDto.getMethod(), auditDto.getArgs()); |
71 | 69 | } else if (selection.equals(SelectionType.MARKED)) {
|
72 |
| - actionItems = fieldAttributes.getMarkedActionItems(auditDto.getMethod(), auditDto.getArgs()); |
| 70 | + fields = fieldAttributes.getMarkedFields(auditDto.getMethod(), auditDto.getArgs()); |
73 | 71 | }
|
74 | 72 | action = attributes.getAction(auditDto.getMethod().getClass(), auditDto.getMethod());
|
75 |
| - methodName = auditDto.getMethod().getName(); |
76 | 73 | } else if (attributes.hasAnnotation(auditDto.getMethod())) {
|
77 |
| - handlers = attributes.getHandlers(auditDto.getMethod()); |
78 |
| - final String selection = attributes.getSelection(auditDto.getMethod()); |
| 74 | + handlers = Context.getHandlers(); |
| 75 | + final SelectionType selection = attributes.getSelection(auditDto.getMethod()); |
79 | 76 | if (selection.equals(SelectionType.ALL)) {
|
80 |
| - actionItems = fieldAttributes.getAllActionItems(auditDto.getMethod(), auditDto.getArgs()); |
| 77 | + fields = fieldAttributes.getAllFields(auditDto.getMethod(), auditDto.getArgs()); |
81 | 78 | } else if (selection.equals(SelectionType.MARKED)) {
|
82 |
| - actionItems = fieldAttributes.getMarkedActionItems(auditDto.getMethod(), auditDto.getArgs()); |
| 79 | + fields = fieldAttributes.getMarkedFields(auditDto.getMethod(), auditDto.getArgs()); |
83 | 80 | }
|
84 | 81 | action = attributes.getAction(auditDto.getMethod());
|
85 |
| - methodName = auditDto.getMethod().getName(); |
86 | 82 | }
|
87 | 83 |
|
88 |
| - final String query = super.buildQuery(actionItems, action); |
| 84 | + final String query = super.buildQuery(fields, action); |
89 | 85 | event.setAction(action);
|
90 |
| - event.setEventElements(actionItems); |
| 86 | + event.setFields(fields); |
91 | 87 | super.executeHandlers(handlers, event, query);
|
92 | 88 | }
|
93 | 89 |
|
|
0 commit comments