KickJava   Java API By Example, From Geeks To Geeks.

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


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 sending of data to the server
26  * and of the reception of data from the server.
27  *
28  * @author Fabio Maggi
29  *
30  * @version $Id: SyncTransportEvent.java,v 1.2 2005/01/19 11:18:36 fabius Exp $
31  */

32 public class SyncTransportEvent {
33
34
35     // -------------------------------------------------------- Constants
36

37     /** Engine started to send data to the server */
38     public static final int SEND_DATA_BEGIN = 0 ;
39
40     /** Engine has sent all data to the server */
41     public static final int SEND_DATA_END = 1 ;
42
43     /** Engine started to receive data from the server */
44     public static final int RECEIVE_DATA_BEGIN = 2 ;
45
46     /** Engine is receiving data from the server */
47     public static final int DATA_RECEIVED = 3 ;
48
49     /** Engine has received all data from the server */
50     public static final int RECEIVE_DATA_END = 4 ;
51
52     // -------------------------------------------------------- Private data
53

54     private int data = 0 ;
55     private int type = 0 ;
56
57     // -------------------------------------------------------- Constructors
58

59     /**
60      * Creates a SyncTransportEvent
61      *
62      * @param type the event type
63      * @param data the data length
64      */

65     public SyncTransportEvent(int type ,
66                               int data ) {
67         this.type = type ;
68         this.data = data ;
69     }
70
71     // -------------------------------------------------------- Public methods
72

73     public int getData () {
74         return data;
75     }
76
77     public int getType () {
78         return type;
79     }
80
81     public void setData (int data ) {
82         this.data = data ;
83     }
84
85     public void setType (int type ) {
86         this.type = type ;
87     }
88
89     // -------------------------------------------------------- Private methods
90

91 }
Popular Tags