/* * Copyright (C) 2006 Registro.br. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * 1. Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ /* $Id: DomParser.H 846 2006-12-06 19:51:08Z cacm $ */ /** @file DomParser.H * @brief EPP DomParser Class */ #ifndef __DOMPARSER_H__ #define __DOMPARSER_H__ #include "DomParserCommon.H" #include "Response.H" #include "Greeting.H" #include "ContactCreateRsp.H" #include "ContactInfoRsp.H" #include "DomainCheckRsp.H" #include "DomainCreateRsp.H" #include "DomainInfoRsp.H" #include "DomainRenewRsp.H" #include "PollRsp.H" #include "BrDomainCheckRsp.H" #include "BrDomainInfoRsp.H" #include "BrDomainCreateRsp.H" #include "BrDomainRenewRsp.H" #include "BrDomainUpdateRsp.H" #include "BrOrgInfoRsp.H" #include "BrOrgCheckRsp.H" #include "PanDataRsp.H" #include "BrOrgPanDataRsp.H" #include "BrDomainPanDataRsp.H" LIBEPP_NICBR_NS_BEGIN /// EPP DomParser Class class DomParser : public DomParserCommon { public: /// Parse method to be used by the Unit Test to validate commands /** @param xml_payload Command (in XML format) to be validated */ void parse_command(const string &xml_payload); /// Parse the response to a login command /** @param xml_payload XML to be parsed @param rsp Pointer to a response */ void parse_login_rsp(const string &xml_payload, Response *rsp); /// Parse the response to a logout command /** @param xml_payload XML to be parsed @param rsp Pointer to a response */ void parse_logout_rsp(const string &xml_payload, Response *rsp); /// Parse the response to a connect or hello command /** @param xml_payload XML to be parsed @param greeting Pointer to a greeting response */ void parse_greeting(const string &xml_payload, Greeting *greeting); /// Parse the response to a contact check command /** @param xml_payload XML to be parsed @param rsp Pointer to a contact check response */ void parse_contact_check_rsp(const string &xml_payload, ContactCheckRsp *rsp); /// Parse the response to a contact create command /** @param xml_payload XML to be parsed @param rsp Pointer to a contact create response */ void parse_contact_create_rsp(const string &xml_payload, ContactCreateRsp *rsp); /// Parse the response to a contact info command /** @param xml_payload XML to be parsed @param rsp Pointer to a contact info response */ void parse_contact_info_rsp(const string &xml_payload, ContactInfoRsp *rsp); /// Parse the response to a contact update command /** @param xml_payload XML to be parsed @param rsp Pointer to a response */ void parse_contact_update_rsp(const string &xml_payload, Response *rsp); /// Parse the response to a domain check command /** @param xml_payload XML to be parsed @param rsp Pointer to a domain check response */ void parse_domain_check_rsp(const string &xml_payload, DomainCheckRsp *rsp); /// Parse the response to a domain create command /** @param xml_payload XML to be parsed @param rsp Pointer to a domain create response */ void parse_domain_create_rsp(const string &xml_payload, DomainCreateRsp *rsp); /// Parse the response to a domain info command /** @param xml_payload XML to be parsed @param rsp Pointer to a domain info response */ void parse_domain_info_rsp(const string &xml_payload, DomainInfoRsp *rsp); /// Parse the response to a domain renew command /** @param xml_payload XML to be parsed @param rsp Pointer to a domain renew response */ void parse_domain_renew_rsp(const string &xml_payload, DomainRenewRsp *rsp); /// Parse the response to a domain update command /** @param xml_payload XML to be parsed @param rsp Pointer to a response */ void parse_domain_update_rsp(const string &xml_payload, Response *rsp); /// Parse the response to a poll command /** @param xml_payload XML to be parsed @param rsp Pointer to a poll response */ void parse_poll_rsp(const string &xml_payload, PollRsp *rsp); protected: /// Parse the response /** @param xml_payload XML to be parsed @param rsp Pointer to a response */ void parse_response(const string &xml_payload, Response *rsp); /// Gets data from an extValue element /** @param n Pointer to a node of the document tree @param value value sub-element of extValue @param xmlns value sub-element's attribute @param reason reason sub-element of extValue */ void get_extValue_info(DOMNode *n, string &value, string &xmlns, string &reason); /// Fills a result part of a Response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a Response object */ void fill_result(DOMNode *n, Response *rsp); /// Fills a Response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a Response object */ void fill_response(DOMNode *n, Response *rsp); /// Fills a Greeting object /** @param n Pointer to a node of the document tree @param greeting Pointer to a greeting object */ void fill_greeting(DOMNode *n, Greeting *greeting); /// Fills a Contact check response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a contact check response */ void fill_contact_check_rsp(DOMNode *n, ContactCheckRsp *rsp); /// Fills a Contact info response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a contact info response */ void fill_contact_info_rsp(DOMNode *n, ContactInfoRsp *rsp); /// Fills a Contact create response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a contact create response */ void fill_contact_create_rsp(DOMNode *n, ContactCreateRsp *rsp); /// Fills a Contact PanData response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a PanData response */ void fill_contact_pandata_rsp(DOMNode *n, PanDataRsp *rsp); /// Fills a Domain check response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a domain check response */ void fill_domain_check_rsp(DOMNode *n, DomainCheckRsp *rsp); /// Fills a Domain info response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a domain info response */ void fill_domain_info_rsp(DOMNode *n, DomainInfoRsp *rsp); /// Fills a Domain create response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a domain create response */ void fill_domain_create_rsp(DOMNode *n, DomainCreateRsp *rsp); /// Fills a Domain renew response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a domain renew response */ void fill_domain_renew_rsp(DOMNode *n, DomainRenewRsp *rsp); /// Fills a Domain PanData response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a PanData response */ void fill_domain_pandata_rsp(DOMNode *n, PanDataRsp *rsp); /// Fills a Poll response object /** @param n Pointer to a node of the document tree @param poll_rsp Pointer to a poll response */ void fill_poll_rsp(DOMNode *n, PollRsp *poll_rsp); /// Fills a BrOrg Info response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a BrOrg Info response */ void fill_brorg_info_rsp(DOMNode *n, BrOrgInfoRsp *rsp); /// Fills a BrOrg Check response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a BrOrg Check response */ void fill_brorg_check_rsp(DOMNode *n, BrOrgCheckRsp *rsp); /// Fills a BrOrg PanData response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a BrOrgPanData response */ void fill_brorg_pandata_rsp(DOMNode *n, BrOrgPanDataRsp *rsp); /// Fills a BrDomain check response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a BrDomain check response */ void fill_brdomain_check_rsp(DOMNode *n, BrDomainCheckRsp *rsp); /// Fills a BrDomain info response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a domain info response */ void fill_brdomain_info_rsp(DOMNode *n, BrDomainInfoRsp *rsp); /// Fills a BrDomain create response object /** @param n Pointer to a node of the document tree @param d_rsp Pointer to a BrDomain create response */ void fill_brdomain_create_rsp(DOMNode *n, BrDomainCreateRsp *rsp); /// Fills a BrDomain renew response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a domain renew response */ void fill_brdomain_renew_rsp(DOMNode *n, BrDomainRenewRsp *rsp); /// Fills a BrDomain update response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a BrDomain update response */ void fill_brdomain_update_rsp(DOMNode *n, BrDomainUpdateRsp *rsp); /// Fills a BrDomain PanData response object /** @param n Pointer to a node of the document tree @param rsp Pointer to a BrDomainPanData response */ void fill_brdomain_pandata_rsp(DOMNode *n, BrDomainPanDataRsp *rsp); }; LIBEPP_NICBR_NS_END #endif //__DOMPARSER_H__