00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef INCL_ACCESS_CONFIG
00036 #define INCL_ACCESS_CONFIG
00037
00039 #include "base/fscapi.h"
00040 #include "spds/constants.h"
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
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 class AccessConfig {
00083 private:
00084 char* username ;
00085 char* password ;
00086 BOOL useProxy ;
00087 char* proxyHost ;
00088 int proxyPort ;
00089 char* proxyUsername ;
00090 char* proxyPassword ;
00091 char* syncURL ;
00092 unsigned long beginTimestamp ;
00093 unsigned long endTimestamp ;
00094 SyncMode firstTimeSyncMode ;
00095 char* serverNonce ;
00096 char* clientNonce ;
00097 char* serverID ;
00098 char* serverPWD ;
00099 char* clientAuthType ;
00100 char* serverAuthType ;
00101 BOOL isServerAuthRequired;
00102 unsigned long maxMsgSize ;
00103 unsigned long readBufferSize ;
00104 char* userAgent ;
00105 BOOL checkConn ;
00106 unsigned int responseTimeout ;
00107 BOOL compression ;
00108
00109 unsigned int dirty;
00110
00118 void set(char* * buf, const char* v);
00119
00120 public:
00121
00122 AccessConfig();
00123 AccessConfig(AccessConfig& s);
00124 ~AccessConfig();
00125
00133 const char* getUsername() const;
00134
00142 void setUsername(const char* username);
00143
00147 const char* getPassword() const;
00148
00156 void setPassword(const char* password);
00157
00162 SyncMode getFirstTimeSyncMode() const;
00163
00170 void setFirstTimeSyncMode(SyncMode syncMode);
00171
00175 BOOL getUseProxy() const;
00176
00182 void setUseProxy(BOOL useProxy);
00183
00187 const char* getProxyHost() const;
00188
00194 void setProxyHost(const char* proxyHost);
00195
00196 int getProxyPort() const;
00197 void setProxyPort(int v);
00198
00202 const char* getProxyUsername() const;
00203
00209 void setProxyUsername(const char* proxyUsername);
00210
00214 const char* getProxyPassword() const;
00215
00221 void setProxyPassword(const char* proxyPassword);
00222
00228 const char* getSyncURL() const;
00229
00237 void setSyncURL(const char* syncURL);
00238
00244 void setBeginSync(unsigned long timestamp);
00245
00249 unsigned long getBeginSync() const;
00250
00256 void setEndSync(unsigned long timestamp);
00257
00261 unsigned long getEndSync() const;
00262
00263 BOOL getServerAuthRequired() const;
00264
00265 void setServerAuthRequired(BOOL v);
00266
00267 const char* getClientAuthType() const;
00268
00269 void setClientAuthType(const char* v);
00270
00271 const char* getServerAuthType() const;
00272
00273 void setServerAuthType(const char* v);
00274
00275 const char* getServerPWD() const;
00276
00277 void setServerPWD(const char* v);
00278
00279 const char* getServerID() const;
00280
00281 void setServerID(const char* v);
00282
00283 const char* getServerNonce() const;
00284
00285 void setServerNonce(const char* v);
00286
00287 const char* getClientNonce() const;
00288
00289 void setClientNonce(const char* v);
00290
00291 void setMaxMsgSize(unsigned long msgSize);
00292
00293 unsigned long getMaxMsgSize() const;
00294
00295 void setReadBufferSize(unsigned long bufferSize);
00296
00297 unsigned long getReadBufferSize() const;
00298
00299 const char* getUserAgent() const;
00300
00301 void setUserAgent(const char* v);
00302
00303 void setCompression(BOOL v);
00304
00305 BOOL getCompression() const;
00306
00307
00308
00309
00310 void setCheckConn(BOOL v);
00311 BOOL getCheckConn() const;
00312
00313 void setResponseTimeout(unsigned int bufferSize) ;
00314 unsigned int getResponseTimeout() const ;
00315
00319 unsigned int getDirty() const;
00320
00327 void assign(const AccessConfig& s);
00328
00329
00330
00331
00332 AccessConfig& operator = (const AccessConfig& ac) {
00333 assign(ac);
00334 return *this;
00335 }
00336
00337 };
00338
00340 #endif