1 18 19 package sync4j.syncclient.spds.event; 20 21 import java.util.Date ; 22 23 31 public class SyncEvent { 32 33 35 36 public static final int SYNC_BEGIN = 0 ; 37 38 39 public static final int SYNC_END = 1 ; 40 41 42 public static final int SYNC_ERROR = 2 ; 43 44 45 public static final int SEND_INITIALIZATION = 3 ; 46 47 48 public static final int SEND_MODIFICATION = 4 ; 49 50 51 public static final int SEND_FINALIZATION = 5 ; 52 53 55 private Throwable cause = null ; 56 private Date date = null ; 57 private String message = null ; 58 private int type = 0 ; 59 60 62 68 public SyncEvent (int type, long date) { 69 70 this.type = type; 71 this.date = new Date (date); 72 73 } 74 75 83 public SyncEvent (int type , 84 long date , 85 String message , 86 Throwable cause ) { 87 88 this.type = type ; 89 this.date = new Date (date) ; 90 this.message = message ; 91 this.cause = cause ; 92 93 } 94 95 97 public Throwable getCause () { 98 return cause; 99 } 100 101 public Date getDate () { 102 return date; 103 } 104 105 public String getMessage () { 106 return message; 107 } 108 109 public int getType () { 110 return type; 111 } 112 113 public void setCause (Throwable cause ) { 114 this.cause = cause ; 115 } 116 117 public void setDate (Date date ) { 118 this.date = date ; 119 } 120 121 public void setMessage (String message) { 122 this.message = message ; 123 } 124 125 public void setType (int type ) { 126 this.type = type ; 127 } 128 129 131 } | Popular Tags |