亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? syncmanager.h

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? H
字號:
/*
 * Copyright (C) 2003-2007 Funambol, Inc
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */

#ifndef INCL_SYNC_MANAGER
#define INCL_SYNC_MANAGER
/** @cond API */
/** @addtogroup Client */
/** @{ */

#include "base/util/ArrayList.h"
#include "http/TransportAgent.h"
#include "spds/constants.h"
#include "spds/SyncManagerConfig.h"
#include "spds/SyncSource.h"
#include "spds/SyncMLBuilder.h"
#include "spds/SyncMLProcessor.h"
#include "spds/CredentialHandler.h"
#include "spds/CredentialHandler.h"
#include "spds/SyncReport.h"


typedef enum {
                STATE_START        = 0,
                STATE_PKG1_SENDING = 1,
                STATE_PKG1_SENT    = 2,
                STATE_PKG3_SENDING = 3,
                STATE_PKG3_SENT    = 4,
                STATE_PKG5_SENDING = 5,
                STATE_PKG5_SENT    = 6
             } SyncManagerState ;


// Tolerance to data size for incoming items (106%) -> will be allocated some more space.
#define DATA_SIZE_TOLERANCE      1.06


static void fillContentTypeInfoList(ArrayList &l, const char*  types);


/**
 * This is the core class which encodes the flow of messages between
 * client and server throughout a session. It is configured via the
 * DMTClientConfig with which it is constructed by the
 * SyncClient::setDMConfig() and the (optional) DevInf provided
 * to it by the client.
 */
class SyncManager {

    public:
        /**
         * Initialize a new sync manager. Parameters provided to it
         * have to remain valid while this sync manager exists.
         *
         * @param config     required configuration
         * @param report     sync report reference to store sync results
         */
        SyncManager(SyncManagerConfig& config, SyncReport& report);
        ~SyncManager();

        int prepareSync(SyncSource** sources);

        int sync();

        int endSync();

        /**
         * Gathers the various bits and pieces known about the client and
         * its sources and builds a SyncML devinfo 1.1 instance.
         *
         * For simplicity reasons this function is called for the currently
         * active sync sources, changing them between runs thus causes
         * a (valid!) retransmission of the device info.
         *
         * @return device infos, to be deleted by caller, or NULL if unavailable
         */
        virtual DevInf *createDeviceInfo();

    private:

        // SyncManager makes local key safe to use in SyncML by
        // encoding it as b64 if it contains special characters. The
        // SyncML standard says that the key should be a "URI" or
        // "URN"; we interpret that less strictly as "do not
        // include characters which actually break XML".
        //
        // Encoded keys are sent as "funambol-b64-<encoded original
        // key>". When receiving a key from the server it is only decoded
        // if it contains this magic tag, therefore an updated client
        // remains compatible with a server that already contains keys.
        static const char encodedKeyPrefix[];

        void encodeItemKey(SyncItem *syncItem);
        void decodeItemKey(SyncItem *syncItem);

        // Struct used to pass command info to the method processSyncItem
        struct CommandInfo {
            const char* commandName;
            const char* cmdRef;
            const char* format;
            const char* dataType;
            long size;
        };

        DevInf* devInf;
        SyncManagerConfig& config;
        SyncReport& syncReport;

        CredentialHandler credentialHandler;
        SyncMLBuilder syncMLBuilder;
        SyncMLProcessor syncMLProcessor;
        TransportAgent* transportAgent;

        SyncManagerState currentState;
        SyncSource** sources;
        ArrayList* commands;
        ArrayList** mappings;

        // Now using sources[i].checkState() method
        //int* check;

        int  sourcesNumber;
        int  count;

        /* A list of syncsource names from server. The server sends sources
         * modifications sorted as alerts in this list. This array is retrieved from
         * SyncMLProcessor::getSortedSourcesFromServer.
         */
        char** sortedSourcesFromServer;

		ArrayList** allItemsList;

        StringBuffer syncURL;
        StringBuffer deviceId;
        int responseTimeout;  // the response timeout for a rensponse from server (default = 5min) [in seconds]
        int maxMsgSize;       // the max message size. Default = 512k. Setting it implies LargeObject support.
        int maxObjSize;       // The maximum object size. The server gets this in the Meta init message and should obey it.
        BOOL loSupport;             // enable support for large objects - without it large outgoing items are not split
        unsigned int readBufferSize; // the size of the buffer to store chunk of incoming stream.
        char  credentialInfo[1024]; // used to store info for the des;b64 encription

        // Handling of incomplete incoming objects by processSyncItem().
        // Always active, even if Large Object support is off,
        // just in case the server happens to rely on it.
        //
        class IncomingSyncItem : public SyncItem {
          public:
            IncomingSyncItem(const WCHAR* key,
                             const CommandInfo &cmdInfo,
                             int currentSource) :
                SyncItem(key),
                offset(0),
                cmdName(cmdInfo.commandName),
                cmdRef(cmdInfo.cmdRef),
                sourceIndex(currentSource) {
            }

            long offset;                // number of bytes already received, append at this point
            const StringBuffer cmdName; // name of the command which started the incomplete item
            const StringBuffer cmdRef;  // reference of the command which started the incomplete item
            const int sourceIndex;      // the index of the source to which the incomplete item belongs
        } *incomingItem;       // sync item which is not complete yet, more data expected

        void initialize();
        BOOL readSyncSourceDefinition(SyncSource& source);
        BOOL commitChanges(SyncSource& source);
        int assignSources(SyncSource** sources);

        Status *processSyncItem(Item* item, const CommandInfo &cmdInfo, SyncMLBuilder &syncMLBuilder);
        BOOL checkForServerChanges(SyncML* syncml, ArrayList &statusList);

        const char*  getUserAgent(SyncManagerConfig& config);
        bool isToExit();
        void setSourceStateAndError(unsigned int index, SourceState  state,
                                    unsigned int code,  const char*  msg);


        // Used to reserve some more space (DATA_SIZE_TOLERANCE) for incoming items.
        long getToleranceDataSize(long size);
        bool testIfDataSizeMismatch(long allocatedSize, long receivedSize);

        /**
         * A wrapper around the sync source's first/next iterator functions.
         * By default the data is encoded according to the "encoding"
         * SyncSourceConfig property, unless the SyncSource already set an encoding.
         *
         * In case of an error the error is logged and the item is set to NULL, just as
         * if the source itself had returned NULL.
         */
        SyncItem* getItem(SyncSource& source, SyncItem* (SyncSource::* getItem)());
};

/** @} */
/** @endcond */
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆精品91久久久久久清纯 | 亚洲色图色小说| 国产一区二区三区黄视频 | 亚洲午夜影视影院在线观看| 九九九久久久精品| 色综合中文字幕| 久久中文娱乐网| 亚洲成年人网站在线观看| 久久疯狂做爰流白浆xx| 欧美性一二三区| 国产精品天干天干在线综合| 日本一道高清亚洲日美韩| 欧美亚洲综合在线| 国产精品国产精品国产专区不片| 久久久亚洲欧洲日产国码αv| 欧美成人一区二区三区片免费 | 精品福利一区二区三区免费视频| 67194成人在线观看| 国产精品久久福利| 国产一区二区三区四区在线观看| 国模一区二区三区白浆| 欧美日韩五月天| 亚洲一卡二卡三卡四卡| 91影院在线观看| 国产精品久久久久久久久图文区| 中文字幕一区av| 欧美系列亚洲系列| 亚洲美女淫视频| 色综合天天综合给合国产| 国产精品美日韩| 波多野结衣视频一区| 亚洲国产精品成人久久综合一区 | 精品国产91乱码一区二区三区 | 在线观看网站黄不卡| 国产欧美视频一区二区| 国产美女精品一区二区三区| 精品国产成人在线影院| 精品中文av资源站在线观看| 日韩视频免费观看高清完整版在线观看| 欧美一区二区精品久久911| 亚洲人成精品久久久久久| 99久免费精品视频在线观看| 亚洲欧洲成人自拍| 91福利资源站| 亚洲一区二区欧美日韩| 欧美一区二区三区四区五区 | 欧美不卡视频一区| 国产原创一区二区三区| 国产欧美日本一区视频| 99re免费视频精品全部| 亚洲国产成人av| 日韩美女一区二区三区| 丁香婷婷综合激情五月色| 18涩涩午夜精品.www| 欧美影视一区二区三区| 精品一区二区三区久久| 国产精品青草久久| 欧美亚洲尤物久久| 久久99精品久久久久婷婷| 18欧美亚洲精品| 91国产视频在线观看| 免费美女久久99| 中文字幕免费观看一区| 欧美三级视频在线| 久久99精品国产.久久久久| 国产精品每日更新| 在线综合视频播放| 成人精品视频一区二区三区| 午夜天堂影视香蕉久久| 国产欧美精品区一区二区三区| 奇米亚洲午夜久久精品| 国产精品国产三级国产有无不卡| 精品一区二区免费在线观看| 国产精品欧美一区喷水| 日本福利一区二区| 精品亚洲成a人在线观看| 国产精品久久久久影视| 日韩欧美中文一区| 91免费国产在线观看| 激情丁香综合五月| 一区二区三区电影在线播| 久久亚洲欧美国产精品乐播| 色欧美片视频在线观看| 国产精品 日产精品 欧美精品| 日韩免费观看高清完整版| 99久久免费国产| 久久er99热精品一区二区| 亚洲精品菠萝久久久久久久| 精品福利一区二区三区| 欧美日韩精品一区二区在线播放| 性久久久久久久久| 国产精品九色蝌蚪自拍| 久久久久久久久久久黄色| 欧美日精品一区视频| www.一区二区| 久久99精品国产麻豆婷婷| 日韩专区在线视频| 亚洲蜜臀av乱码久久精品蜜桃| 欧美亚洲另类激情小说| 9l国产精品久久久久麻豆| 国产一区不卡精品| 久久91精品久久久久久秒播| 亚洲成av人片在线| 亚洲欧美另类久久久精品2019| 91黄色激情网站| 91久久精品午夜一区二区| 国产精品一区2区| 国内成+人亚洲+欧美+综合在线 | 成人黄色片在线观看| 激情综合五月天| 美女脱光内衣内裤视频久久网站 | 国产精品99久久久久久久vr| 理论电影国产精品| 麻豆成人在线观看| 免费观看在线色综合| 免费在线观看一区| 蜜桃久久久久久久| 美国av一区二区| 蜜桃视频在线一区| 三级精品在线观看| 久久av老司机精品网站导航| 久草这里只有精品视频| 国产河南妇女毛片精品久久久 | 激情综合五月婷婷| 国产成人在线视频网址| 国产成人午夜视频| 成人av电影在线观看| 不卡av免费在线观看| 91天堂素人约啪| 欧美三级日韩在线| 日韩欧美视频一区| 国产蜜臀97一区二区三区| 国产精品色哟哟| 一区二区三区在线免费播放| 亚洲高清免费一级二级三级| 日本视频一区二区| 国产米奇在线777精品观看| 国产成人免费高清| 色综合视频在线观看| 欧美日韩日日夜夜| 精品99999| 国产精品久久午夜夜伦鲁鲁| 一区二区激情视频| 蜜桃视频免费观看一区| www..com久久爱| 欧美日韩国产影片| 国产人久久人人人人爽| 亚洲激情欧美激情| 久久精品国产在热久久| 成人一区二区三区| 欧美狂野另类xxxxoooo| 久久精品日韩一区二区三区| 一区二区在线观看视频| 日本成人在线网站| 99久久国产综合精品女不卡| 欧美日韩成人综合天天影院| 久久精品一二三| 午夜视频一区在线观看| 成人91在线观看| 欧美va亚洲va| 亚洲成av人**亚洲成av**| 国产一区二三区| 欧美三电影在线| 一区精品在线播放| 另类成人小视频在线| 欧美在线观看一二区| 久久久午夜电影| 日韩精品电影在线观看| 99久久伊人精品| 2020国产精品| 日韩精品高清不卡| 欧美亚州韩日在线看免费版国语版| 色婷婷av一区二区三区之一色屋| 97精品久久久午夜一区二区三区 | 91麻豆国产自产在线观看| 欧美精品1区2区| 亚洲欧美偷拍另类a∨色屁股| 中文字幕在线播放不卡一区| 久久精品国产99| 欧美日韩一区高清| 亚洲色图制服诱惑 | 国产精品自在在线| 欧美绝品在线观看成人午夜影视| 欧美日韩在线观看一区二区| 欧美国产一区视频在线观看| 久久国产福利国产秒拍| 337p亚洲精品色噜噜| 亚洲国产日韩a在线播放性色| 日本网站在线观看一区二区三区| 日本大胆欧美人术艺术动态| 欧美日韩在线播放三区四区| 中文字幕av一区二区三区| 国产精品自拍一区| 欧美精品一区二区三区久久久| 国产亚洲1区2区3区| 国产一区二区三区电影在线观看| 粉嫩一区二区三区在线看 | 精品亚洲porn| 精品国产乱码久久久久久牛牛| 日本一区二区视频在线观看|