⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 otaconfigmessage.java

📁 SyncML的java实现类库 funambol公司发布的
💻 JAVA
字号:
/*
 * 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.util.Log;


/**
 * Class handling properties of an OTA Configuration Message
 * coming from the server
 */
public class OTAConfigMessage {
    // Definitions for the section types sent by the server
    /** The SyncML section id */
    public static final int SYNCML      = 1;
    /** The MAIL section id */
    public static final int MAIL        = 2;
    /** The CONTACT section id */
    public static final int CONTACT     = 3;
    /** The CALENDAR section id */
    public static final int CALENDAR    = 4;
    /** The TASK section id */
    public static final int TASK        = 5;
    /** The NOTE section id */
    public static final int NOTE        = 6;
    /** The BRIEFCASE section id */
    public static final int BRIEFCASE   = 7;
    
    // Number of configurable sources
    public static final int SOURCE_NUMBER = 7;
    
    private String syncUrl;
    private String userName;
    private String password;
    
    private String visibleName;
    private String mailAddress;
    
    private String[] remoteURIs = new String[SOURCE_NUMBER];
    
    /** Creates a new instance of OTAConfigMessage */
    public OTAConfigMessage() {
   }
    
    /** Creates a new instance of OTAConfigMessage */
    public OTAConfigMessage(String userName, String password, String syncUrl,
            String visibleName, String mailAddress, String[] remoteURIs) {
        this.userName = userName;
        this.password = password;
        this.syncUrl = syncUrl;
        this.visibleName = visibleName;
        this.mailAddress = mailAddress;
        this.remoteURIs = remoteURIs;
    }
    
    public String getUserName() {
        return userName;
    }
    
    public void setUserName(String userName) {
        this.userName = userName;
    }
    
    public String getSyncUrl() {
        return syncUrl;
    }
    
    public void setSyncUrl(String syncUrl) {
        this.syncUrl = syncUrl;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public String getVisibleName() {
        return visibleName;
    }
    
    public void setVisibleName(String visibleName) {
        this.visibleName = visibleName;
    }
    
    public String getMailAddress() {
        return mailAddress;
    }
    
    public void setMailAddress(String mailAddress) {
        this.mailAddress = mailAddress;
    }
    
    public String[] getRemoteURIs() {
        return remoteURIs;
    }
    
    public void setRemoteURIs(String[] remoteURIs) {
        this.remoteURIs = remoteURIs;
    }
    
    /**
     * Returns the remote URI for the specified source
     *
     * @param sourceId one of the sourceId defined in this class
     */
    public String getRemoteUri(int sourceId) {
        if (sourceId < MAIL || sourceId > SOURCE_NUMBER) {
            Log.error("getRemoteUri: invalid sourceId "+sourceId);
            throw new IllegalArgumentException("sourceId not valid: "+sourceId);
        }
        return remoteURIs[sourceId-2];
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -