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

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

?? basesyncsource.java

?? SyncML的java實現(xiàn)類庫 funambol公司發(fā)布的
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
            Log.info("Source "+getName()+": sending item "
                     +updItems[updIndex].getKey());
            return getItemContent(updItems[updIndex++]);
        }
        else {
            Log.info("Source "+getName()+": no more updated items to send");
            // All Items sent, we can free memory
            updItems = null;
            updIndex = 0;
            return null;
        }
    }
    
    /** 
     * Returns a SyncItem containing the key of the first/next
     * deleted item of the store (locally removed after the last sync,
     * but not yet deleted on server)
     */
    public SyncItem getNextDeletedItem() throws SyncException {
        if (delItems == null) {
            Log.info("Source "+getName()+": no deleted items to send");
            return null;
        }
        
        if (delIndex<delItems.length) {
            Log.info("Source "+getName()+": sending item "
                     +delItems[delIndex].getKey());
            // No need to get the content here
            return delItems[delIndex++];
        }
        else {
            Log.info("Source "+getName()+": no more deletetd items to send");
            // All Items sent, we can free memory
            delItems = null;
            delIndex = 0;
            return null;
        }
    } 
    
    /**
     * Tell the SyncSource the status returned by the server 
     * for an Item previously sent.
     * This is a dummy implementation that just logs the status.
     * A concrete implementation can override this method to perform
     * some checks on the received status.
     *
     * @param key the key of the item
     * @param status the status code received for that item
     *
     * @throws SyncException if the SyncSource wants to stop the sync
     */
    public void setItemStatus(String key, int status)
    throws SyncException {
        Log.info("Status " + status + "for item " + key + "from server.");
    }

    /**
     * Return the number of changes that the client will send during the
     * session. This method, after the beginSync() call, should return
     * the number of items to be sent to the server.
     *
     * The number of changes is computed by initXXXItems() during beginSync().
     *
     * @return number of items to sent, or -1 if unknown
     */
    public int getClientItemsNumber() {
        return clientItemsNumber;
    }

    /**
     * Return the number of changes that the server will send during the
     * session. This method, after the beginSync() call, should return
     * the number of items to be sent to the server.
     *
     * @return number of changes from the server, or -1 if not announced.
     */
    public int getServerItemsNumber() {
        return serverItemsNumber;
    }

    /**
     * Set the number of changes that the server will send during the
     * session. This method is called by the engine to notify the Source
     * of the number of changes announced by the server. If the server
     * does not announce the number of changes, the engine will call
     * this method with parameter -1.
     *
     * @param number of changes from the server, or -1 if not announced.
     */
    public void setServerItemsNumber(int number) {
        serverItemsNumber = number;
    }

    /**
     * Default implementation for
     */
    public void dataReceived(String date, int size) {
        Log.info("Received " + size + "bytes.");
    }


    /** 
     * Return the Last Anchor for this source
     */
    public long getLastAnchor() {
        return config.getLastAnchor();
    }
    
    /** 
     * Set the value of the Last Anchor for this source
     */
    public void setLastAnchor(long time) {
        config.setLastAnchor(time);
    }
    
    /** 
     * Return the Next Anchor for this source
     */
    public long getNextAnchor() {
        return config.getNextAnchor();
    }
    
    /** 
     * Set the value of the Next Anchor for this source
     */
    public void setNextAnchor(long time) {
        config.setNextAnchor(time);
    }

    /**
     * Called after SyncManager preparation and initialization just before start
     * the synchronization of the SyncSource.
     *
     * @param syncMode the synchronization type: one of the values in
     *                 sync4j.framework.core.AlertCode
     *
     * @throws SyncException in case of error. This will stop the sync process
     */
    public void beginSync(int syncMode) throws SyncException {
        Log.info("Begin sync for source '" + getName() +
                 "' with mode " + syncMode);

        // Init lists
        switch(syncMode) {
            case SyncML.ALERT_CODE_SLOW:
            case SyncML.ALERT_CODE_REFRESH_FROM_CLIENT:
                // A refresh from client is like a slow here
                initAllItems();
                allIndex = 0;
                // Init number of changes counter
                clientItemsNumber = (allItems != null) ? allItems.length : 0 ;
                break;
            case SyncML.ALERT_CODE_FAST:
            case SyncML.ALERT_CODE_ONE_WAY_FROM_CLIENT:
                // A one way from client is like a fast here
                initNewItems();
                initUpdItems();
                initDelItems();
                newIndex = updIndex = delIndex = 0;
                // Init number of changes counter
                clientItemsNumber = (newItems != null) ? newItems.length : 0 ;
                clientItemsNumber += (updItems != null) ? updItems.length : 0 ;
                clientItemsNumber += (delItems != null) ? delItems.length : 0 ;
                break;
            case SyncML.ALERT_CODE_ONE_WAY_FROM_SERVER:
                // No modifications to send (it's not
                // strictly necessary to reset the lists,
                // because the engine will not ask items to
                // the SyncSource, but it's good to do it)
                newItems = null;
                updItems = null;
                delItems = null;
                newIndex = updIndex = delIndex = 0;
                // Init number of changes counter
                clientItemsNumber = 0;
                break;
            case SyncML.ALERT_CODE_REFRESH_FROM_SERVER:
                // In this case, the SyncSource should
                // delete all the items in the database
                // (possibly asking the user before that)
                // No modifications to send.
                newItems = null;
                updItems = null;
                delItems = null;
                newIndex = updIndex = delIndex = 0;
                // Init number of changes counter
                clientItemsNumber = 0;
                break;
            default:
                throw new SyncException(SyncException.SERVER_ERROR,
                                        "SyncSource "+getName()+
                                        ": invalid sync mode "+getSyncMode());
        }

        this.syncMode = syncMode;
    }

    /**
     * Called just before committing the synchronization process by the
     * SyncManager. The SyncSource can stop the commit phase raising an
     * exception here.
     *
     * @throws SyncException in case of error, to stop the commit.
     */
    public void endSync() throws SyncException  {
        Log.info("End sync for source " + getName());
        // Release resources
        allItems = newItems = updItems = delItems = null;
        allIndex = newIndex = updIndex = delIndex = 0;
    }

    /* ----------------------------------------------------------------------
     * The following methods must be implemented by the concrete 
     * implementation of BaseSyncSource to perform the real modification
     * detection, based on the source type.
     */

    /**
     * In a concrete implementation, this function should search the database
     * for all the items present and store their keys.
     *
     * @throws SyncException implementation can throw a SyncException 
     *                       to stop the sync on fatal errors.
     */
    protected abstract void initAllItems() throws SyncException;

    /**
     * In a concrete implementation, this function should search the database
     * for the new items present and store their keys.
     *
     * @throws SyncException implementation can throw a SyncException 
     *                       to stop the sync on fatal errors.
     */
    protected abstract void initNewItems() throws SyncException;

    /**
     * In a real implementation, this function should search the database
     * for the modified items present and store their keys.
     * The policy to detect a change can vary from one source to another:
     * from generating a CRC to keep the status in a field of the item in
     * the backend database.
     *
     * @throws SyncException implementation can throw a SyncException 
     *                       to stop the sync on fatal errors.
     */
    protected abstract void initUpdItems() throws SyncException ;

    /**
     * In a real implementation, this function should search the database
     * for the deleted items present and store their keys.
     * The policy to detect a deleted item can vary from one source to another:
     * from keeping a list of items after the last sync to keep the items with
     * a deleted flag and then remove them after the successful deletion on
     * the server.
     *
     * @throws SyncException implementation can throw a SyncException 
     *                       to stop the sync on fatal errors.
     */
    protected abstract void initDelItems() throws SyncException ;

    /**
     * This function gets the item content in the backend database and
     * returns a complete item. The parameter item is marked final because
     * should not be used for the filled item: it is a reference to the
     * array entry, and filling it would cause the array to keep all the
     * filled items at the end (the gc will not dispose them). <p>
     * The content of the item depends also from the encoding of this
     * SyncSource:
     * <li> if the encoding is <i>none</i>, it must be a String, converted
     *      with getBytes(), so the engine will send it unchanged.
     * <li> if the encoding is <i>b64</i>, the content can be binary, and the 
     *      type should be set accordingly, so that the receiving source
     *      can handle it. In this way, the binary content is transferred
     *      encoded in the SyncML message. This encoding can be applied to
     *      a test item too, to avoid problems with charset or other, like
     *      what is done with the SIF format.
     */
    protected abstract SyncItem getItemContent(final SyncItem item)
    throws SyncException ;

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
首页亚洲欧美制服丝腿| 国产一区二区三区久久久| 91电影在线观看| 一区二区三区在线视频免费观看| 91一区二区在线| 亚洲视频一二三| 高清beeg欧美| 最新高清无码专区| 在线一区二区观看| 天天色 色综合| 日韩免费看的电影| 成人免费高清在线观看| 亚洲一区二区欧美日韩| 91.麻豆视频| 国产一区二区电影| 自拍偷拍亚洲激情| 欧美巨大另类极品videosbest | 欧美在线|欧美| 日本一区中文字幕| 欧美激情一区在线| 在线观看日韩毛片| 精油按摩中文字幕久久| 国产婷婷色一区二区三区在线| av亚洲精华国产精华| 午夜精品久久久久久久蜜桃app| 精品国产亚洲在线| 99久久综合国产精品| 日韩中文字幕一区二区三区| 久久蜜臀中文字幕| 欧美专区日韩专区| 激情综合色播五月| 亚洲欧美日韩国产一区二区三区| 69av一区二区三区| 成人午夜精品在线| 婷婷中文字幕综合| 国产日产欧美一区| 欧美日韩在线播| 国产很黄免费观看久久| 亚洲午夜久久久久久久久电影院| 精品播放一区二区| 国产精品成人一区二区三区夜夜夜| 欧美亚洲国产bt| 国产美女在线精品| 亚洲国产日韩精品| 国产亚洲婷婷免费| 欧美精品久久一区二区三区| 成人丝袜视频网| 男人的j进女人的j一区| ㊣最新国产の精品bt伙计久久| 91精品国产综合久久久蜜臀图片| 成人av在线影院| 乱一区二区av| 亚洲精品视频免费看| 日韩手机在线导航| 91豆麻精品91久久久久久| 国产福利91精品| 午夜精品久久久| 国产精品第13页| 久久久www免费人成精品| 欧美视频中文字幕| aa级大片欧美| 激情久久久久久久久久久久久久久久| 一区二区三区在线观看动漫 | 久久无码av三级| 欧美丝袜丝交足nylons图片| 成人性视频网站| 捆绑调教一区二区三区| 一区二区三区四区在线| 国产精品理论片| 久久日韩粉嫩一区二区三区| 欧美精品高清视频| 日本精品裸体写真集在线观看| 成人免费毛片片v| 精品一区二区精品| 石原莉奈在线亚洲三区| 亚洲精品免费在线播放| 国产精品久线在线观看| 久久久综合精品| 精品免费一区二区三区| 717成人午夜免费福利电影| 欧美在线视频不卡| 99久久综合狠狠综合久久| 国产精品自拍在线| 日韩和欧美的一区| 亚洲第一福利一区| 亚洲免费在线观看| 一区在线中文字幕| 国产精品欧美经典| 国产精品免费视频一区| 国产日韩精品一区| 国产午夜精品理论片a级大结局| 欧美成人性战久久| 欧美一区二区精品久久911| 欧美日韩成人高清| 欧美少妇bbb| 91搞黄在线观看| 色偷偷88欧美精品久久久 | av激情亚洲男人天堂| 成人污视频在线观看| 国产99久久久国产精品潘金| 国产精品中文字幕日韩精品| 国内精品久久久久影院薰衣草| 美脚の诱脚舐め脚责91 | 欧美一级高清片在线观看| 欧美精品黑人性xxxx| 欧美精品电影在线播放| 欧美精品自拍偷拍动漫精品| 欧美日韩高清不卡| 欧美一区二区三区四区在线观看| 6080yy午夜一二三区久久| 8v天堂国产在线一区二区| 欧美一区二区三区在| 日韩女优电影在线观看| 日韩免费高清av| 精品国产乱码久久久久久牛牛| 欧美大片在线观看一区| 精品国产电影一区二区| 久久久久久9999| 国产精品日韩成人| 亚洲精品五月天| 亚洲成a天堂v人片| 美女久久久精品| 国产精品18久久久久| 成人白浆超碰人人人人| 91浏览器入口在线观看| 在线免费av一区| 欧美精品xxxxbbbb| 精品女同一区二区| 国产精品污污网站在线观看| 亚洲免费观看高清完整版在线观看熊| 亚洲综合色区另类av| 青椒成人免费视频| 国产一区二区0| www.亚洲人| 欧美日韩一区二区电影| 日韩免费电影一区| 日本一区二区三区四区在线视频| 亚洲人成精品久久久久久| 亚洲大片精品永久免费| 精品一区二区三区免费播放| 粉嫩av一区二区三区粉嫩| 91免费看`日韩一区二区| 欧美麻豆精品久久久久久| 日韩一区二区三区电影 | 国产欧美日韩久久| 亚洲激情第一区| 蜜桃一区二区三区在线| 成人永久免费视频| 欧美日韩一区二区三区四区五区| 日韩精品一区二区三区三区免费| 亚洲国产成人私人影院tom| 亚洲午夜精品网| 国产美女在线观看一区| 99精品在线免费| 91精品国产综合久久国产大片| 2017欧美狠狠色| 亚洲最新在线观看| 久久爱另类一区二区小说| 99精品热视频| 日韩午夜激情免费电影| 日韩码欧中文字| 麻豆国产一区二区| 97精品视频在线观看自产线路二| 欧美一区二区三区免费视频| 国产清纯白嫩初高生在线观看91 | 欧美性感一类影片在线播放| 日韩精品影音先锋| 樱花草国产18久久久久| 久久se精品一区二区| 91电影在线观看| 国产日韩欧美麻豆| 天天色天天操综合| 99久免费精品视频在线观看| 日韩三级免费观看| 亚洲同性同志一二三专区| 久久99精品一区二区三区| 91国偷自产一区二区开放时间| 久久美女艺术照精彩视频福利播放| 亚洲综合丝袜美腿| 国产a久久麻豆| 日韩天堂在线观看| 一区二区不卡在线视频 午夜欧美不卡在| 久草热8精品视频在线观看| 在线免费观看一区| 久久蜜桃av一区二区天堂| 丝袜亚洲另类欧美| av日韩在线网站| 久久午夜老司机| 日韩高清不卡一区| 色94色欧美sute亚洲线路一ni| 久久伊99综合婷婷久久伊| 性感美女极品91精品| 波波电影院一区二区三区| 精品福利一二区| 日韩va欧美va亚洲va久久| 91美女蜜桃在线| 国产精品灌醉下药二区| 国产精品影视在线| 欧美一级二级在线观看| 亚洲成av人片一区二区梦乃|