KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > spap > Application


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 package sync4j.syncclient.spap;
19
20 import java.util.Vector JavaDoc;
21
22 import sync4j.syncclient.sps.common.DataStoreMetadata;
23 import sync4j.syncclient.common.StringTools;
24
25 /**
26  * This class models a SyncClient Conduit application
27  *
28  * @author Stefano Fornari
29  * @version $Id: Application.java,v 1.2 2005/01/19 11:18:36 fabius Exp $
30  */

31 public class Application {
32
33     /**
34      * Creates a new instance of Application. The application is identified by
35      * the given <i>application uri</i>.
36      *
37      * @param uri the application uri
38      *
39      */

40     public Application(String JavaDoc uri) {
41         this.uri = uri;
42         this.dataStoresMetadata = new Vector JavaDoc();
43     }
44
45     /**
46      * The application URI
47      */

48     private String JavaDoc uri;
49
50     public String JavaDoc getUri() {
51         return this.uri;
52     }
53
54     public void setUri(String JavaDoc uri) {
55         this.uri = uri;
56     }
57
58     /**
59      * The displayName property
60      */

61     private String JavaDoc displayName;
62
63     public String JavaDoc getDisplayName() {
64         return this.displayName;
65     }
66
67     public void setDisplayName(String JavaDoc displayName) {
68         this.displayName = displayName;
69     }
70
71     /**
72      * The creatorId property
73      */

74     private String JavaDoc creatorId;
75
76     public String JavaDoc getCreatorId() {
77         return this.creatorId;
78     }
79
80     public void setCreatorId(String JavaDoc creatorId) {
81         this.creatorId = creatorId;
82     }
83
84     /**
85      * The dataStoreType property
86      */

87     private String JavaDoc dataStoreType;
88
89     public String JavaDoc getDataStoreType() {
90         return this.dataStoreType;
91     }
92
93     public void setDataStoreType(String JavaDoc dataStoreType) {
94         this.dataStoreType = dataStoreType;
95     }
96
97     /**
98      * The description property
99      */

100     private String JavaDoc description;
101
102     public String JavaDoc getDescription() {
103         return this.description;
104     }
105
106     public void setDescription(String JavaDoc description) {
107         this.description = description;
108     }
109
110     /**
111      * The supportUrl property
112      */

113     private String JavaDoc supportUrl;
114
115     public String JavaDoc getSupportUrl() {
116         return this.supportUrl;
117     }
118
119     public void setSupportUrl(String JavaDoc supportUrl) {
120         this.supportUrl = supportUrl;
121     }
122
123     /**
124      * The supportEmail property
125      */

126     private String JavaDoc supportEmail;
127
128     public String JavaDoc getSupportEmail() {
129         return this.supportEmail;
130     }
131
132     public void setSupportEmail(String JavaDoc supportEmail) {
133         this.supportEmail = supportEmail;
134     }
135
136     /**
137      * The sync property
138      */

139     private boolean sync;
140
141     public boolean isSync() {
142         return this.sync;
143     }
144
145     public void setSync(boolean sync) {
146         this.sync = sync;
147     }
148     /**
149      * The storeManagerPkg property
150      */

151     private String JavaDoc storeManagerPkg;
152
153     public String JavaDoc getStoreManagerPkg() {
154         return this.storeManagerPkg;
155     }
156
157     public void setStoreManagerPkg(String JavaDoc storeManagerPkg) {
158         this.storeManagerPkg = storeManagerPkg;
159     }
160
161     /**
162      * The dataStoresMetadata property
163      */

164     private Vector JavaDoc dataStoresMetadata;
165
166     public Vector JavaDoc getDataStoresMetadata() {
167         return this.dataStoresMetadata;
168     }
169
170     public void setDataStoresMetadata(Vector JavaDoc storeManagerPkg) {
171         this.dataStoresMetadata = dataStoresMetadata;
172     }
173     
174     /**
175      * The contentId property
176      */

177     private String JavaDoc contentId;
178
179     public String JavaDoc getContentId() {
180         return this.contentId;
181     }
182
183     public void setContentId(String JavaDoc contentId) {
184         this.contentId = contentId;
185     }
186     
187     /**
188      * The author
189      */

190     private String JavaDoc author;
191
192     public String JavaDoc getAuthor() {
193         return this.author;
194     }
195
196     public void setAuthor(String JavaDoc author) {
197         this.author = author;
198     }
199     
200     /**
201      * The version
202      */

203     private String JavaDoc version;
204
205     public String JavaDoc getVersion() {
206         return this.version;
207     }
208
209     public void setVersion(String JavaDoc version) {
210         this.version = version;
211     }
212     
213     /**
214      * The asset the application was installed from
215      */

216     private String JavaDoc assetId;
217
218     public String JavaDoc getAssetId() {
219         return this.assetId;
220     }
221
222     public void setAssetId(String JavaDoc assetId) {
223         this.assetId = assetId;
224     }
225
226     // ---------------------------------------------------------- Public methods
227

228     /**
229      * Returns the application uri after changing special characters to '_'
230      *
231      * @return the fixed application uri
232      */

233     public String JavaDoc getFixedURI() {
234         return StringTools.replaceSpecial(uri);
235     }
236
237     /**
238      * Adds a new data store metadata to the metadata vector
239      *
240      * @param md the DataStoreMetadata object - NOT NULL
241      *
242      */

243     public void addDataStoreMetadata(DataStoreMetadata md) {
244         dataStoresMetadata.addElement(md);
245     }
246
247     /**
248      * Returns the display name
249      *
250      * @return this application's display name
251      */

252     public String JavaDoc toString() {
253         return getDisplayName();
254     }
255
256     // --------------------------------------------------------- Private methods
257
}
Popular Tags