funambol的client api简介

/********************此文可以被转发,但请转发者保留作者的署名权
****李浩
****msn:lihao_nx@hotmail.com
****
****email:lihaoyxj@gmail.com

****出处:lihaoyxj.cublog.cn

****       www.cnblogs.com/lihaoyxj

*******************************************************/

在以上篇幅中介绍了开源库FUNAMBOL,本节中介绍一下,使用funambol的client api。

funambol的客户端在https://www.forge.funambol.org/download/index.zh-cn.html有相关 的安装包下载,它包含了windows,windows mobile,black berry,所有支支持j2me的平台下的客户端。

笔者在进行基于symbian部分客户端开发时,funambol还没有提供 symbian的源码。故在对funambol windows mobile的源码进行了分析,以funambol c++ api开发出了symbian的SYNCML客户端。

笔者认为,开发基于funambol client api最主要的类为二个:DMTClientConfig用于配置同步项;SyncSourc用于同步在前边所配置的同步项。

 DMTClientConfig在这里就不进行过多介绍。

 由于SyncSource类为虚类,那么在你的客户端中就要去实现它的相关方法,方法清单如下:

 SyncItem* getFirstItem();

        /*
         * Return the next SyncItem of all.
         * It is used in case of slow or refresh sync
         * and retrieve the entire data source content.
         */
        SyncItem* getNextItem();

        /*
         * Return the first SyncItem of new one. It is used in case of fast sync
         * and retrieve the new data source content.
         */
        SyncItem* getFirstNewItem();

        /*
         * Return the next SyncItem of new one. It is used in case of fast sync
         * and retrieve the new data source content.
         */
        SyncItem* getNextNewItem();

        /*
         * Return the first SyncItem of updated one. It is used in case of fast sync
         * and retrieve the new data source content.
         */
        SyncItem* getFirstUpdatedItem() ;

        /*
         * Return the next SyncItem of updated one. It is used in case of fast sync
         * and retrieve the new data source content.
         */
        SyncItem* getNextUpdatedItem();

        /*
         * Return the first SyncItem of updated one. It is used in case of fast sync
         * and retrieve the new data source content.
         */
        SyncItem* getFirstDeletedItem();

        /*
         * Return the next SyncItem of updated one. It is used in case of fast sync
         * and retrieve the new data source content.
         */

        SyncItem* getFirstItemKey();

        /*
         * Return the key of the next SyncItem of all.
         * It is used in case of refresh sync
         * and retrieve all the keys of the data source.
         */
        SyncItem* getNextItemKey();


        SyncItem* getNextDeletedItem();

        void setItemStatus(const WCHAR* key, int status);

        int addItem(SyncItem& item);

        int updateItem(SyncItem& item);

        int deleteItem(SyncItem& item);
        
        int removeAllItems(); //Not implemented

        int beginSync();

        int endSync();

只要实现了这些方法,那么意味着你的客户端实现了
posted @ 2009-05-19 09:08  浩@子  阅读(998)  评论(0)    收藏  举报