00001 #ifndef DOMAINPLUGINCLASS_H_ 00002 #define DOMAINPLUGINCLASS_H_ 00003 00004 #include "DomainPluginTypes.h" 00005 #include <MiddleWare/rresult.h> 00006 #include "SerializerDPT.h" 00007 00008 #include <Comm/exc_comm.h> 00009 #include <Comm/atracer.h> 00010 00011 #define DTEXC_NO_SUCH_METHOD Exc(COMM_ERR_NO_METHOD, "No such method"); 00012 00027 template <class T > class DTPlugin { 00028 protected: 00029 StrStream Logger; 00030 Int registrarID; 00031 Int collectorID; 00032 T *ths; 00033 00034 public: 00035 DTPlugin() {}; 00036 virtual void init(Int rID, Int cID, T* self) 00037 {registrarID = rID; collectorID = cID, ths = self;}; 00038 00039 00040 Str getLog() { return Logger; }; 00041 00043 00051 virtual const DTOutCheckAvailability 00052 checkAvailability(const DTInCheckAvailability & input) { throw DTEXC_NO_SUCH_METHOD }; 00053 00055 00065 virtual const DTOutCheckTransfer 00066 checkTransfer(const DTInCheckTransfer & input) { throw DTEXC_NO_SUCH_METHOD }; 00067 00069 00075 virtual const DTOutRegisterDomain 00076 registerDomain(const DTInRegisterDomain & input) { throw DTEXC_NO_SUCH_METHOD }; 00077 00079 00085 virtual const DTOutTransferDomain 00086 transferDomain(const DTInTransferDomain & input) { throw DTEXC_NO_SUCH_METHOD }; 00087 00089 00095 virtual const DTOutRenewDomain 00096 renewDomain(const DTInRenewDomain & input) { throw DTEXC_NO_SUCH_METHOD }; 00097 00099 00104 virtual const DTOutTerminateDomain 00105 terminateDomain(const DTInTerminateDomain & input) { throw DTEXC_NO_SUCH_METHOD }; 00106 00108 00114 virtual const DTOutGetDomainStatus 00115 getDomainStatus(const DTInGetDomainStatus & input) { throw DTEXC_NO_SUCH_METHOD }; 00116 00118 00126 virtual const DTOutRegisterContacts 00127 registerContacts(const DTInRegisterContacts & input) { throw DTEXC_NO_SUCH_METHOD }; 00128 00129 00131 00140 virtual const DTOutGetContactsStatus 00141 getContactsStatus(const DTInGetContactsStatus & input) { throw DTEXC_NO_SUCH_METHOD }; 00142 00144 00151 virtual const DTOutRegisterNameServers 00152 registerNameServers(const DTInRegisterNameServers & input) { throw DTEXC_NO_SUCH_METHOD }; 00153 00154 00156 00163 virtual const DTOutGetNameServersStatus 00164 getNameServersStatus(const DTInGetNameServersStatus &) { throw DTEXC_NO_SUCH_METHOD }; 00165 00167 00177 virtual const DTOutGetDomainDetails 00178 getDomainDetails(const DTInGetDomainDetails & input) { throw DTEXC_NO_SUCH_METHOD }; 00179 00180 00182 00186 virtual const DTOutUpdateDomainNameServers 00187 updateDomainNameServers(const DTInUpdateDomainNameServers & input) { throw DTEXC_NO_SUCH_METHOD }; 00188 00190 00194 virtual const DTOutUpdateDomainContacts 00195 updateDomainContacts(const DTInUpdateDomainContacts & input) { throw DTEXC_NO_SUCH_METHOD }; 00196 00198 00202 virtual const DTOutGetDomainNameServersStatus 00203 getDomainNameServersStatus(const DTInGetDomainNameServersStatus & input) { throw DTEXC_NO_SUCH_METHOD }; 00204 00206 00210 virtual const DTOutGetDomainContactsStatus 00211 getDomainContactsStatus(const DTInGetDomainContactsStatus & input) { throw DTEXC_NO_SUCH_METHOD }; 00212 00214 00222 virtual const DTOutValidateExtData 00223 validateExtData(const DTInValidateExtData & input) { throw DTEXC_NO_SUCH_METHOD }; 00224 00226 00232 virtual const DTOutSetLock 00233 setLock(const DTInSetLock & input) { throw DTEXC_NO_SUCH_METHOD }; 00234 00236 00241 virtual const DTOutSetWhoisPrivacy 00242 setWhoisPrivacy(const DTInSetWhoisPrivacy & input) { throw DTEXC_NO_SUCH_METHOD }; 00243 00245 00252 virtual const DTOutCallback 00253 processCallback(const DTInCallback & input) { throw DTEXC_NO_SUCH_METHOD }; 00254 00261 const DTRegisteredDomainInfo getRegisteredDomainInfo ( const Str domainName ) const { 00262 TRObject ro("DOMAINGATE_Object", "DOMAINGATE_Container"); 00263 ro["GetRegisteredDomainInfo"] << domainName; 00264 RemoteResult rr(ro); 00265 ItemResult * ir = (ItemResult*)( rr.GetMethodResult() ); 00266 Str data; ir->istream() >> data; 00267 00268 DTRegisteredDomainInfoSerializer ser; 00269 DTRegisteredDomainInfo di= ser.unserialize( data ); 00270 00271 return di; 00272 } 00273 00274 virtual ~DTPlugin() {}; 00275 }; 00276 00277 #endif /* DOMAINPLUGINCLASS_H_ */