1 16 package org.apache.cocoon.components.notification; 17 18 import java.util.HashMap ; 19 import java.util.Map ; 20 21 27 public class SimpleNotifyingBean implements Notifying { 28 29 32 private String type = "unknown"; 33 34 37 private String title = "Generic notification"; 38 39 42 private String source = getClass().getName(); 43 44 47 private String sender = "unknown"; 48 49 52 private String message = "Message not known."; 53 54 57 private String description = ""; 58 59 62 private Map extraDescriptions = new HashMap (); 63 64 65 public SimpleNotifyingBean() { 66 } 67 68 public SimpleNotifyingBean(Object sender) { 69 this.sender = sender.getClass().getName(); 70 } 71 72 77 public void setType(String type) { 78 this.type = type; 79 } 80 81 86 public void setTitle(String title) { 87 this.title = title; 88 } 89 90 95 public void setSource(String source) { 96 this.source = source; 97 } 98 99 104 public void setMessage(String message) { 105 this.message = message; 106 } 107 108 113 public void setDescription(String description) { 114 this.description = description; 115 } 116 117 123 public void addExtraDescription(String extraDescriptionDescription, 124 String extraDescription) { 125 this.extraDescriptions.put(extraDescriptionDescription, extraDescription); 126 } 127 128 131 protected void replaceExtraDescriptions(Map extraDescriptions) { 132 this.extraDescriptions = extraDescriptions; 133 } 134 135 138 protected void addExtraDescriptions(Map extraDescriptions) { 139 if (this.extraDescriptions == null) { 140 replaceExtraDescriptions(extraDescriptions); 141 } else { 142 this.extraDescriptions.putAll(extraDescriptions); 143 } 144 } 145 146 149 public String getType() { 150 return type; 151 } 152 153 156 public String getTitle() { 157 return title; 158 } 159 160 163 public String getSource() { 164 return source; 165 } 166 167 170 public String getSender() { 171 return sender; 172 } 173 174 177 public String getMessage() { 178 return message; 179 } 180 181 184 public String getDescription() { 185 return description; 186 } 187 188 191 public Map getExtraDescriptions() { 192 return extraDescriptions; 193 } 194 } 195 | Popular Tags |