1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kcb.deliverer.impl;
17
18 import java.util.HashMap;
19 import java.util.LinkedHashMap;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.apache.log4j.Logger;
23 import org.kuali.rice.kcb.bo.MessageDelivery;
24 import org.kuali.rice.kcb.deliverer.MessageDeliverer;
25 import org.kuali.rice.kcb.exception.ErrorList;
26 import org.kuali.rice.kcb.exception.MessageDeliveryException;
27 import org.kuali.rice.kcb.exception.MessageDismissalException;
28
29
30
31
32
33
34 public class AOLInstantMessageDeliverer implements MessageDeliverer {
35 private static Logger LOG = Logger.getLogger(AOLInstantMessageDeliverer.class);
36
37 private static final String SCREEN_NAME = "aim_screen_name";
38
39
40
41
42 public AOLInstantMessageDeliverer() {
43 }
44
45
46
47
48 public void deliver(MessageDelivery messageDelivery) throws MessageDeliveryException {
49 }
50
51
52
53
54 public void dismiss(MessageDelivery messageDelivery, String user, String cause) throws MessageDismissalException {
55 }
56
57
58
59
60 public String getDescription() {
61 return "This is the default AOL Instant Messenger delivery type.";
62 }
63
64
65
66
67 public String getName() {
68 return "AIM";
69 }
70
71
72
73
74 public String getTitle() {
75 return "AOL Instant Messenger Delivery";
76 }
77
78
79
80
81
82 public LinkedHashMap getPreferenceKeys() {
83 LinkedHashMap<String, String> prefKeys = new LinkedHashMap<String, String>();
84 prefKeys.put(SCREEN_NAME, "AIM Screen Name");
85 return prefKeys;
86 }
87
88
89
90
91 public void validatePreferenceValues(HashMap prefs) throws ErrorList {
92 boolean error = false;
93 ErrorList errorList = new ErrorList();
94
95 if (!prefs.containsKey(getName()+"."+SCREEN_NAME)) {
96 errorList.addError("AIM Screen Name is a required field.");
97 error = true;
98 } else {
99 String screenName = (String) prefs.get(getName()+"."+SCREEN_NAME);
100 if(StringUtils.isBlank(screenName)) {
101 errorList.addError("AIM Screen Name is a required.");
102 error = true;
103 }
104 }
105 if (error) throw errorList;
106 }
107 }