1 13 package org.ejbca.ui.web.admin.services.servicetypes; 14 15 import java.io.IOException ; 16 import java.util.ArrayList ; 17 import java.util.Properties ; 18 19 import org.ejbca.core.model.services.actions.MailAction; 20 21 28 public class MailActionType extends ActionType { 29 30 public static final String NAME = "MAILNOTIFICATIONACTION"; 31 32 public MailActionType(){ 33 super("mailaction.jsp", NAME, true); 34 } 35 36 private String senderAddress = ""; 37 private String recieverAddress = ""; 38 39 public String getRecieverAddress() { 40 return recieverAddress; 41 } 42 43 44 public void setRecieverAddress(String recieverAddress) { 45 this.recieverAddress = recieverAddress; 46 } 47 48 49 public String getSenderAddress() { 50 return senderAddress; 51 } 52 53 54 public void setSenderAddress(String senderAddress) { 55 this.senderAddress = senderAddress; 56 } 57 58 59 60 61 62 65 public String getClassPath() { 66 return "org.ejbca.core.model.services.actions.MailAction"; 67 } 68 69 72 public Properties getProperties(ArrayList errorMessages) throws IOException { 73 Properties properties = new Properties (); 74 if(senderAddress == null || senderAddress.trim().equals("")){ 75 errorMessages.add("MAILACTIONSENDERADDRESSERR"); 76 } 77 properties.setProperty(MailAction.PROP_SENDERADDRESS, senderAddress); 78 properties.setProperty(MailAction.PROP_RECIEVERADDRESS, recieverAddress); 79 80 return properties; 81 } 82 83 86 public boolean isCustom() { 87 return false; 88 } 89 90 93 public void setProperties(Properties properties) throws IOException { 94 senderAddress = properties.getProperty(MailAction.PROP_SENDERADDRESS, ""); 95 recieverAddress = properties.getProperty(MailAction.PROP_RECIEVERADDRESS, ""); 96 97 } 98 99 } 100 | Popular Tags |