public AlertEmailSender(AlertEmailContext alertEmail){ this.recipents = alertEmail.getRecipients(); this.configFileName = alertEmail.getVelocityTplFile(); this.subject = alertEmail.getSubject(); this.sender = alertEmail.getSender(); this.cc = alertEmail.getCc(); for(AlertEmailComponent bean : alertEmail.getComponents()){ this.alertContexts.add(bean.getAlertContext().getProperties()); } String tmp = ManagementFactory.getRuntimeMXBean().getName(); this.origin = tmp.split("@")[1] + "(pid:" + tmp.split("@")[0] + ")"; threadName = Thread.currentThread().getName(); LOG.info("Initialized "+threadName+": origin is : " + this.origin+", recipient of the email: " + this.recipents+", velocity TPL file: " + this.configFileName); }
public AlertEmailSender(AlertEmailContext alertEmail){ this.recipents = alertEmail.getRecipients(); this.configFileName = alertEmail.getVelocityTplFile(); this.subject = alertEmail.getSubject(); this.sender = alertEmail.getSender(); this.cc = alertEmail.getCc(); for(AlertEmailComponent bean : alertEmail.getComponents()){ this.alertContexts.add(bean.getAlertContext().getProperties()); } String tmp = ManagementFactory.getRuntimeMXBean().getName(); this.origin = tmp.split("@")[1] + "(pid:" + tmp.split("@")[0] + ")"; threadName = Thread.currentThread().getName(); LOG.info("Initialized "+threadName+": origin is : " + this.origin+", recipient of the email: " + this.recipents+", velocity TPL file: " + this.configFileName); }
@Override public byte[] serialize(AlertContext context) { final Map<String, String> pair = context.getProperties(); int totalSize = 4; for (Entry<String, String> entry : pair.entrySet()) {
String prefix = ""; for (Entry<String, String> entry : context.getProperties().entrySet()) { String key = entry.getKey(); String value = entry.getValue();