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

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

?? basesyncsource.java

?? SyncML的java實現類庫 funambol公司發布的
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright (C) 2006-2007 Funambol
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY 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 
 */

package com.funambol.syncml.client;

import com.funambol.syncml.spds.SourceConfig;
import com.funambol.syncml.spds.SyncItem;
import com.funambol.syncml.spds.SyncSource;
import com.funambol.syncml.spds.SyncException;

import com.funambol.syncml.protocol.SyncFilter;
import com.funambol.syncml.protocol.SyncML;

import com.funambol.util.Log;

/**
 * An abstract implementation of the <i>SyncSource</i> interface, providing
 * the basic framework each SyncSource has to implement. 
 * A developer can choose to extends BaseSyncSource or to implements
 * SyncSource directly if needed.
 *
 * The class BaseSyncSource uses the SyncConfig to store the source 
 * configuration data. With this class is possible to alter the source
 * configuration, which is not permitted by the SyncSource interface.
 */
public abstract class BaseSyncSource implements SyncSource {
    
    //--------------------------------------------------------------- Attributes

    /** SyncSource configuration */
    protected SourceConfig config;

    /** Synchronization filter */
    protected SyncFilter filter;

    /** SyncMode, set by beginSync */
    protected int syncMode;

    // Item lists
    protected SyncItem[] allItems, newItems, updItems, delItems;

    // Lists counters
    protected int allIndex, newIndex, updIndex, delIndex;

    /** The number of items to be sent to the server in the session */
    private int clientItemsNumber;
    
    /** The number of items that the server announced to send in the session */
    private int serverItemsNumber;


    //------------------------------------------------------------- Constructors

    /**
     * BaseSyncSource constructor: initialize source config
     */
    public BaseSyncSource(SourceConfig config) {
        this.config = config;
        
        syncMode = 0;
        
        // Init lists (empty)
        allItems = null;
        newItems = null;
        updItems = null;
        delItems = null;

        // Init counters
        allIndex = newIndex = updIndex = delIndex = 0;

        // Init number of chages counters
        clientItemsNumber = serverItemsNumber = -1;

        filter = null;
    }

    //----------------------------------------------------------- Public Methods

    /**
     * Returns the config of the source. The client can use this method
     * to obtain the config object and change some parameter. A setConfig()
     * must be called to actually change the source configuration.
     *
     * @return the config of the source
     */
    public SourceConfig getConfig() {
        return config;
    }

    /**
     * Returns the config of the source. The client can use this method
     * to change the config the source configuration.
     * This operation should not be done while the sync is in progress.
     *
     * @return the config of the source
     */
    public void setConfig(SourceConfig config) {
        this.config = config;
    }
    
    //------------------------------------------------ SyncSource implementation

    /**
     * Returns the name of the source
     *
     * @return the name of the source
     */
    public String getName() {
        return config.getName();
    }

    /**
     * Returns the source URI
     *
     * @return the absolute URI of the source
     */
    public String getSourceUri() {
        return config.getRemoteUri();
    }

    /**
     * Returns the type of the source.
     * The types are defined as mime-types, for instance * text/x-vcard).
     * @return the type of the source
     */
    public String getType() {
        return config.getType();
    }

    /**
     * Returns the encoding of the source.
     * The encoding can be 'b64' or 'none' only. The standard defines
     * also 'des' and '3des' but they are not implemented in this version
     * of the APIs.
     *
     * @return the encoding of the source
     */
    public String getEncoding() {
        return config.getEncoding();
    }

    /**
     * Returns the preferred sync mode of the source.
     * The preferred sync mode is the one that the SyncManager sends
     * to the server in the initialization phase. The server can respond
     * with a different alert code, to force, for instance, a slow.
     *
     * @return the preferred sync mode for this source
     */
    public int getSyncMode() {
        return config.getSyncMode();
    }

    /**
     * Returns the current filter for this SyncSource.
     */
    public SyncFilter getFilter() {
        return filter;
    }

    /**
     * Set a new filter for this SyncSource
     */
    public void setFilter(SyncFilter filter) {
        this.filter = filter;
    }

    /**
     * Add a new SyncItem to this source backend.
     * The item key after a successful add must contain the local UID,
     * that is used by the engine to send the mappings to the server.
     * The source must then change the item key accordingly before return.
     *
     * @param item the SyncItem to add, with the GUID sent by the server.
     *             The source is resposible to set it to the LUID before
     *             returning a successful status code.
     *
     * @return the status code of the operation. It will be returned to
     *         the server in the response for this item.
     *
     * @throws SyncException if an unrecoverable error occur, to stop the sync
     */
    public abstract int addItem(SyncItem item) throws SyncException ;
    
    /**
     * Update a given SyncItem stored in the source backend.
     *
     * @param item the SyncItem to update. The key of the item is already
     *             the LUID.
     *
     * @return the status code of the operation. It will be returned to
     *         the server in the response for this item.
     *
     * @throws SyncException if an unrecoverable error occur, to stop the sync
     */
    public abstract int updateItem(SyncItem item) throws SyncException ;
    
    /**
     * Delete a SyncItem stored in the source backend.
     *
     * @param key The key of the item to delete.
     *
     * @return the status code of the operation. It will be returned to
     *         the server in the response for this item.
     *
     * @throws SyncException if an unrecoverable error occur, to stop the sync
     */
    public abstract int deleteItem(String key) throws SyncException ;
    
    /** 
     * Returns the next item of the store.
     **/
    public SyncItem getNextItem() throws SyncException {
        if (allItems == null) {
            Log.info("Source "+getName()+": no items to send for slow sync");
            return null;
        }
        
        if (allIndex<allItems.length) {
            Log.info("Source "+getName()+": sending item "
                     +allItems[allIndex].getKey());
            return getItemContent(allItems[allIndex++]);
        }
        else {
            Log.info("Source "+getName()+": no more items to send for slow sync");
            // All Items sent, we can free memory
            allItems = null;
            allIndex = 0;
            return null;
        }
    }
    
    /**
     * Returns the next new item of the store
     * (not yet sent to the server)
     */
    public SyncItem getNextNewItem() throws SyncException {
        if (newItems == null) {
            Log.info("Source "+getName()+": no new items to send");
            return null;
        }
        
        if (newIndex<newItems.length) {
            Log.info("Source "+getName()+": sending item "
                     +newItems[newIndex].getKey());
            return getItemContent(newItems[newIndex++]);
        }
        else {
            Log.info("Source "+getName()+": no more new items to send");
            // All Items sent, we can free memory
            newItems = null;
            newIndex = 0;
            return null;
        }
    }
    
    
    /**
     * Returns the first/next updated item of the store
     * (changed from the last sync)
     */
    public SyncItem getNextUpdatedItem() throws SyncException {
        if (updItems == null) {
            Log.info("Source "+getName()+": no updated items to send");
            return null;
        }
        
        if (updIndex<updItems.length) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
最新国产成人在线观看| 成人va在线观看| 一本大道av伊人久久综合| 久久久不卡网国产精品一区| 国产精品99久久久久久有的能看| 国产一区中文字幕| 亚洲色图在线看| 久久久亚洲综合| 国产视频911| 激情丁香综合五月| 亚洲一区二区三区自拍| 99精品国产热久久91蜜凸| 91精品国产品国语在线不卡| 欧美视频一区在线| 欧美亚洲动漫精品| 884aa四虎影成人精品一区| 亚洲一区二区三区激情| 日韩欧美中文字幕一区| 美女高潮久久久| 欧美日韩成人在线| 成人ar影院免费观看视频| 国产一区在线看| 91丨九色丨国产丨porny| 亚洲欧美日韩在线| 欧美精品aⅴ在线视频| 91精品国产免费| 欧美一区二区视频观看视频| 久久久www成人免费无遮挡大片| 日韩一级欧美一级| 国产日韩在线不卡| 一本一道综合狠狠老| 国产精品一区二区免费不卡| 99天天综合性| 欧美日韩的一区二区| 日韩精品一区二区三区swag | 亚洲成av人片观看| 精品国产乱码久久| 国产乱色国产精品免费视频| 波多野结衣在线一区| 欧美亚洲丝袜传媒另类| 日韩一区二区在线观看| 久久精品人人做人人综合| 国产精品青草综合久久久久99| 中文字幕欧美一| 亚洲综合在线观看视频| 麻豆精品在线播放| 成人激情图片网| 欧美精品一级二级| 欧美激情一区二区三区不卡 | 在线观看91视频| 2024国产精品| 天天综合网天天综合色| 国产一级精品在线| 制服.丝袜.亚洲.中文.综合| 国产午夜精品久久久久久免费视| 日本一区免费视频| 久久精品国产色蜜蜜麻豆| av激情综合网| 国产视频在线观看一区二区三区 | 67194成人在线观看| 一区视频在线播放| 日韩av午夜在线观看| 国产欧美一区二区三区沐欲| 亚洲精品成人在线| 亚洲男帅同性gay1069| 免费三级欧美电影| 成人午夜免费电影| 欧美成人vr18sexvr| 日韩一区二区视频在线观看| 18涩涩午夜精品.www| 亚洲一级片在线观看| 成人av资源在线观看| 日韩欧美在线不卡| 蜜臀av亚洲一区中文字幕| 色婷婷国产精品综合在线观看| 国产精品无遮挡| 丁香婷婷综合色啪| 国产精品嫩草影院av蜜臀| 韩国视频一区二区| 久久久久久一级片| 久久99国产精品久久99| 黄色资源网久久资源365| 欧美va亚洲va香蕉在线| 午夜成人免费视频| 欧美电影免费观看完整版| 午夜精品影院在线观看| 在线电影欧美成精品| 亚洲伊人色欲综合网| 成人激情图片网| 一级特黄大欧美久久久| 成人深夜在线观看| 亚洲九九爱视频| 一本大道综合伊人精品热热| 一区二区三区四区亚洲| 91久久精品一区二区| 性做久久久久久免费观看欧美| 在线免费一区三区| 日本一不卡视频| 精品国产91洋老外米糕| 亚洲自拍偷拍av| 91精品黄色片免费大全| 日韩1区2区3区| 欧美极品aⅴ影院| 99视频在线精品| 日韩av一区二区在线影视| 日韩欧美中文一区二区| 成人黄色电影在线| 悠悠色在线精品| 日韩视频在线你懂得| 久久疯狂做爰流白浆xx| 中文字幕在线不卡国产视频| 91色视频在线| 亚洲成人在线观看视频| 日韩一区二区免费在线电影| 免费在线看一区| 国产精品成人免费| 欧美在线色视频| 国产成人综合精品三级| 中文字幕一区视频| 日韩视频一区在线观看| 国产69精品久久久久毛片| 亚洲电影在线播放| www日韩大片| 在线看国产一区| 国产精品一区二区在线播放| 国产精品久久久久久久久免费丝袜 | 亚洲人精品一区| 久久久久久99久久久精品网站| 91无套直看片红桃| 美女尤物国产一区| 亚洲男人都懂的| 国产女人水真多18毛片18精品视频 | 黄色成人免费在线| 亚洲成人手机在线| 中文字幕免费在线观看视频一区| 欧美人与性动xxxx| zzijzzij亚洲日本少妇熟睡| 国产在线精品一区在线观看麻豆| 亚洲欧洲日韩女同| 国产日韩欧美精品在线| 欧美理论片在线| 色猫猫国产区一区二在线视频| 国内成人精品2018免费看| 日本aⅴ精品一区二区三区 | 88在线观看91蜜桃国自产| 99久久久久免费精品国产 | 国产剧情av麻豆香蕉精品| 夜夜嗨av一区二区三区中文字幕| 日本一区二区电影| 日韩三级伦理片妻子的秘密按摩| 在线观看一区日韩| 91麻豆产精品久久久久久| 一区二区三区蜜桃网| 亚洲男人电影天堂| 国产欧美综合在线观看第十页| 亚洲精品一区二区三区蜜桃下载| 精品视频一区二区三区免费| 91精彩视频在线| 91碰在线视频| 欧美丝袜丝交足nylons| 97精品超碰一区二区三区| 99久久精品一区二区| 成人深夜视频在线观看| 91在线丨porny丨国产| 成人午夜看片网址| 日本伦理一区二区| 91成人免费在线视频| 欧美色中文字幕| 在线综合视频播放| 欧美大肚乱孕交hd孕妇| 欧美一级专区免费大片| 久久精品一区四区| 国产日产欧美一区二区视频| 国产亚洲一区二区三区在线观看| 精品美女一区二区| 日韩三级免费观看| 欧美精品一区二区三区久久久| 欧美xxxx在线观看| 精品少妇一区二区| 欧美精品一区二区三区在线播放| 欧美大胆人体bbbb| 亚洲欧洲精品一区二区三区不卡| 中文字幕在线不卡视频| 欧美一区午夜精品| 久久久国产精品麻豆| 欧美精品一区二区三区很污很色的 | av在线一区二区三区| eeuss鲁片一区二区三区| 91天堂素人约啪| 日韩精品一区二区三区视频在线观看 | 91精品麻豆日日躁夜夜躁| 日韩欧美一区在线| 中文字幕第一区第二区| 国产精品福利一区| 视频一区二区三区入口| 精品一区精品二区高清| 色婷婷狠狠综合| 日韩欧美不卡一区| 一区二区在线观看不卡| 日韩国产一二三区|