1 19 20 package com.sslexplorer.notification; 21 22 import java.util.ArrayList ; 23 import java.util.Iterator ; 24 import java.util.List ; 25 import java.util.Properties ; 26 27 28 39 public class Message { 40 41 43 private String subject; 44 private String content; 45 private List <Recipient> recipients; 46 private boolean urgent; 47 private long id; 48 private String sinkName; 49 private Properties parameters; 50 private String lastMessage; 51 52 59 public Message(String subject, String content, boolean urgent) { 60 this.subject = subject; 61 this.content = content; 62 this.urgent = urgent; 63 recipients = new ArrayList <Recipient>(); 64 parameters = new Properties (); 65 lastMessage = ""; 66 } 67 68 76 public Message(String subject, String content, boolean urgent, Recipient recipient) { 77 this(subject, content, urgent); 78 recipients.add(recipient); 79 } 80 81 84 public long getId() { 85 return id; 86 } 87 88 91 public void setId(long id) { 92 this.id = id; 93 } 94 95 102 public void setParameter(String key, String value) { 103 parameters.setProperty(key, value); 104 } 105 106 113 public String getParameter(String key) { 114 return parameters.getProperty(key); 115 } 116 117 125 public String getParameter(String key, String defaultValue) { 126 return parameters.getProperty(key, defaultValue); 127 } 128 129 134 public Iterator getParameterNames() { 135 return parameters.keySet().iterator(); 136 } 137 138 143 public String getContent() { 144 return content; 145 } 146 147 152 public void setContent(String content) { 153 this.content = content; 154 } 155 156 161 public List <Recipient> getRecipients() { 162 return recipients; 163 } 164 165 170 public void setRecipients(List <Recipient> recipients) { 171 this.recipients = recipients; 172 } 173 174 179 public String getSubject() { 180 return subject; 181 } 182 183 188 public void setSubject(String subject) { 189 this.subject = subject; 190 } 191 192 198 public boolean isUrgent() { 199 return urgent; 200 } 201 202 208 public void setUrgent(boolean urgent) { 209 this.urgent = urgent; 210 } 211 212 217 public String getSinkName() { 218 return sinkName; 219 } 220 221 227 public String getLastMessage() { 228 return lastMessage; 229 } 230 231 232 238 public void setLastMessage(String lastMessage) { 239 this.lastMessage = lastMessage; 240 } 241 242 243 protected void setSinkName(String sinkName) { 244 this.sinkName = sinkName; 245 } 246 } 247 | Popular Tags |