-
Notifications
You must be signed in to change notification settings - Fork 188
/
Event.java
127 lines (93 loc) · 3.74 KB
/
Event.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.notifications.api.events;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.LightweightIdentifier;
import com.evolveum.midpoint.util.DebugDumpable;
import com.evolveum.midpoint.util.ShortDumpable;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import javax.xml.namespace.QName;
import java.util.Map;
/**
* @author mederly
*/
public interface Event extends DebugDumpable, ShortDumpable {
LightweightIdentifier getId();
boolean isStatusType(EventStatusType eventStatusType);
boolean isOperationType(EventOperationType eventOperationType);
boolean isCategoryType(EventCategoryType eventCategoryType);
boolean isAccountRelated();
boolean isUserRelated();
boolean isWorkItemRelated();
boolean isWorkflowProcessRelated();
boolean isWorkflowRelated();
boolean isPolicyRuleRelated();
boolean isAdd();
boolean isModify();
boolean isDelete();
boolean isSuccess();
boolean isAlsoSuccess();
boolean isFailure();
boolean isOnlyFailure();
boolean isInProgress();
// requester
SimpleObjectRef getRequester();
String getRequesterOid();
void setRequester(SimpleObjectRef requester);
// requestee
SimpleObjectRef getRequestee();
String getRequesteeOid();
void setRequestee(SimpleObjectRef requestee);
void createExpressionVariables(Map<QName, Object> variables, OperationResult result);
/**
* Checks if the event is related to an item with a given path.
* The meaning of the result depends on a kind of event (focal, resource object, workflow)
* and on operation (add, modify, delete).
*
* Namely, this method is currently defined for ADD and MODIFY (not for DELETE) operations,
* for focal and resource objects events (not for workflow ones).
*
* For MODIFY it checks whether an item with a given path is touched.
* For ADD it checks whether there is a value for an item with a given path in the object created.
*
* For unsupported events the method returns false.
*
* Paths are compared without taking ID segments into account.
*
* EXPERIMENTAL; does not always work (mainly for values being deleted)
*
* @param itemPath
* @return
*/
boolean isRelatedToItem(ItemPath itemPath);
String getChannel();
/**
* If needed, we can prescribe the handler that should process this event. It is recommended only for ad-hoc situations.
* A better is to define handlers in system configuration.
*/
EventHandlerType getAdHocHandler();
/**
* Returns plaintext focus password value, if known.
* Beware: might not always work correctly:
* 1. If the change execution was only partially successful, the value returned might or might not be stored in the repo
* 2. If the password was changed to null, the 'null' value is returned. So the caller cannot distinguish it from "no change"
* situation. A new method for this would be needed.
*/
default String getFocusPassword() {
return null;
}
}