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_SYNC_CONFIG
00036 #define INCL_SYNC_CONFIG
00037
00041 #include "spds/AbstractSyncConfig.h"
00042 #include "spds/AccessConfig.h"
00043 #include "spds/DeviceConfig.h"
00044 #include "spds/SyncSourceConfig.h"
00045 #include "base/globalsdef.h"
00046
00047 BEGIN_NAMESPACE
00048
00053 class SyncManagerConfig : public AbstractSyncConfig {
00054 protected:
00055
00056 AccessConfig accessConfig;
00057
00058 DeviceConfig clientConfig;
00059
00060 DeviceConfig serverConfig;
00061 SyncSourceConfig* sourceConfigs;
00062
00063 unsigned int sourceConfigsCount;
00064
00065 virtual bool addSyncSourceConfig(SyncSourceConfig& sc);
00066
00067 public:
00068
00069 SyncManagerConfig();
00070 virtual ~SyncManagerConfig();
00071
00072
00073 virtual AbstractSyncSourceConfig* getAbstractSyncSourceConfig(const char* name) const {
00074 return getSyncSourceConfig(name);
00075 }
00076
00077 virtual AbstractSyncSourceConfig* getAbstractSyncSourceConfig(unsigned int i) const {
00078 return getSyncSourceConfig(i);
00079 }
00080
00081 virtual unsigned int getAbstractSyncSourceConfigsCount() const {
00082 return getSyncSourceConfigsCount();
00083 }
00084
00085
00086 virtual unsigned int getSyncSourceConfigsCount() const { return sourceConfigsCount; }
00087 virtual SyncSourceConfig* getSyncSourceConfigs() const { return sourceConfigs; }
00088 virtual SyncSourceConfig* getSyncSourceConfig(const char* name, bool refresh = false) const;
00089 virtual SyncSourceConfig* getSyncSourceConfig(unsigned int i, bool refresh = false) const;
00090 virtual bool setSyncSourceConfig(SyncSourceConfig& sc);
00091
00092 virtual const AccessConfig& getAccessConfig() const { return accessConfig; }
00093 virtual AccessConfig& getAccessConfig() { return accessConfig; }
00094 virtual void setAccessConfig(AccessConfig& ac) { accessConfig.assign(ac); }
00095
00096
00097
00098 virtual const DeviceConfig& getDeviceConfig() const { return clientConfig; }
00099 virtual DeviceConfig& getDeviceConfig() { return clientConfig; }
00100 virtual void setDeviceConfig(DeviceConfig& dc) { clientConfig.assign(dc); }
00101
00107 virtual const DeviceConfig& getClientConfig() const { return clientConfig; }
00108 virtual DeviceConfig& getClientConfig() { return clientConfig; }
00109 virtual void setClientConfig(DeviceConfig& dc) { clientConfig.assign(dc); }
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 virtual const DeviceConfig& getServerConfig() const {return serverConfig;}
00120 virtual DeviceConfig& getServerConfig() { return serverConfig; }
00121 virtual void setServerConfig(DeviceConfig& dc) { serverConfig.assign(dc); }
00122
00123
00124 unsigned int isDirty() const { return accessConfig.getDirty() ; }
00125
00129 void setClientDefaults();
00130
00134 void setSourceDefaults(const char* name);
00135
00136
00137
00138 virtual const char* getUsername() const { return getAccessConfig().getUsername(); }
00139 virtual const char* getPassword() const { return getAccessConfig().getPassword(); }
00140 virtual bool getUseProxy() const { return getAccessConfig().getUseProxy(); }
00141 virtual const char* getProxyHost() const { return getAccessConfig().getProxyHost(); }
00142 virtual int getProxyPort() const { return getAccessConfig().getProxyPort(); }
00143 virtual const char* getProxyUsername() const { return getAccessConfig().getProxyUsername(); }
00144 virtual const char* getProxyPassword() const { return getAccessConfig().getProxyPassword(); }
00145 virtual const char* getSyncURL() const { return getAccessConfig().getSyncURL(); }
00146 virtual void setSyncURL(const char* v) { getAccessConfig().setSyncURL(v); }
00147 virtual void setBeginSync(unsigned long timestamp) { getAccessConfig().setBeginSync(timestamp); }
00148 virtual void setEndSync(unsigned long timestamp) { getAccessConfig().setEndSync(timestamp); }
00149 virtual bool getServerAuthRequired() const { return getAccessConfig().getServerAuthRequired(); }
00150 virtual const char* getClientAuthType() const { return getAccessConfig().getClientAuthType(); }
00151 virtual const char* getServerAuthType() const { return getAccessConfig().getServerAuthType(); }
00152 virtual const char* getServerPWD() const { return getAccessConfig().getServerPWD(); }
00153 virtual const char* getServerID() const { return getAccessConfig().getServerID(); }
00154 virtual const char* getServerNonce() const { return getAccessConfig().getServerNonce(); }
00155 virtual void setServerNonce(const char* v) { getAccessConfig().setServerNonce(v); }
00156 virtual const char* getClientNonce() const { return getAccessConfig().getClientNonce(); }
00157 virtual void setClientNonce(const char* v) { getAccessConfig().setClientNonce(v); }
00158 virtual unsigned long getMaxMsgSize() const { return getAccessConfig().getMaxMsgSize(); }
00159 virtual unsigned long getReadBufferSize() const { return getAccessConfig().getReadBufferSize(); }
00160 virtual const char* getUserAgent() const { return getAccessConfig().getUserAgent(); }
00161 virtual bool getCompression() const { return getAccessConfig().getCompression(); }
00162 virtual unsigned int getResponseTimeout() const { return getAccessConfig().getResponseTimeout(); }
00163
00164 virtual const char* getMan() const { return getClientConfig().getMan(); }
00165 virtual const char* getMod() const { return getClientConfig().getMod(); }
00166 virtual const char* getOem() const { return getClientConfig().getOem(); }
00167 virtual const char* getFwv() const { return getClientConfig().getFwv(); }
00168 virtual const char* getSwv() const { return getClientConfig().getSwv(); }
00169 virtual const char* getHwv() const { return getClientConfig().getHwv(); }
00170 virtual const char* getDevID() const { return getClientConfig().getDevID(); }
00171 virtual const char* getDevType() const { return getClientConfig().getDevType(); }
00172 virtual const char* getDsV() const { return getClientConfig().getDsV(); }
00173 virtual bool getUtc() const { return getClientConfig().getUtc(); }
00174 virtual bool getLoSupport() const { return getClientConfig().getLoSupport(); }
00175 virtual bool getNocSupport() const { return getClientConfig().getNocSupport(); }
00176 virtual unsigned int getMaxObjSize() const { return getClientConfig().getMaxObjSize(); }
00177 virtual const char* getDevInfHash() const { return getClientConfig().getDevInfHash(); }
00178 virtual void setDevInfHash(const char *hash) { getClientConfig().setDevInfHash(hash); }
00179
00180 virtual bool getSendDevInfo() const { return getClientConfig().getSendDevInfo(); }
00181 virtual void setSendDevInfo(bool v) { getClientConfig().setSendDevInfo(v); }
00182
00183 virtual bool getForceServerDevInfo() const { return getClientConfig().getForceServerDevInfo(); }
00184 virtual void setForceServerDevInfo(bool v) { getClientConfig().setForceServerDevInfo(v); }
00185
00186
00187 virtual void setServerSwv(const char* v) { getServerConfig().setSwv(v); }
00188 virtual void setServerFwv(const char* v) { getServerConfig().setFwv(v); }
00189 virtual void setServerHwv(const char* v) { getServerConfig().setHwv(v); }
00190 virtual void setServerMan(const char* v) { getServerConfig().setMan(v); }
00191 virtual void setServerMod(const char* v) { getServerConfig().setMod(v); }
00192 virtual void setServerOem(const char* v) { getServerConfig().setOem(v); }
00193 virtual void setServerDevID (const char* v) { getServerConfig().setDevID(v); }
00194 virtual void setServerDevType (const char* v) { getServerConfig().setDevType(v); }
00195 virtual void setServerUtc (const bool v) { getServerConfig().setUtc(v); }
00196 virtual void setServerLoSupport (const bool v) { getServerConfig().setLoSupport(v); }
00197 virtual void setServerNocSupport(const bool v) { getServerConfig().setNocSupport(v);}
00198 virtual void setServerVerDTD (const char* v) { getServerConfig().setVerDTD(v); }
00199 virtual void setServerSmartSlowSync(const int v){ getServerConfig().setSmartSlowSync(v); }
00200 virtual void setServerLastSyncURL(const char* v){ getServerConfig().setServerLastSyncURL(v); }
00201
00202 virtual const char* getServerSwv() const { return getServerConfig().getSwv(); }
00203 virtual const char* getServerFwv() const { return getServerConfig().getFwv(); }
00204 virtual const char* getServerHwv() const { return getServerConfig().getHwv(); }
00205 virtual const char* getServerMan() const { return getServerConfig().getMan(); }
00206 virtual const char* getServerMod() const { return getServerConfig().getMod(); }
00207 virtual const char* getServerOem() const { return getServerConfig().getOem(); }
00208 virtual const char* getServerDevID() const { return getServerConfig().getDevID(); }
00209 virtual const char* getServerDevType() const { return getServerConfig().getDevType(); }
00210 virtual bool getServerUtc() const { return getServerConfig().getUtc(); }
00211 virtual bool getServerLoSupport() const { return getServerConfig().getLoSupport(); }
00212 virtual bool getServerNocSupport() const { return getServerConfig().getNocSupport(); }
00213 virtual const char* getServerVerDTD() const { return getServerConfig().getVerDTD(); }
00214 virtual int getServerSmartSlowSync() const { return getServerConfig().getSmartSlowSync(); }
00215 virtual const char* getServerLastSyncURL() const{ return getServerConfig().getServerLastSyncURL(); }
00216
00217 };
00218
00219
00220 END_NAMESPACE
00221
00224 #endif