src/include/common/spds/AccessConfig.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 #ifndef INCL_ACCESS_CONFIG
00019 #define INCL_ACCESS_CONFIG
00020 
00022 #include "base/fscapi.h"
00023 #include "spds/constants.h"
00024 
00025 
00026 /*
00027  * -------------------------- AccessConfig class -----------------------------
00028  * This class groups all configuration properties to estabilish a 
00029  * connection with a sync server.
00030  * AccessConfig is a part of SyncManagerConfig (along with DeviceConfig 
00031  * and an array of SyncSourceConfig).
00032  *
00033  * Class members:
00034  * --------------
00035  * username             : string for username
00036  * password             : string for password
00037  * useProxy             : Should the sync engine use a HTTP proxy?
00038  * proxyHost            : the host for proxy connection
00039  * proxyPort            : the port for proxy connection
00040  * proxyUsername        : the proxy username (if proxy needs authentication)
00041  * proxyPassword        : the proxy password (if proxy needs authentication)
00042  * beginTimestamp       : The beginSync timestamp
00043  * endTimestamp         : The endSync timestamp
00044  * firstTimeSyncMode    : The SyncMode that the sync engine should use 
00045  *                        the first time a source is synced
00046  * serverNonce          : The server nonce value: from client to server
00047  * clientNonce          : The client nonce value: from server to client
00048  * serverID             : the server ID value
00049  * serverPWD            : the server password
00050  * clientAuthType       : the type of client authentication used by client
00051  * isServerAuthRequired : Does the server require authentication?
00052  * maxMsgSize           : The maximum message size (Byte) accepted for XML 
00053  *                        messages received from server (server to client)
00054  * maxModPerMsg         : The maximum number of modifications sent in each XML 
00055  *                        message from client to server
00056  * readBufferSize       : Specifies the value for the size of the buffer used 
00057  *                        to store the incoming stream from server (byte)
00058  * userAgent            : The user agent string, will be attached to http 
00059  *                        messages to identify the client on server side.
00060  *                        It shoud be a short description with the client 
00061  *                        name plus its version
00062  * checkConn            : Do we need to check if the GPRS connection is available?          <-- **** still used? ****
00063  * responseTimeout      : The number of seconds of waiting response timeout
00064  * dirty                : The dirty flag, used to select which properties 
00065  *                        have been modified. Not used by now (T.B.D)
00066  */
00067 class AccessConfig {
00068     private:
00069         char*           username            ;
00070         char*           password            ;
00071         BOOL            useProxy            ;
00072         char*           proxyHost           ;
00073         int             proxyPort           ;
00074         char*           proxyUsername       ;
00075         char*           proxyPassword       ;
00076         char*           syncURL             ;
00077         unsigned long   beginTimestamp      ;
00078         unsigned long   endTimestamp        ;
00079         SyncMode        firstTimeSyncMode   ;
00080         char*           serverNonce         ;
00081         char*           clientNonce         ;
00082         char*           serverID            ;
00083         char*           serverPWD           ;
00084         char*           clientAuthType      ;
00085         char*           serverAuthType      ;
00086         BOOL            isServerAuthRequired;
00087         unsigned long   maxMsgSize          ;
00088         unsigned long   maxModPerMsg        ;
00089         unsigned long   readBufferSize      ;
00090         char*           userAgent           ;
00091         BOOL            checkConn           ;
00092         unsigned int    responseTimeout     ;
00093 
00094         unsigned int dirty;
00095 
00103         void set(char* * buf, const char*  v) EXTRA_SECTION_02;
00104 
00105     public:
00106 
00107         AccessConfig() EXTRA_SECTION_02;
00108         AccessConfig(AccessConfig& s) EXTRA_SECTION_02;
00109         ~AccessConfig() EXTRA_SECTION_02;
00110 
00118         const char*  getUsername() const EXTRA_SECTION_02;
00119 
00127         void setUsername(const char*  username) EXTRA_SECTION_02;
00128 
00132         const char*  getPassword() const EXTRA_SECTION_02;
00133 
00141         void setPassword(const char*  password) EXTRA_SECTION_02;
00142 
00147         SyncMode getFirstTimeSyncMode() const EXTRA_SECTION_02;
00148 
00155         void setFirstTimeSyncMode(SyncMode syncMode) EXTRA_SECTION_02;
00156 
00160         BOOL getUseProxy() const EXTRA_SECTION_02;
00161 
00167         void setUseProxy(BOOL useProxy) EXTRA_SECTION_02;
00168 
00172         const char*  getProxyHost() const EXTRA_SECTION_02;
00173 
00179         void setProxyHost(const char*  proxyHost) EXTRA_SECTION_02;
00180 
00181         int getProxyPort() const EXTRA_SECTION_02;
00182         void setProxyPort(int v) EXTRA_SECTION_02;
00183 
00187         const char* getProxyUsername() const EXTRA_SECTION_02;
00188 
00194         void setProxyUsername(const char*  proxyUsername) EXTRA_SECTION_02;
00195 
00199         const char* getProxyPassword() const EXTRA_SECTION_02;
00200 
00206         void setProxyPassword(const char*  proxyPassword) EXTRA_SECTION_02;
00207 
00213         const char*  getSyncURL() const EXTRA_SECTION_02;
00214 
00222         void setSyncURL(const char*  syncURL) EXTRA_SECTION_02;
00223 
00229         void setBeginSync(unsigned long timestamp) EXTRA_SECTION_02;
00230 
00234         unsigned long getBeginSync() const EXTRA_SECTION_02;
00235 
00241         void setEndSync(unsigned long timestamp) EXTRA_SECTION_02;
00242 
00246         unsigned long getEndSync() const EXTRA_SECTION_02;
00247 
00248         BOOL getServerAuthRequired() const EXTRA_SECTION_02;
00249 
00250         void setServerAuthRequired(BOOL v) EXTRA_SECTION_02;
00251 
00252         const char*  getClientAuthType() const EXTRA_SECTION_02;
00253 
00254         void setClientAuthType(const char*  v) EXTRA_SECTION_02;
00255 
00256         const char*  getServerAuthType() const EXTRA_SECTION_02;
00257 
00258         void setServerAuthType(const char*  v) EXTRA_SECTION_02;
00259 
00260         const char*  getServerPWD() const EXTRA_SECTION_02;
00261 
00262         void setServerPWD(const char*  v) EXTRA_SECTION_02;
00263 
00264         const char*  getServerID() const EXTRA_SECTION_02;
00265 
00266         void setServerID(const char*  v) EXTRA_SECTION_02;
00267 
00268         const char*  getServerNonce() const EXTRA_SECTION_02;
00269 
00270         void setServerNonce(const char*  v) EXTRA_SECTION_02;
00271 
00272         const char*  getClientNonce() const EXTRA_SECTION_02;
00273 
00274         void setClientNonce(const char*  v) EXTRA_SECTION_02;
00275 
00276         void setMaxMsgSize(unsigned long msgSize) EXTRA_SECTION_02;
00277 
00278         unsigned long getMaxMsgSize() const EXTRA_SECTION_02;
00279 
00280         void setMaxModPerMsg(unsigned long msgSize) EXTRA_SECTION_02;
00281 
00282         unsigned long getMaxModPerMsg() const EXTRA_SECTION_02;
00283         
00284         void setReadBufferSize(unsigned long bufferSize);
00285 
00286         unsigned long getReadBufferSize() const EXTRA_SECTION_02;
00287 
00288         const char*  getUserAgent() const EXTRA_SECTION_02;
00289 
00290         void setUserAgent(const char*  v) EXTRA_SECTION_02;
00291 
00292 
00293         void setCheckConn(BOOL v) EXTRA_SECTION_02;
00294         BOOL getCheckConn() const EXTRA_SECTION_02;
00295 
00296         void setResponseTimeout(unsigned int bufferSize)    EXTRA_SECTION_02;
00297         unsigned int getResponseTimeout() const             EXTRA_SECTION_02;
00298 
00302         unsigned int getDirty() const EXTRA_SECTION_02;
00303 
00310         void assign(const AccessConfig& s) EXTRA_SECTION_02;
00311 
00312         /*
00313          * Assign operator
00314          */
00315         AccessConfig& operator = (const AccessConfig& ac) {
00316             assign(ac);
00317             return *this;
00318         }
00319 
00320 };
00321 
00323 #endif

Generated on Fri Apr 27 12:29:18 2007 for Funambol C++ Client Library by  doxygen 1.5.2