DomainPlug-insDocumentation
DomainPluginTypes.h
Go to the documentation of this file.
00001 #ifndef DOMAINPLUGINTYPES_H_
00002 #define DOMAINPLUGINTYPES_H_
00003 
00004 #include <stlrt/atypes.h>
00005 
00006 #include <pluginconfig.h>
00007 
00008 struct PLUGINTOOLKIT_DECL DTIOTypeAbstract {
00009   Str log;
00010 };
00011 
00016 struct PLUGINTOOLKIT_DECL DTNameServer {
00017   Str hostName; 
00018   Str ipAddr;   
00019 
00023   DTNameServer () {};
00024 
00030   DTNameServer (const Str & aHostName, const Str & aIPAddr)
00031     : hostName(aHostName), ipAddr(aIPAddr) {}
00032 
00037   DTNameServer (const Str & aHostName)
00038     : hostName(aHostName), ipAddr(Str()) {}
00039 };
00040 
00043 class PLUGINTOOLKIT_DECL DTNameServers {
00044   list<DTNameServer> nses;
00045   mutable list<DTNameServer>::const_iterator iCur;
00046 public:
00047   DTNameServers()
00048     { iCur = nses.end(); };
00049 
00055   void add(const Str & aHostName, const Str & aIPAddr )
00056     { nses.push_back( DTNameServer(aHostName, aIPAddr) ); };
00057 
00062   void add(const Str & aHostName )
00063     { nses.push_back( DTNameServer( aHostName ) ); };
00064 
00068   void clear ()
00069     { nses.clear(); };
00070 
00075   bool next() const {
00076     if ( nses.empty() ) return false;
00077 
00078     if ( iCur == nses.end() ) {
00079       iCur = nses.begin();
00080       return true;
00081     } else
00082       return (nses.end() != ++iCur);
00083   }
00084 
00089   const DTNameServer & get() const {
00090     // TODO: Possible SIGFAULT if call get on empty list (get == end)
00091     return *iCur;
00092   }
00093 
00096   DTNameServers &operator= (const DTNameServers& t) {
00097     if(this==&t) return *this;
00098     nses = t.nses;
00099     iCur = nses.end();
00100     return *this;
00101   }
00102 
00105   DTNameServers(const DTNameServers& t) {
00106     if(this!=&t) {
00107       nses = t.nses;
00108       iCur = nses.end();
00109     }
00110   }
00111 
00112   friend class DTNameServersSerializer;
00113 };
00114 
00117 struct PLUGINTOOLKIT_DECL DTPhone {
00118   Str cc;
00119   Str area;
00120   Str number;
00121   Str ext;
00122   DTPhone() : cc(), area(), number(), ext() {}
00123   DTPhone(const Str & aCc, const Str & aArea, const Str & aNumber, const Str & aExt)
00124     : cc(aCc), area(aArea), number(aNumber), ext(aExt) {}
00125 
00129   Str toE164() const {
00130     if (cc.length() == 0 || number.length() == 0)
00131       return Str("");
00132 
00133     Str e164= Str("+") << cc << "." << area << number;
00134     if ((e164.length() + ext.length()) < 17) {
00135       e164 << ext;
00136     } else {
00137       // "WARNING: E.164 phone number max length 15 digits. Phone extension will be deleted from number";
00138     }
00139     return e164;
00140   }
00141 };
00142 
00144 
00146 class PLUGINTOOLKIT_DECL DTExtData {
00147   map<Str, Str> pdata;
00148   mutable map<Str, Str>::const_iterator iCur;
00149 public:
00152   DTExtData() : iCur( pdata.end() ) {};
00153 
00156   DTExtData(const map<Str, Str> & m) : pdata(m) { iCur = pdata.end(); };
00157 
00162   const Str operator [] (const Str &key) const {
00163     map<Str, Str>::const_iterator it = pdata.find(key);
00164     return ( pdata.end() != it ) ? it->second : Str();
00165   }
00166 
00171   bool isExist(const Str &key) {
00172     return pdata.find(key) != pdata.end();
00173   };
00174 
00180   bool next() const {
00181     if ( pdata.empty() ) return false;
00182 
00183     if ( iCur == pdata.end() ) {
00184       iCur = pdata.begin();
00185       return true;
00186     } else{
00187       return (pdata.end() != ++iCur);
00188     }
00189   };
00190 
00195   const Str & getKey() const {
00196     return iCur->first;
00197   };
00198 
00203   const Str & getValue() const {
00204     return iCur->second;
00205   };
00206 
00212   void add(const Str& key, const Str& val) {
00213     pdata.insert( pair<Str, Str> (key, val) );
00214     iCur = pdata.end();
00215   };
00216 
00222   void set(const Str& key, const Str& val) {
00223     pdata[key] = val;
00224     iCur = pdata.end();
00225   };
00226 
00227 
00228 
00233   bool exists(const Str &key) const {
00234     map<Str, Str>::const_iterator it = pdata.find(key);
00235     return ( pdata.end() == it ) ? false : true;
00236   }
00237 
00241   DTExtData &operator= (const DTExtData& t) {
00242     if(this==&t) return *this;
00243     pdata = t.pdata;
00244     iCur = pdata.end();
00245     return *this;
00246   }
00247 
00251   DTExtData(const DTExtData& t) {
00252     if(this!=&t) {
00253       pdata = t.pdata;
00254       iCur = pdata.end();
00255     }
00256   }
00257 
00258   friend class DTExtDataSerializer;
00259 };
00260 
00264 struct PLUGINTOOLKIT_DECL DTContact {
00265   Int cID; /* Internal contact ID (Now UserID in BM) */
00266   Str orgName;
00267   Str fName; Str mName; Str lName;
00268   Str eMail;
00269   Str address1; Str address2;
00270   Str city; Str state; Str stateName; Str zip; Str country;
00271   DTPhone phone; DTPhone fax;
00272   DTExtData extData;
00273   Str handleID;
00274   Str birthday;
00275   DTContact() {}
00276 };
00277 
00281 struct PLUGINTOOLKIT_DECL DTContacts {
00282   DTContact owner;
00283   DTContact admin;
00284   DTContact bill;
00285   DTContact tech;
00286   DTContacts() {}
00287 };
00288 
00293 enum DTDomainOpType {
00294   TOP_REGISTER  = 1, 
00295   TOP_TRANSFER  = 2, 
00296   TOP_RENEW     = 3, 
00297   TOP_TERMINATE = 4, 
00298   TOP_RESOLVE   = 5  
00299 };
00300 
00305 enum DTDomainChkStatus {
00306   DOMAIN_AVAIL    = 1, 
00307   DOMAIN_NOTAVAIL = 2, 
00308   DOMAIN_ERROR    = 3  
00309 };
00310 
00315 enum DTDomainLock {
00316   DOMAIN_LOCK_SET    = 1, 
00317   DOMAIN_LOCK_NOTSET = 2  
00318 };
00319 
00324 enum DTDomainWhoisPrivacy {
00325   DOMAIN_WHOIS_PRIVACY_SET    = 1,
00326   DOMAIN_WHOIS_PRIVACY_NOTSET = 2 
00327 };
00328 
00333 enum DTDomainOpStatus {
00334   OP_PROCESSING       = 1, 
00335   OP_OK               = 2, 
00336   OP_ERROR            = 3, 
00337   OP_WAITING_CALLBACK = 4 
00338 };
00339 
00343 struct PLUGINTOOLKIT_DECL DTDomainChk {
00344   DTDomainChkStatus status; 
00345   Str msg; 
00346   DTDomainChk() : status(DOMAIN_ERROR), msg( Str() ) {};
00347   DTDomainChk(const DTDomainChkStatus aStatus, const Str &aMsg)
00348     : status( aStatus ), msg( aMsg ) {};
00349 };
00350 
00354 struct PLUGINTOOLKIT_DECL DTDomainTransferChk : public DTDomainChk {
00355   bool isRenewRequired;
00356   DTDomainTransferChk()
00357     : DTDomainChk( DOMAIN_ERROR, Str() ), isRenewRequired(false) {};
00358 
00359   DTDomainTransferChk(const DTDomainChkStatus aStatus, const Str &aMsg)
00360     : DTDomainChk(aStatus , aMsg), isRenewRequired(false) {};
00361 
00362   DTDomainTransferChk(const DTDomainChkStatus aStatus, const bool aIsRenewRequired, const Str &aMsg)
00363     : DTDomainChk(aStatus , aMsg), isRenewRequired(aIsRenewRequired) {};
00364 };
00365 
00366 struct PLUGINTOOLKIT_DECL DTDomain {
00367   Str sld;
00368   Str tld;
00369 
00373   Str domainName() const { return Str() << sld << "." << tld; };
00374 
00380   DTDomain(const Str & aSld, const Str & aTld)
00381     : sld(aSld), tld(aTld) {};
00382   DTDomain() : sld(Str()), tld(Str()) {};
00383 };
00384 
00385 
00386 struct PLUGINTOOLKIT_DECL DTDomainTransfer : public DTDomain {
00387   Str transferKey; 
00388   DTDomainTransfer() : DTDomain(), transferKey(Str()) {};
00389 
00395   DTDomainTransfer(const Str & aSld, const Str & aTld) :
00396     DTDomain(aSld, aTld), transferKey( Str() ) {};
00397 
00404   DTDomainTransfer(const Str & aSld, const Str & aTld, const Str & aTransferKey) :
00405     DTDomain(aSld, aTld), transferKey(aTransferKey) {};
00406 };
00407 
00408 struct PLUGINTOOLKIT_DECL DTInDomainData : public DTDomain {
00413   DTExtData extData;
00414   DTInDomainData() {};
00415 };
00416 
00417 struct PLUGINTOOLKIT_DECL DTInOperationDomain : public DTInDomainData {
00418   DTInOperationDomain() {};
00419 };
00420 
00421 
00422 struct PLUGINTOOLKIT_DECL DTOutGeneral : DTIOTypeAbstract {
00423   Str msg;
00424   DTOutGeneral() : msg( Str() ) {}
00425 };
00426 
00427 struct PLUGINTOOLKIT_DECL DTOutOperationDomain : public DTOutGeneral {
00428   DTDomainOpStatus opStatus; 
00429 
00433   DTExtData extData; 
00434 
00435   DTOutOperationDomain() : opStatus(OP_ERROR) {};
00436 };
00437 
00438 struct PLUGINTOOLKIT_DECL DTInSetLock : public DTInOperationDomain {
00439   DTDomainLock value;
00440   DTInSetLock() {};
00441 };
00442 
00443 struct PLUGINTOOLKIT_DECL DTOutSetLock : public DTOutOperationDomain {
00444   DTOutSetLock() {};
00445 };
00446 
00447 struct PLUGINTOOLKIT_DECL DTInSetWhoisPrivacy : public DTInOperationDomain {
00448   DTDomainWhoisPrivacy value;
00449   DTInSetWhoisPrivacy() {};
00450 };
00451 
00452 struct PLUGINTOOLKIT_DECL DTOutSetWhoisPrivacy : public DTOutOperationDomain {
00453   DTOutSetWhoisPrivacy() {};
00454 };
00455 
00460 enum DTExtDataItemStatus {
00461   EDIS_OK = 1,     
00462   EDIS_FAILED = 2, 
00463   EDIS_NEEDED = 3, 
00464   EDIS_SAVENOTNEED = 4
00465 };
00466 
00470 struct PLUGINTOOLKIT_DECL DTTypedExtDataItem {
00471 
00472   Str paramID;   
00473   Str type;      
00474   Str title;     
00475   Str descr;     
00476   Str defValue;  
00477   bool required; 
00478   DTExtDataItemStatus status; 
00479   Str msg;
00480   DTTypedExtDataItem() {};
00481   DTTypedExtDataItem(
00482     const Str& aKey,
00483     const Str& aType,
00484     const Str& aTitle,
00485     const Str& aDescr,
00486     const Str& aDefValue,
00487     const bool aRequired, 
00488     const DTExtDataItemStatus aStatus,
00489     const Str & aMsg = ""
00490     )
00491       : paramID(aKey), type(aType), title(aTitle), descr(aDescr),
00492         defValue(aDefValue), required(aRequired), status(aStatus), msg( aMsg ) {};
00493 };
00494 
00495 /* ------------------------ Types by API methods ---------------------------- */
00496 
00498 
00501 class DTInCheckAvailability : public DTIOTypeAbstract {
00502   list<DTDomain> listDomainName;
00503   mutable list<DTDomain>::const_iterator iCur;
00504 public:
00505   DTInCheckAvailability()
00506     { iCur = listDomainName.begin(); };
00507 
00509 
00513   void add(const Str & aSld, const Str & aTld)
00514     { listDomainName.push_back( DTDomain(aSld, aTld) ); };
00515   
00517   void clear ()
00518     { listDomainName.clear(); };
00519 
00520 
00526   bool next() const {
00527     if ( listDomainName.empty() ) return false;
00528 
00529     if ( iCur == listDomainName.end() ) {
00530       iCur = listDomainName.begin();
00531       return true;
00532     } else
00533       return (listDomainName.end() != ++iCur);
00534   };
00535 
00540   const DTDomain & get() const {
00541     // TODO: Possible SIGFAULT if call get on empty list (get == end)
00542     return *iCur;
00543   };
00544 
00545   DTInCheckAvailability &operator= (const DTInCheckAvailability& t) {
00546     if(this==&t) return *this;
00547     listDomainName = t.listDomainName;
00548     iCur = listDomainName.end();
00549     return *this;
00550   }
00551 
00552   DTInCheckAvailability(const DTInCheckAvailability& t):DTIOTypeAbstract() {
00553     if(this!=&t) {
00554       listDomainName = t.listDomainName;
00555       iCur = listDomainName.end();
00556     }
00557   }
00558 
00559   friend class DTInCheckAvailabilitySerializer;
00560 };
00561 
00563 
00566 class DTOutCheckAvailability : public DTIOTypeAbstract {
00567   map<Str, DTDomainChk> domainNameSt;
00568   mutable map<Str, DTDomainChk>::const_iterator iCur;
00569 public:
00570   DTOutCheckAvailability() : iCur( domainNameSt.end() ) {};
00571   const DTDomainChk operator [] (const Str& domainName) {
00572     return ( domainNameSt.end() != domainNameSt.find(domainName) )
00573       ? domainNameSt[domainName] : DTDomainChk();
00574   }
00575 
00577 
00582   void add(const Str& domainName, const DTDomainChkStatus status, const Str &msg) {
00583     domainNameSt.insert( pair<Str, DTDomainChk> (domainName, DTDomainChk(status, msg) ) );
00584   }
00585   
00587 
00591   void add(const Str& domainName, const DTDomainChkStatus status) {
00592     domainNameSt.insert(
00593       pair<Str, DTDomainChk> (domainName, DTDomainChk(status, Str()) ) );
00594   }
00595 
00601   bool next() const {
00602     if ( domainNameSt.empty() ) return false;
00603 
00604     if ( iCur == domainNameSt.end() ) {
00605       iCur = domainNameSt.begin();
00606       return true;
00607     } else
00608       return (domainNameSt.end() != ++iCur);
00609   };
00610 
00615   const Str & getName() const {
00616     return iCur->first;
00617   }
00618 
00623   const DTDomainChk & getStatus() const {
00624     return iCur->second;
00625   };
00626 
00631   const DTDomainChk & get() const {
00632     return iCur->second;
00633   };
00634 
00635   DTOutCheckAvailability &operator= (const DTOutCheckAvailability& t) {
00636     if(this==&t) return *this;
00637     domainNameSt = t.domainNameSt;
00638     iCur = domainNameSt.end();
00639     return *this;
00640   }
00641 
00642   DTOutCheckAvailability(const DTOutCheckAvailability& t) : DTIOTypeAbstract(){
00643     if(this!=&t) {
00644       domainNameSt = t.domainNameSt;
00645       iCur = domainNameSt.end();
00646     }
00647   }
00648   friend class DTOutCheckAvailabilitySerializer;
00649 };
00650 
00652 
00653 class DTInCheckTransfer : public DTIOTypeAbstract {
00654   list<DTDomainTransfer> listDomainName;
00655   mutable list<DTDomainTransfer>::const_iterator iCur;
00656 public:
00657   DTInCheckTransfer()
00658     { iCur = listDomainName.begin(); };
00659 
00661 
00665   void add(const Str & sld, const Str & tld)
00666     { listDomainName.push_back( DTDomainTransfer (sld, tld) ); };
00667 
00669 
00674   void add(const Str & sld, const Str & tld, const Str & transferKey)
00675     { listDomainName.push_back( DTDomainTransfer (sld, tld, transferKey) ); };
00676 
00680   void clear ()
00681     { listDomainName.clear(); };
00682 
00687   bool next() const {
00688     if ( listDomainName.empty() ) return false;
00689 
00690     if ( iCur == listDomainName.end() ) {
00691       iCur = listDomainName.begin();
00692       return true;
00693     } else {
00694       return (listDomainName.end() != ++iCur);
00695     }
00696   };
00697 
00702   const DTDomainTransfer & get() const {
00703     return *iCur;
00704   };
00705 
00706   DTInCheckTransfer &operator= (const DTInCheckTransfer& t) {
00707     if(this==&t) return *this;
00708     listDomainName = t.listDomainName;
00709     iCur = listDomainName.end();
00710     return *this;
00711   }
00712 
00713   DTInCheckTransfer(const DTInCheckTransfer& t) : DTIOTypeAbstract(){
00714     if(this!=&t) {
00715       listDomainName = t.listDomainName;
00716       iCur = listDomainName.end();
00717     }
00718   }
00719 
00720 
00721   friend class DTInCheckTransferSerializer;
00722 };
00723 
00724 /* Output struct PLUGINTOOLKIT_DECL for checkTransfer ------------------------------------------ */
00725 class DTOutCheckTransfer : public DTIOTypeAbstract {
00726   map<Str, DTDomainTransferChk> domainNameSt;
00727   mutable map<Str, DTDomainTransferChk>::const_iterator iCur;
00728 public:
00729   DTOutCheckTransfer() : iCur( domainNameSt.end() ) {};
00730   const DTDomainTransferChk operator [] (const Str& domainName) {
00731     return ( domainNameSt.end() != domainNameSt.find(domainName) )
00732       ? domainNameSt[domainName] : DTDomainTransferChk();
00733   }
00734 
00736 
00741   void add(const Str& domainName, const DTDomainChkStatus status, const Str &msg) {
00742     domainNameSt.insert( pair<Str, DTDomainTransferChk> (domainName, DTDomainTransferChk(status, msg) ) );
00743   }
00744 
00746 
00750   void add(const Str& domainName, const DTDomainChkStatus status) {
00751     add( domainName, status, Str() );
00752   }
00753 
00755 
00761   void add(const Str& domainName, const DTDomainChkStatus status, const bool isRenewRequired, const Str &msg) {
00762     domainNameSt.insert(
00763       pair<Str, DTDomainTransferChk> (domainName, DTDomainTransferChk(status, isRenewRequired, msg) ) );
00764   }
00765 
00767 
00772   void add(const Str& domainName, const DTDomainChkStatus status, const bool isRenewRequired) {
00773     add( domainName, status, isRenewRequired, Str() );
00774   }
00775 
00780   bool next() const {
00781     if ( domainNameSt.empty() ) return false;
00782 
00783     if ( iCur == domainNameSt.end() ) {
00784       iCur = domainNameSt.begin();
00785       return true;
00786     } else
00787       return (domainNameSt.end() != ++iCur);
00788   };
00789 
00794   const Str & getName() const {
00795     return iCur->first;
00796   }
00797 
00802   const DTDomainTransferChk & getStatus() const {
00803     return iCur->second;
00804   };
00805 
00809   const DTDomainChk & get() const {
00810     return iCur->second;
00811   };
00812 
00813   DTOutCheckTransfer &operator= (const DTOutCheckTransfer& t) {
00814     if(this==&t) return *this;
00815     domainNameSt = t.domainNameSt;
00816     iCur = domainNameSt.end();
00817     return *this;
00818   }
00819 
00820   DTOutCheckTransfer(const DTOutCheckTransfer& t) : DTIOTypeAbstract() {
00821     if(this!=&t) {
00822       domainNameSt = t.domainNameSt;
00823       iCur = domainNameSt.end();
00824     }
00825   }
00826 
00827   friend class DTOutCheckTransferSerializer;
00828 };
00829 
00831 struct PLUGINTOOLKIT_DECL DTInRegisterDomain : public DTInOperationDomain {
00832   Int period;                // Domain registration period
00833   DTNameServers nameServers;
00834   DTContacts contacts;
00835   DTInRegisterDomain () {};
00836 };
00837 
00839 struct PLUGINTOOLKIT_DECL DTOutRegisterDomain : public DTOutOperationDomain {
00840   Str expDate;                   // format 'YYYY-MM-DD HH:MM:SS'
00841   DTOutRegisterDomain() : expDate( Str() ) {}
00842 };
00843 
00845 struct PLUGINTOOLKIT_DECL DTInTransferDomain : public DTInOperationDomain {
00846   Str transferKey;
00847   Int period;                // transfer includes renewal period
00848   DTNameServers nameServers;
00849   DTContacts contacts;
00850   DTInTransferDomain () {};
00851 };
00852 
00854 struct PLUGINTOOLKIT_DECL DTOutTransferDomain : public DTOutOperationDomain {
00855   Str expDate;                   // format 'YYYY-MM-DD HH:MM:SS'
00856   DTOutTransferDomain() : expDate( Str() ) {}
00857 };
00858 
00860 struct PLUGINTOOLKIT_DECL DTInRenewDomain : public DTInOperationDomain {
00861   Int period;     
00862   DTInRenewDomain () {};
00863 };
00864 
00866 struct PLUGINTOOLKIT_DECL DTOutRenewDomain : public DTOutOperationDomain {
00867   Str expDate;                   
00868   DTOutRenewDomain() : expDate( Str() ) {}
00869 };
00870 
00872 struct PLUGINTOOLKIT_DECL DTInTerminateDomain : public DTInOperationDomain {
00873   DTInTerminateDomain () {};
00874 };
00875 
00877 struct PLUGINTOOLKIT_DECL DTOutTerminateDomain : public DTOutOperationDomain {
00878   DTOutTerminateDomain() {};
00879 };
00880 
00882 struct PLUGINTOOLKIT_DECL DTInGetDomainStatus : public DTInOperationDomain {
00883   DTDomainOpType opType; 
00884   DTInGetDomainStatus() {};
00885 };
00886 
00888 struct PLUGINTOOLKIT_DECL DTOutGetDomainStatus : public DTOutOperationDomain {
00889   Str expDate;                   
00890   DTOutGetDomainStatus(): expDate( Str() ) {};
00891 };
00892 
00894 struct PLUGINTOOLKIT_DECL DTInRegisterContacts : public DTInOperationDomain {
00895   DTContacts contacts;
00896   DTInRegisterContacts() {};
00897 };
00898 
00900 struct PLUGINTOOLKIT_DECL DTOutRegisterContacts : public DTOutOperationDomain {
00901   DTOutRegisterContacts() {};
00902 };
00903 
00905 struct PLUGINTOOLKIT_DECL DTInGetContactsStatus : public DTInOperationDomain {
00906   DTContacts contacts;
00907   DTInGetContactsStatus() {};
00908 };
00909 
00911 struct PLUGINTOOLKIT_DECL DTOutGetContactsStatus : public DTOutOperationDomain {
00912   DTOutGetContactsStatus() {};
00913 };
00914 
00916 struct PLUGINTOOLKIT_DECL DTInRegisterNameServers : public DTInOperationDomain {
00917   DTNameServers nameServers;
00918   DTInRegisterNameServers() {};
00919 };
00920 
00922 struct PLUGINTOOLKIT_DECL DTOutRegisterNameServers : public DTOutOperationDomain {
00923   DTOutRegisterNameServers() {};
00924 };
00925 
00927 struct PLUGINTOOLKIT_DECL DTInGetNameServersStatus : public DTInOperationDomain {
00928   DTNameServers nameServers;
00929   DTInGetNameServersStatus() {};
00930 };
00931 
00933 struct PLUGINTOOLKIT_DECL DTOutGetNameServersStatus : public DTOutOperationDomain {
00934   DTOutGetNameServersStatus() {};
00935 };
00936 
00938 struct PLUGINTOOLKIT_DECL DTInGetDomainDetails : public DTInDomainData {
00939   DTInGetDomainDetails() {};
00940 };
00941 
00943 struct PLUGINTOOLKIT_DECL DTOutGetDomainDetails : public DTOutGeneral {
00944   Str regDate;
00945   Str expDate;
00946   DTOutGetDomainDetails() : regDate( Str() ), expDate( Str() ) {};
00947 };
00948 
00950 struct PLUGINTOOLKIT_DECL DTInUpdateDomainNameServers : public DTInOperationDomain {
00951   DTNameServers nameServers;
00952   DTInUpdateDomainNameServers() {};
00953 };
00954 
00956 struct PLUGINTOOLKIT_DECL DTOutUpdateDomainNameServers : public DTOutOperationDomain {
00957   DTOutUpdateDomainNameServers() {};
00958 };
00959 
00961 struct PLUGINTOOLKIT_DECL DTInUpdateDomainContacts : public DTInOperationDomain {
00962   DTContacts contacts;
00963   DTInUpdateDomainContacts() {};
00964 };
00965 
00967 struct PLUGINTOOLKIT_DECL DTOutUpdateDomainContacts : public DTOutOperationDomain {
00968   DTOutUpdateDomainContacts() {};
00969 };
00970 
00972 struct PLUGINTOOLKIT_DECL DTInGetDomainNameServersStatus : public DTInOperationDomain {
00973   DTNameServers nameServers;
00974   DTInGetDomainNameServersStatus() {};
00975 };
00976 
00978 struct PLUGINTOOLKIT_DECL DTOutGetDomainNameServersStatus : public DTOutOperationDomain {
00979   DTOutGetDomainNameServersStatus() {};
00980 };
00981 
00983 struct PLUGINTOOLKIT_DECL DTInGetDomainContactsStatus : public DTInOperationDomain {
00984   DTContacts contacts;
00985   DTInGetDomainContactsStatus() {};
00986 };
00987 
00989 struct PLUGINTOOLKIT_DECL DTOutGetDomainContactsStatus : public DTOutOperationDomain {
00990   DTOutGetDomainContactsStatus() {};
00991 };
00992 
00994 struct PLUGINTOOLKIT_DECL DTInGetDomainNameServers : public DTInOperationDomain {
00995   Str domain;
00996   DTInGetDomainNameServers(const Str& _domain):domain(_domain){}
00997 };
00998 
01000 struct PLUGINTOOLKIT_DECL DTOutGetDomainNameServers : public DTOutOperationDomain {
01001   DTNameServers nameServers;
01002 };
01003 
01005 struct PLUGINTOOLKIT_DECL DTInValidateExtData : public DTDomain {
01006   DTDomainOpType opType; 
01007   DTExtData extData;     
01008   DTInValidateExtData() : opType( TOP_REGISTER ) {};
01009 };
01010 
01012 struct PLUGINTOOLKIT_DECL DTRegisteredDomainInfo : public DTInDomainData {
01013   DTNameServers nameServers;
01014   DTContacts contacts;
01015   DTRegisteredDomainInfo () {};
01016 };
01017 
01018 
01020 
01023 class DTOutValidateExtData : public DTIOTypeAbstract {
01024   list<DTTypedExtDataItem> items;
01025   mutable list<DTTypedExtDataItem>::const_iterator iCur;
01026 public:
01027   DTOutValidateExtData() : iCur( items.end() ) {}
01029 
01038   void add(
01039     const Str& key,      
01040     const Str& type,     
01041     const Str& title,    
01042     const Str& descr,    
01043     const Str& defValue, 
01044     const bool required,
01045     const DTExtDataItemStatus status,
01046     const Str & msg = ""
01047   )
01048   {
01049     items.push_back(DTTypedExtDataItem(key, type, title, descr, defValue, required, status, msg));
01050   }
01051 
01052   const DTTypedExtDataItem operator [] (const Str& key) {
01053     for(list<DTTypedExtDataItem>::const_iterator it = items.begin(); it != items.end(); ++it) {
01054       if (it->paramID == key)
01055         return *it;
01056     }
01057     return DTTypedExtDataItem();
01058   }
01059 
01063   void clear ()
01064      { items.clear(); };
01065 
01070   bool next() const {
01071      if ( items.empty() ) return false;
01072 
01073      if ( iCur == items.end() ) {
01074        iCur = items.begin();
01075        return true;
01076      } else
01077        return (items.end() != ++iCur);
01078   };
01079 
01080   const DTTypedExtDataItem & get() const {
01081     // TODO: Possible SIGFAULT if call get on empty list (get == end)
01082     return *iCur;
01083   };
01084   DTOutValidateExtData &operator= (const DTOutValidateExtData& t) {
01085     if(this==&t) return *this;
01086     items = t.items;
01087     iCur = items.end();
01088     return *this;
01089   }
01090 
01091   DTOutValidateExtData(const DTOutValidateExtData& t) : DTIOTypeAbstract(){
01092     if(this!=&t) {
01093       items = t.items;
01094       iCur = items.end();
01095     }
01096   }
01097 
01098   friend class DTOutValidateExtDataSerializer;
01099 };
01100 
01101 /* Async plug-in processing */
01102 struct PLUGINTOOLKIT_DECL DTInCallback {
01103   Str data;
01104   DTInCallback() {};
01105 };
01106 
01110 enum DTCallbackItemStatus {
01111   CBIS_PROCESSING  = 1, 
01112   CBIS_OK          = 2, 
01113   CBIS_ERROR       = 3, 
01114   CBIS_NOT_CHANGED = 4  
01115 };
01116 
01120 enum DTCallbackItemType {
01121   CBIT_OPERATE_DOMAIN = 1, 
01122   CBIT_UPDATE_DOMAIN  = 2, 
01123   CBIT_REG_NS         = 3, 
01124   CBIT_REG_CONTACT    = 4, 
01125   CBIT_NONE           = 5  
01126 };
01127 
01129 
01132 struct PLUGINTOOLKIT_DECL DTCallbackResult {
01133   Str domainName; 
01134   Str expDate;    
01135   DTCallbackItemType type; 
01136   DTCallbackItemStatus status; 
01137 
01138   DTCallbackResult() {type = CBIT_NONE; status = CBIS_NOT_CHANGED;};
01139 };
01140 
01141 struct PLUGINTOOLKIT_DECL DTOutCallback : DTOutGeneral {
01142   list<DTCallbackResult> results;
01143   DTOutCallback () {};
01144 };
01145 
01146 
01147 #endif /* DOMAINPLUGINTYPES_H_ */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines