KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > spds > event > SyncSourceEvent


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.syncclient.spds.event;
20
21 import java.util.Date JavaDoc;
22
23 /**
24  * Is used to notify the listeners
25  * of the beginning and the end
26  * of the synchronization
27  * of a particolar syncsource.
28  *
29  * @author Fabio Maggi
30  *
31  * @version $Id: SyncSourceEvent.java,v 1.2 2005/01/19 11:18:36 fabius Exp $
32  */

33 public class SyncSourceEvent {
34
35     // -------------------------------------------------------- Constants
36

37     /** SyncSource Synchronization begin */
38     public static final int SYNC_BEGIN = 0 ;
39
40     /** SyncSource Synchronization end */
41     public static final int SYNC_END = 1 ;
42
43     // -------------------------------------------------------- Private data
44

45     private Date JavaDoc date = null ;
46     private String JavaDoc sourceUri = null ;
47     private int syncMode = 0 ;
48     private int type = 0 ;
49
50     // -------------------------------------------------------- Constructors
51

52     /**
53      * Creates a SyncSourceEvent
54      *
55      * @param type the event type
56      * @param sourceUri the uri of the syncsource
57      * @param syncMode the type of the performed sync
58      * @param date the date and time of the start or the end of the sync
59      */

60     public SyncSourceEvent(int type ,
61                            String JavaDoc sourceUri ,
62                            int syncMode ,
63                            long date ) {
64
65         this.type = type ;
66         this.sourceUri = sourceUri ;
67         this.syncMode = syncMode ;
68         this.date = new Date JavaDoc(date) ;
69
70     }
71
72     // -------------------------------------------------------- Public methods
73

74     public Date JavaDoc getDate () {
75         return date;
76     }
77
78     public String JavaDoc getSourceUri () {
79         return sourceUri;
80     }
81
82     public int getSyncMode () {
83         return syncMode;
84     }
85
86     public int getType () {
87         return type;
88     }
89
90     public void setDate (Date JavaDoc date ) {
91         this.date = date;
92     }
93
94     public void setSourceUri (String JavaDoc sourceUri ) {
95         this.sourceUri = sourceUri;
96     }
97
98     public void setSyncMode (int syncMode ) {
99         this.syncMode = syncMode;
100     }
101
102     public void setType (int type ) {
103         this.type = type;
104     }
105
106     // -------------------------------------------------------- Private methods
107

108 }
Popular Tags