KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > engine > MessageSizeCalculator


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.framework.engine;
20
21 import sync4j.framework.core.*;
22
23 /**
24  * This interface defines the functionality of a SyncML message size calculator.
25  *
26  * @author Stefano Fornari
27  *
28  * @version $Id: MessageSizeCalculator.java,v 1.8 2005/04/29 15:29:12 nichele Exp $
29  */

30 public interface MessageSizeCalculator {
31
32     // ---------------------------------------------------------- Public Methods
33
/**
34      * Returns the default overhead for the SyncML message
35      *
36      * @return overhead for SyncML message
37      */

38     public long getMsgSizeOverhead();
39     // ------------------------------------------------------------------ SyncML
40

41     /**
42      * Returns the WBXML overhead for SyncML object
43      * sizeof(<SyncML xmlns='SYNCML:SYNCML1.1'>\n</SyncML>\n)
44      *
45      * @return overhead for SyncML object
46      */

47     public long getSyncMLOverhead();
48
49     /**
50      * Returns the WBXML size of the SyncML object
51      *
52      * @param syncML the SyncML element
53      *
54      * @return size the WBXML size of the SyncML element
55      */

56     public long getSize(SyncML syncML);
57
58     // ----------------------------------------------------------------- SyncHdr
59

60     /**
61      * Returns the WBXML size of the SyncHdr object
62      *
63      * @param syncHdr the SyncHdr element
64      *
65      * @return size the WBXML size of the SyncHdr element
66      */

67     public long getSize(SyncHdr syncHdr);
68
69     /**
70      * Returns the overhead of the RespURI element.
71      *
72      * @return the overhead of the RespURI element.
73      */

74     public long getRespURIOverhead();
75
76     // ---------------------------------------------------------------- SyncBody
77

78     /**
79      * Returns the WBXML overhead for SyncBody object
80      * sizeof(<SyncBody>\n</SyncBody>\n)
81      *
82      * @return overhead for SyncBody object
83      */

84     public long getSyncBodyOverhead();
85
86     /**
87      * Returns the WBXML size of the SyncBody object
88      *
89      * @param syncBody the SyncBody element
90      *
91      * @return size the WBXML size of the SyncBody element
92      */

93     public long getSize(SyncBody syncBody);
94
95     // ------------------------------------------------------------------ VerDTD
96

97     /**
98      * Returns the WBXML size of VerDTD object
99      *
100      * @return the WBXML size of VerDTD object
101      */

102     public long getSize(VerDTD verDTD);
103
104     // ---------------------------------------------------------------- VerProto
105
/**
106      * Returns the WBXML size of VerProto object
107      *
108      * @return the WBXML size of VerProto object
109      */

110     public long getSize(VerProto verProto);
111
112     // --------------------------------------------------------------- SessionID
113

114     /**
115      * Returns the WBXML size of SessionID object
116      *
117      * @return the WBXML size of SessionID object
118      */

119     public long getSize(SessionID sessionID);
120
121     // ------------------------------------------------------------------ Target
122

123     /**
124      * Returns the WBXML size of this element.
125      * @return the WBXML size of this element
126      */

127     public long getSize(Target target);
128
129     // ------------------------------------------------------------------ Source
130

131     /**
132      * Returns the WBXML size of this element.
133      * @return the WBXML size of this element
134      */

135     public long getSize(Source source);
136
137     // -------------------------------------------------------------------- Cred
138

139     /**
140      * Returns the WBXML size of this element.
141      * @return the WBXML size of this element
142      */

143     public long getSize(Cred cred);
144
145     // -------------------------------------------------------------------- Meta
146

147     /**
148      * Returns the WBXML size of this object.
149      *
150      * @return the WBXML size of this object
151      */

152     public long getSize(Meta meta);
153
154     // ------------------------------------------------------------------ Anchor
155

156     /**
157      * Returns the WBXML size of this element.
158      *
159      * @return the WBXML size of this element
160      */

161     public long getSize(Anchor anchor);
162
163     // --------------------------------------------------------------------- EMI
164
/**
165      * Returns the WBXML size of EMI element.
166      *
167      * @return the WBXML size of EMI element
168      */

169     public long getSize(EMI emi);
170
171     // --------------------------------------------------------------- NextNonce
172
/**
173      * Returns the WBXML size of NextNonce element.
174      *
175      * @return the WBXML size of NextNonce element
176      */

177     public long getSize(NextNonce nextNonce);
178
179     // --------------------------------------------------------------------- Mem
180
/**
181      * Returns the WBXML size of Mem object.
182      *
183      * @return the WBXML size of Mem object
184      */

185     public long getSize(Mem mem);
186
187     // --------------------------------------------------------- AbstractCommand
188
/**
189      * Returns the WBXML size of AbstractCommand object.
190      * @return the WBXML size of AbstractCommand object
191      */

192     public long getSize(AbstractCommand command);
193
194     /**
195      * Gets the XML size of the command
196      *
197      * @return the XML size of the command
198      */

199     public long getCommandSize(AbstractCommand command);
200
201     // ------------------------------------------------------------------- CmdID
202
/**
203      * Returns the WBXML size of CmdID element.
204      * @return the WBXML size of CmdID element
205      */

206     public long getSize(CmdID cmdID);
207
208     // --------------------------------------------------------------------- Add
209
/**
210      * Returns the WBXML size of Add element.
211      *
212      * @return the WBXML size of Add element
213      */

214     public long getSize(Add add);
215
216     // -------------------------------------------------------------------- Item
217
/**
218      * Returns the WBXML size of Item element.
219      * @return the WBXML size of Item element
220      */

221     public long getSize(Item item);
222
223     // ------------------------------------------------------------- ComplexData
224
/**
225      * Returns the WBXML size of ComplexData element.
226      *
227      * @return the WBXML size of ComplexData element
228      */

229     public long getSize(ComplexData complexData);
230
231     // -------------------------------------------------------------------- Data
232
/**
233      * Returns the WBXML size of Data element.
234      *
235      * @return the WBXML size of Data element
236      */

237     public long getSize(Data data);
238
239     // -------------------------------------------------------------- DevInfData
240
/**
241      * Returns the WBXML size of DevInfData element.
242      *
243      * @return the WBXML size of DevInfData element
244      */

245     public long getSize(DevInfData devInfData);
246
247     // ------------------------------------------------------------------ DevInf
248
/**
249      * Returns the WBXML size of DevInf element.
250      *
251      * @return the WBXML size of DevInf element
252      */

253     public long getSize(DevInf devInf);
254
255     // --------------------------------------------------------------- DataStore
256
/**
257      * Returns the WBXML size of DataStore element.
258      *
259      * @return the WBXML size of DataStore element
260      */

261     public long getSize(DataStore dataStore);
262
263     // --------------------------------------------------------- ContentTypeInfo
264
/**
265      * Returns the WBXML size of ContentTypeInfo element.
266      *
267      * @return the WBXML size of ContentTypeInfo element
268      */

269     public long getSize(ContentTypeInfo contentTypeInfo);
270
271     // --------------------------------------------------------------- SourceRef
272
/**
273      * Returns the WBXML size of SourceRef element.
274      * @return the WBXML size of SourceRef element
275      */

276     public long getSize(SourceRef sourceRef);
277
278     // ------------------------------------------------------------------- DSMem
279
/**
280      * Returns the WBXML size of DSMem element
281      *
282      * @return the WBXML size of DSMem element
283      */

284     public long getSize(DSMem dsMem);
285
286     // ----------------------------------------------------------------- SyncCap
287
/**
288      * Returns the WBXML size of SyncCap object.
289      *
290      * @return the WBXML size of SyncCap object
291      */

292     public long getSize(SyncCap syncCap);
293
294     // ---------------------------------------------------------------- SyncType
295
/**
296      * Returns the WBXML size of SyncType object.
297      *
298      * @return the WBXML size of SyncType object
299      */

300     public long getSize(SyncType syncType);
301
302     // ------------------------------------------------------------------- CTCap
303

304     /**
305      * Returns the WBXML size of CTCap element.
306      *
307      * @return the WBXML size of CTCap element
308      */

309     public long getSize(CTCap ctCap);
310
311     // --------------------------------------------------------- CTTypeSupported
312

313     /**
314      * Returns the WBXML size of this element.
315      *
316      * @return the WBXML size of this element
317      */

318     public long getSize(CTTypeSupported ctTypeSupported);
319
320     // ------------------------------------------------------------- CTPropParam
321
/**
322      * Returns the WBXML size of CTPropParam element.
323      *
324      * @return the WBXML size of CTPropParam element
325      */

326     public long getSize(CTPropParam ctPropParam);
327
328     // ---------------------------------------------------- ContentTypeParameter
329
/**
330      * Returns the WBXML size of ContentTypeParameter element.
331      *
332      * @return the WBXML size of ContentTypeParameter element
333      */

334     public long getSize(ContentTypeParameter ctParameter);
335
336     // --------------------------------------------------------------------- Ext
337

338     /**
339      * Returns the WBXML size of Ext element.
340      *
341      * @return the WBXML size of Ext element
342      */

343     public long getSize(Ext ext);
344
345     // ------------------------------------------------------------------- Alert
346

347     /**
348      * Returns the WBXML size of Alert element.
349      *
350      * @return the WBXML size of Alert element
351      */

352     public long getSize(Alert alert);
353
354     // ------------------------------------------------------------------ Atomic
355

356     /**
357      * Returns the WBXML size of Atomic element.
358      *
359      * @return the WBXML size of Atomic element
360      */

361     public long getSize(Atomic atomic);
362
363     // -------------------------------------------------------------------- Copy
364

365     /**
366      * Returns the WBXML size of Copy element.
367      *
368      * @return the WBXML size of Copy element
369      */

370     public long getSize(Copy copy);
371
372     // ------------------------------------------------------------------ Delete
373
/**
374      * Returns the WBXML size of Delete element.
375      *
376      * @return the WBXML size of Delete element
377      */

378     public long getSize(Delete delete);
379
380     // -------------------------------------------------------------------- Exec
381

382     /**
383      * Returns the WBXML size of Exec element.
384      *
385      * @return the WBXML size of Exec element
386      */

387     public long getSize(Exec exec);
388
389     // --------------------------------------------------------------------- Get
390

391     /**
392      * Returns the WBXML size of Get element.
393      *
394      * @return the WBXML size of Get element
395      */

396     public long getSize(Get get);
397
398     // --------------------------------------------------------------------- Map
399

400     /**
401      * Returns the WBXML size of Map element.
402      *
403      * @return the WBXML size of Map element
404      */

405     public long getSize(Map map);
406
407     // ----------------------------------------------------------------- MapItem
408

409     /**
410      * Returns the WBXML size of MapItem element.
411      *
412      * @return the WBXML size of MapItem element
413      */

414     public long getSize(MapItem mapItem);
415
416     // --------------------------------------------------------------------- Put
417

418     /**
419      * Returns the WBXML size of Put element.
420      *
421      * @return the WBXML size of Put element
422      */

423     public long getSize(Put put);
424
425     // -------------------------------------------------------------- DevInfItem
426
/**
427      * Returns the WBXML size of Item element.
428      * @return the WBXML size of Item element
429      */

430     public long getSize(DevInfItem devInfItem);
431
432     // ----------------------------------------------------------------- Replace
433
/**
434      * Returns the WBXML size of Replace element.
435      *
436      * @return the WBXML size of Replace element
437      */

438     public long getSize(Replace replace);
439
440     // ----------------------------------------------------------------- Results
441
/**
442      * Returns the WBXML size of Results element.
443      *
444      * @return the WBXML size of Results element
445      */

446     public long getSize(Results results);
447
448     // --------------------------------------------------------------- TargetRef
449
/**
450      * Returns the WBXML size of TargetRef element.
451      * @return the WBXML size of TargetRef element
452      */

453     public long getSize(TargetRef targetRef);
454
455     // ------------------------------------------------------------------ Search
456
/**
457      * Returns the WBXML size of Search element.
458      *
459      * @return the WBXML size of Search element
460      */

461     public long getSize(Search search);
462
463     // ---------------------------------------------------------------- Sequence
464
/**
465      * Returns the WBXML size of Sequence element.
466      *
467      * @return the WBXML size of Sequence element
468      */

469     public long getSize(Sequence sequence);
470
471     // ------------------------------------------------------------------ Status
472
/**
473      * Returns the WBXML size of Status element.
474      *
475      * @return the WBXML size of Status element
476      */

477     public long getSize(Status status);
478
479     // -------------------------------------------------------------------- Chal
480

481     /**
482      * Returns the WBXML size of Chal element.
483      *
484      * @return the WBXML size of Chal element
485      */

486     public long getSize(Chal chal);
487
488     // -------------------------------------------------------------------- Sync
489

490     /**
491      * Returns the WBXML size of Sync element.
492      *
493      * @return the WBXML size of Sync element
494      */

495     public long getSize(Sync sync);
496
497     // --------------------------------------------------------- ItemizedCommand
498

499     /**
500      * Returns the WBXML size of the ItemizedCommand element
501      */

502     public long getSize(ItemizedCommand itemCmd);
503
504     // ----------------------------------------------------- ModificationCommand
505

506     /**
507      * Returns the WBXML size of ModificationCommand object.
508      *
509      * @return the WBXML size of ModificationCommand object
510      */

511     public long getSize(ModificationCommand modCmd);
512
513     // --------------------------------------------------------- ResponseCommand
514

515     /**
516      * Returns the WBXML size of ResponseCommand object.
517      *
518      * @return the WBXML size of ResponseCommand object
519      */

520     public long getSize(ResponseCommand responseCmd);
521     
522 }
523
Popular Tags