1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kew.actions;
18
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.rice.kew.actionrequest.ActionRequestValue;
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 public class AdHocRevoke implements java.io.Serializable {
39
40 private static final long serialVersionUID = 8536540010313763068L;
41
42 private Long actionRequestId;
43 private String nodeName;
44 private String principalId;
45 private String groupId;
46
47 public AdHocRevoke() {}
48
49 public Long getActionRequestId() {
50 return actionRequestId;
51 }
52 public void setActionRequestId(Long actionRequestId) {
53 this.actionRequestId = actionRequestId;
54 }
55 public String getNodeName() {
56 return nodeName;
57 }
58 public void setNodeName(String nodeName) {
59 this.nodeName = nodeName;
60 }
61 public String getPrincipalId() {
62 return principalId;
63 }
64 public void setPrincipalId(String principalId) {
65 this.principalId = principalId;
66 }
67
68
69
70
71 public boolean matchesActionRequest(ActionRequestValue actionRequest) {
72 if (!actionRequest.isAdHocRequest()) {
73 return false;
74 }
75 if (getActionRequestId() != null && !getActionRequestId().equals(actionRequest.getActionRequestId()) ){
76 return false;
77 }
78 if (!StringUtils.isEmpty(getNodeName()) && !getNodeName().equals(actionRequest.getNodeInstance().getName())) {
79 return false;
80 }
81 if (getPrincipalId() != null && (!actionRequest.isUserRequest() || !actionRequest.getPrincipalId().equals(getPrincipalId()))) {
82 return false;
83 }
84 if (getGroupId() != null && (!actionRequest.isGroupRequest() || !actionRequest.getGroupId().equals(getGroupId()))) {
85 return false;
86 }
87 return true;
88 }
89
90
91
92
93 public String getGroupId() {
94 return this.groupId;
95 }
96
97
98
99
100 public void setGroupId(String groupId) {
101 this.groupId = groupId;
102 }
103
104 }