00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 class AccessConfig {
00066 private:
00067 char* username ;
00068 char* password ;
00069 BOOL useProxy ;
00070 char* proxyHost ;
00071 int proxyPort ;
00072 char* proxyUsername ;
00073 char* proxyPassword ;
00074 char* syncURL ;
00075 unsigned long beginTimestamp ;
00076 unsigned long endTimestamp ;
00077 SyncMode firstTimeSyncMode ;
00078 char* serverNonce ;
00079 char* clientNonce ;
00080 char* serverID ;
00081 char* serverPWD ;
00082 char* clientAuthType ;
00083 char* serverAuthType ;
00084 BOOL isServerAuthRequired;
00085 unsigned long maxMsgSize ;
00086 unsigned long readBufferSize ;
00087 char* userAgent ;
00088 BOOL checkConn ;
00089 unsigned int responseTimeout ;
00090 BOOL compression ;
00091
00092 unsigned int dirty;
00093
00101 void set(char* * buf, const char* v);
00102
00103 public:
00104
00105 AccessConfig();
00106 AccessConfig(AccessConfig& s);
00107 ~AccessConfig();
00108
00116 const char* getUsername() const;
00117
00125 void setUsername(const char* username);
00126
00130 const char* getPassword() const;
00131
00139 void setPassword(const char* password);
00140
00145 SyncMode getFirstTimeSyncMode() const;
00146
00153 void setFirstTimeSyncMode(SyncMode syncMode);
00154
00158 BOOL getUseProxy() const;
00159
00165 void setUseProxy(BOOL useProxy);
00166
00170 const char* getProxyHost() const;
00171
00177 void setProxyHost(const char* proxyHost);
00178
00179 int getProxyPort() const;
00180 void setProxyPort(int v);
00181
00185 const char* getProxyUsername() const;
00186
00192 void setProxyUsername(const char* proxyUsername);
00193
00197 const char* getProxyPassword() const;
00198
00204 void setProxyPassword(const char* proxyPassword);
00205
00211 const char* getSyncURL() const;
00212
00220 void setSyncURL(const char* syncURL);
00221
00227 void setBeginSync(unsigned long timestamp);
00228
00232 unsigned long getBeginSync() const;
00233
00239 void setEndSync(unsigned long timestamp);
00240
00244 unsigned long getEndSync() const;
00245
00246 BOOL getServerAuthRequired() const;
00247
00248 void setServerAuthRequired(BOOL v);
00249
00250 const char* getClientAuthType() const;
00251
00252 void setClientAuthType(const char* v);
00253
00254 const char* getServerAuthType() const;
00255
00256 void setServerAuthType(const char* v);
00257
00258 const char* getServerPWD() const;
00259
00260 void setServerPWD(const char* v);
00261
00262 const char* getServerID() const;
00263
00264 void setServerID(const char* v);
00265
00266 const char* getServerNonce() const;
00267
00268 void setServerNonce(const char* v);
00269
00270 const char* getClientNonce() const;
00271
00272 void setClientNonce(const char* v);
00273
00274 void setMaxMsgSize(unsigned long msgSize);
00275
00276 unsigned long getMaxMsgSize() const;
00277
00278 void setReadBufferSize(unsigned long bufferSize);
00279
00280 unsigned long getReadBufferSize() const;
00281
00282 const char* getUserAgent() const;
00283
00284 void setUserAgent(const char* v);
00285
00286 void setCompression(BOOL v);
00287
00288 BOOL getCompression() const;
00289
00290
00291
00292
00293 void setCheckConn(BOOL v);
00294 BOOL getCheckConn() const;
00295
00296 void setResponseTimeout(unsigned int bufferSize) ;
00297 unsigned int getResponseTimeout() const ;
00298
00302 unsigned int getDirty() const;
00303
00310 void assign(const AccessConfig& s);
00311
00312
00313
00314
00315 AccessConfig& operator = (const AccessConfig& ac) {
00316 assign(ac);
00317 return *this;
00318 }
00319
00320 };
00321
00323 #endif