KickJava   Java API By Example, From Geeks To Geeks.

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


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 sync4j.syncclient.spds.engine.SyncItemKey;
22
23 /**
24  * Is used to notify the listeners
25  * received a status command.
26  *
27  * @author Fabio Maggi
28  *
29  * @version $Id: SyncStatusEvent.java,v 1.2 2005/01/19 11:18:36 fabius Exp $
30  */

31 public class SyncStatusEvent {
32
33     // -------------------------------------------------------- Constants
34

35     /** Create status to send to the server */
36     public static final int STATUS_TO_SEND = 0 ;
37
38     /** Received status from the server */
39     public static final int STATUS_RECEIVED = 1 ;
40
41
42     // -------------------------------------------------------- Private data
43

44     private int type = 0 ;
45     private String JavaDoc command = null ;
46     private int statusCode = 0 ;
47     private SyncItemKey itemKey = null ;
48     private String JavaDoc sourceUri = null ;
49
50     // -------------------------------------------------------- Constructors
51

52     /**
53      * Creates a SyncStatusEvent
54      *
55      * @param type the event type
56      * @param command the command the status relates to
57      * @param statusCode the status code
58      * @param itemKey the key of the item this status relates to
59      * @param sourceUri the uri of the syncsource
60      */

61     public SyncStatusEvent(int type ,
62                            String JavaDoc command ,
63                            int statusCode ,
64                            SyncItemKey itemKey ,
65                            String JavaDoc sourceUri ) {
66
67         this.type = type ;
68         this.command = command ;
69         this.statusCode = statusCode ;
70         this.itemKey = itemKey ;
71         this.sourceUri = sourceUri ;
72
73     }
74
75     // -------------------------------------------------------- Public methods
76

77     public int getType () {
78         return type;
79     }
80
81     public String JavaDoc getCommand () {
82         return command;
83     }
84
85     public SyncItemKey getItemKey () {
86         return itemKey;
87     }
88
89     public String JavaDoc getSourceUri () {
90         return sourceUri;
91     }
92
93     public int getStatusCode () {
94         return statusCode;
95     }
96
97
98     public void setType (int type ) {
99         this.type = type ;
100     }
101
102     public void setCommand (String JavaDoc command ) {
103         this.command = command ;
104     }
105
106     public void setItemKey (SyncItemKey itemKey ) {
107         this.itemKey = itemKey ;
108     }
109
110     public void setSourceUri (String JavaDoc sourceUri ) {
111         this.sourceUri = sourceUri ;
112     }
113
114     public void setStatusCode (int statusCode ) {
115         this.statusCode = statusCode ;
116     }
117
118     // -------------------------------------------------------- Private methods
119

120 }
Popular Tags