|
@@ -11,10 +11,13 @@
|
|
|
namespace ResourceWatcher {
|
|
|
class ResourceWatcherService_ClientBase : public CClientSessionBase {
|
|
|
public:
|
|
|
- ResourceWatcherService_ClientBase(CEntityBase *pEntity) : m_pEntityBase(pEntity), m_bSysManaged(false) {}
|
|
|
+ explicit ResourceWatcherService_ClientBase(CEntityBase *pEntity) : m_pEntityBase(pEntity), m_bSysManaged(false) {}
|
|
|
|
|
|
protected:
|
|
|
- virtual ~ResourceWatcherService_ClientBase() {}
|
|
|
+ virtual ~ResourceWatcherService_ClientBase()
|
|
|
+ {
|
|
|
+ /// override by user
|
|
|
+ }
|
|
|
public:
|
|
|
|
|
|
ErrorCodeEnum Connect(CSmartPointer<IAsynWaitSp> &spAsyncWait)
|
|
@@ -210,6 +213,64 @@ public:
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
+ ErrorCodeEnum UpdateDNS(ResourceWatcherService_UpdateDNS_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
|
|
|
+ {
|
|
|
+ CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
|
|
|
+ CAutoBuffer Buf = SpObject2Buffer(Req);
|
|
|
+ return pFunc->AsyncRequest(ResourceWatcherService_Method_UpdateDNS, ResourceWatcherService_MethodSignature_UpdateDNS, Buf, spAsyncWait, dwTimeout);
|
|
|
+ }
|
|
|
+ ErrorCodeEnum UpdateDNS(ResourceWatcherService_UpdateDNS_Req &Req, ResourceWatcherService_UpdateDNS_Ans &Ans, DWORD dwTimeout)
|
|
|
+ {
|
|
|
+ CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
+ ErrorCodeEnum Error = UpdateDNS(Req, spAsyncWait, dwTimeout);
|
|
|
+ if (Error == Error_Succeed) {
|
|
|
+ bool bEnd = false;
|
|
|
+ Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
|
|
|
+ LOG_ASSERT(Error || bEnd);
|
|
|
+ }
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ ErrorCodeEnum UpdateDNS(ResourceWatcherService_UpdateDNS_Req &Req, ResourceWatcherService_UpdateDNS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
|
|
|
+ {
|
|
|
+ CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
+ ErrorCodeEnum Error = UpdateDNS(Req, spAsyncWait, dwTimeout);
|
|
|
+ if (Error == Error_Succeed) {
|
|
|
+ bool bEnd = false;
|
|
|
+ Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
|
|
|
+ LOG_ASSERT(Error || bEnd);
|
|
|
+ }
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+
|
|
|
+ ErrorCodeEnum GetNetworkInfo(ResourceWatcherService_GetNetworkInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
|
|
|
+ {
|
|
|
+ CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
|
|
|
+ CAutoBuffer Buf = SpObject2Buffer(Req);
|
|
|
+ return pFunc->AsyncRequest(ResourceWatcherService_Method_GetNetworkInfo, ResourceWatcherService_MethodSignature_GetNetworkInfo, Buf, spAsyncWait, dwTimeout);
|
|
|
+ }
|
|
|
+ ErrorCodeEnum GetNetworkInfo(ResourceWatcherService_GetNetworkInfo_Req &Req, ResourceWatcherService_GetNetworkInfo_Ans &Ans, DWORD dwTimeout)
|
|
|
+ {
|
|
|
+ CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
+ ErrorCodeEnum Error = GetNetworkInfo(Req, spAsyncWait, dwTimeout);
|
|
|
+ if (Error == Error_Succeed) {
|
|
|
+ bool bEnd = false;
|
|
|
+ Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
|
|
|
+ LOG_ASSERT(Error || bEnd);
|
|
|
+ }
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ ErrorCodeEnum GetNetworkInfo(ResourceWatcherService_GetNetworkInfo_Req &Req, ResourceWatcherService_GetNetworkInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
|
|
|
+ {
|
|
|
+ CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
+ ErrorCodeEnum Error = GetNetworkInfo(Req, spAsyncWait, dwTimeout);
|
|
|
+ if (Error == Error_Succeed) {
|
|
|
+ bool bEnd = false;
|
|
|
+ Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
|
|
|
+ LOG_ASSERT(Error || bEnd);
|
|
|
+ }
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
bool SafeDelete()
|
|
|
{
|
|
@@ -219,7 +280,7 @@ public:
|
|
|
return m_bSysManaged;
|
|
|
}
|
|
|
|
|
|
-protected:
|
|
|
+private:
|
|
|
bool m_bSysManaged;
|
|
|
CEntityBase *m_pEntityBase;
|
|
|
};
|