1 package net.javacoding.jspider.api.event; 2 3 4 import java.util.Date ; 5 6 7 16 public abstract class JSpiderEvent implements EventVisitable { 17 18 public static final String EVENT_PACKAGE = "net.javacoding.jspider.api.event."; 19 20 21 public static final int EVENT_TYPE_ENGINE = 1; 22 23 24 public static final int EVENT_TYPE_MONITORING = 2; 25 26 27 public static final int EVENT_TYPE_SPIDER = 3; 28 29 30 protected Date date; 31 32 33 36 public JSpiderEvent() { 37 date = new Date (); 38 } 39 40 44 public String getName() { 45 return getClass().getName().substring(EVENT_PACKAGE.length()); 46 } 47 48 52 public Date getRaisedDate() { 53 return date; 54 } 55 56 60 public abstract String getComment(); 61 62 66 public boolean isError ( ) { 67 return false; 68 } 69 70 75 public boolean isFilterable ( ) { 76 return true; 77 } 78 79 83 public int getType ( ) { 84 return JSpiderEvent.EVENT_TYPE_SPIDER; 86 } 87 88 92 public void accept(EventVisitor visitor) { 93 visitor.visit(this); 94 } 95 96 100 public String toString() { 101 return this.getClass().getName(); 102 } 103 } 104 | Popular Tags |