1 23 24 package org.dbforms.config; 25 26 import org.apache.commons.logging.Log; 27 import org.apache.commons.logging.LogFactory; 28 29 import org.dbforms.util.Util; 30 31 import java.io.Serializable ; 32 import java.util.Properties ; 33 34 35 36 42 public class EventInfo implements Serializable { 43 44 private static Log logCat = LogFactory.getLog(EventInfo.class.getName()); 45 private Properties properties = null; 46 private String className = null; 47 private String id = null; 48 private String type = null; 49 50 53 public EventInfo() { 54 properties = new Properties (); 55 } 56 57 58 64 public EventInfo(String type, 65 String className) { 66 this(); 67 this.type = type; 68 this.className = className; 69 } 70 71 76 public void setClassName(String className) { 77 this.className = className; 78 } 79 80 81 86 public String getClassName() { 87 return className; 88 } 89 90 91 96 public void setId(String id) { 97 this.id = id; 98 } 99 100 101 106 public String getId() { 107 return (!Util.isNull(id)) ? id 109 : type; 110 } 111 112 113 118 public Properties getProperties() { 119 return properties; 120 } 121 122 123 128 public void setType(String type) { 129 this.type = type; 130 } 131 132 133 138 public String getType() { 139 return type; 140 } 141 142 143 148 public void addProperty(DbConnectionProperty property) { 149 String name = property.getName(); 150 String value = property.getValue(); 151 properties.put(name, value); 152 logCat.info("::addProperty - added the property [" + name + ", " + value 153 + "] to event [" + getId() + "]"); 154 } 155 156 157 162 public String toString() { 163 return new StringBuffer ("event: id = ").append(getId()) 164 .append("; type = ") 165 .append(type) 166 .append("; className = ") 167 .append(className) 168 .toString(); 169 } 170 } 171 | Popular Tags |