src/include/common/spds/AccessConfig.h

00001 /*
00002  * Funambol is a mobile platform developed by Funambol, Inc. 
00003  * Copyright (C) 2003 - 2007 Funambol, Inc.
00004  * 
00005  * This program is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Affero General Public License version 3 as published by
00007  * the Free Software Foundation with the addition of the following permission 
00008  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
00009  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
00010  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  * 
00017  * You should have received a copy of the GNU Affero General Public License 
00018  * along with this program; if not, see http://www.gnu.org/licenses or write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00020  * MA 02110-1301 USA.
00021  * 
00022  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
00023  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
00024  * 
00025  * The interactive user interfaces in modified source and object code versions
00026  * of this program must display Appropriate Legal Notices, as required under
00027  * Section 5 of the GNU Affero General Public License version 3.
00028  * 
00029  * In accordance with Section 7(b) of the GNU Affero General Public License
00030  * version 3, these Appropriate Legal Notices must retain the display of the
00031  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
00032  * feasible for technical reasons, the Appropriate Legal Notices must display
00033  * the words "Powered by Funambol".
00034  */
00035 #ifndef INCL_ACCESS_CONFIG
00036 #define INCL_ACCESS_CONFIG
00037 
00039 #include "base/fscapi.h"
00040 #include "spds/constants.h"
00041 #include "base/globalsdef.h"
00042 
00043 BEGIN_NAMESPACE
00044 
00045 
00046 /*
00047  * -------------------------- AccessConfig class -----------------------------
00048  * This class groups all configuration properties to estabilish a
00049  * connection with a sync server.
00050  * AccessConfig is a part of SyncManagerConfig (along with DeviceConfig
00051  * and an array of SyncSourceConfig).
00052  */
00053 class AccessConfig {
00054     private:
00055         char*           username            ;
00056         char*           password            ;
00057         bool            useProxy            ;
00058         char*           proxyHost           ;
00059         int             proxyPort           ;
00060         char*           proxyUsername       ;
00061         char*           proxyPassword       ;
00062         char*           syncURL             ;
00063         unsigned long   beginTimestamp      ;
00064         unsigned long   endTimestamp        ;
00065         SyncMode        firstTimeSyncMode   ;
00066         char*           serverNonce         ;
00067         char*           clientNonce         ;
00068         char*           serverID            ;
00069         char*           serverPWD           ;
00070         char*           clientAuthType      ;
00071         char*           serverAuthType      ;
00072         bool            isServerAuthRequired;
00073         unsigned long   maxMsgSize          ;
00074         unsigned long   readBufferSize      ;
00075         char*           userAgent           ;
00076         bool            checkConn           ;
00077         unsigned int    responseTimeout     ;
00078         bool            compression         ;
00079 
00080         unsigned int dirty;
00081 
00089         void set(char* * buf, const char*  v);
00090 
00091     public:
00092 
00093         AccessConfig();
00094         AccessConfig(AccessConfig& s);
00095         ~AccessConfig();
00096 
00104         const char*  getUsername() const;
00105 
00113         void setUsername(const char*  username);
00114 
00118         const char*  getPassword() const;
00119 
00127         void setPassword(const char*  password);
00128 
00133         SyncMode getFirstTimeSyncMode() const;
00134 
00141         void setFirstTimeSyncMode(SyncMode syncMode);
00142 
00146         bool getUseProxy() const;
00147 
00153         void setUseProxy(bool useProxy);
00154 
00158         const char*  getProxyHost() const;
00159 
00165         void setProxyHost(const char*  proxyHost);
00166 
00167         int getProxyPort() const;
00168         void setProxyPort(int v);
00169 
00173         const char* getProxyUsername() const;
00174 
00180         void setProxyUsername(const char*  proxyUsername);
00181 
00185         const char* getProxyPassword() const;
00186 
00192         void setProxyPassword(const char*  proxyPassword);
00193 
00199         const char*  getSyncURL() const;
00200 
00208         void setSyncURL(const char*  syncURL);
00209 
00215         void setBeginSync(unsigned long timestamp);
00216 
00220         unsigned long getBeginSync() const;
00221 
00227         void setEndSync(unsigned long timestamp);
00228 
00232         unsigned long getEndSync() const;
00233 
00234         bool getServerAuthRequired() const;
00235 
00236         void setServerAuthRequired(bool v);
00237 
00238         const char*  getClientAuthType() const;
00239 
00240         void setClientAuthType(const char*  v);
00241 
00242         const char*  getServerAuthType() const;
00243 
00244         void setServerAuthType(const char*  v);
00245 
00246         const char*  getServerPWD() const;
00247 
00248         void setServerPWD(const char*  v);
00249 
00250         const char*  getServerID() const;
00251 
00252         void setServerID(const char*  v);
00253 
00254         const char*  getServerNonce() const;
00255 
00256         void setServerNonce(const char*  v);
00257 
00258         const char*  getClientNonce() const;
00259 
00260         void setClientNonce(const char*  v);
00261 
00262         void setMaxMsgSize(unsigned long msgSize);
00263 
00264         unsigned long getMaxMsgSize() const;
00265 
00266         void setReadBufferSize(unsigned long bufferSize);
00267 
00268         unsigned long getReadBufferSize() const;
00269 
00270         const char*  getUserAgent() const;
00271 
00272         void setUserAgent(const char*  v);
00273 
00274         void setCompression(bool  v);
00275 
00276         bool  getCompression() const;
00277 
00278         //void setCompression(bool v);
00279 
00280         void setCheckConn(bool v);
00282         bool getCheckConn() const;
00283 
00284         void setResponseTimeout(unsigned int bufferSize)   ;
00285         unsigned int getResponseTimeout() const            ;
00286 
00290         unsigned int getDirty() const;
00291 
00298         void assign(const AccessConfig& s);
00299 
00300         /*
00301          * Assign operator
00302          */
00303         AccessConfig& operator = (const AccessConfig& ac) {
00304             assign(ac);
00305             return *this;
00306         }
00307 
00308 };
00309 
00310 
00311 END_NAMESPACE
00312 
00314 #endif

Generated on Wed Jan 14 17:15:36 2009 for Funambol C++ Client Library by  doxygen 1.5.2