1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ken.bo;
17
18 import org.kuali.rice.ken.api.notification.NotificationResponse;
19 import org.kuali.rice.ken.api.notification.NotificationResponseContract;
20 import org.kuali.rice.ken.util.NotificationConstants;
21 import org.kuali.rice.kim.api.permission.Permission;
22 import org.kuali.rice.kim.impl.permission.PermissionTemplateBo;
23
24
25
26
27
28
29
30
31
32 public class NotificationResponseBo implements NotificationResponseContract {
33
34 private String status;
35
36 private String message;
37
38 private Long notificationId;
39
40
41
42
43 public NotificationResponseBo() {
44 status = NotificationConstants.RESPONSE_STATUSES.SUCCESS;
45 }
46
47
48
49
50
51 public String getStatus() {
52 return status;
53 }
54
55
56
57
58
59 public void setStatus(String status) {
60 this.status = status;
61 }
62
63
64
65
66
67
68 public String getMessage() {
69 return message;
70 }
71
72
73
74
75
76 public void setMessage(String message) {
77 this.message = message;
78 }
79
80
81
82
83
84 public Long getNotificationId() {
85 return notificationId;
86 }
87
88
89
90
91
92 public void setNotificationId(Long notificationId) {
93 this.notificationId = notificationId;
94 }
95
96
97
98
99
100
101 public static NotificationResponse to(NotificationResponseBo bo) {
102 if (bo == null) {
103 return null;
104 }
105
106 return NotificationResponse.Builder.create(bo).build();
107 }
108
109
110
111
112
113
114 public static NotificationResponseBo from(NotificationResponse im) {
115 if (im == null) {
116 return null;
117 }
118
119 NotificationResponseBo bo = new NotificationResponseBo();
120 bo.setMessage(im.getMessage());
121 bo.setNotificationId(im.getNotificationId());
122 bo.setStatus(im.getStatus());
123
124 return bo;
125 }
126 }