libepp_nicbr
ContactCheck.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: ContactCheck.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __CONTACT_CHECK_H__
8 #define __CONTACT_CHECK_H__
9 
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 
14 #include "Action.H"
15 #include "ContactCheckCmd.H"
16 #include "ContactCheckRsp.H"
17 
18 using std::auto_ptr;
19 
20 LIBEPP_NICBR_NS_BEGIN
21 
23 class ContactCheck : public Action
24 {
25 public:
26 
28  ContactCheck(const ActionType type = CONTACT_CHECK) : Action(type)
29  {
30  if (type == CONTACT_CHECK) {
31  _command = auto_ptr<ContactCheckCmd>(new ContactCheckCmd());
32  _response = auto_ptr<ContactCheckRsp>(new ContactCheckRsp());
33  }
34  }
35 
37 
40  void set_xml_template(const string &xml_template);
41 
43 
47  void set_response(const string &xml_payload, DomParser *parser)
48  {
49  get_response()->reset();
50  parser->parse_contact_check_rsp(xml_payload, get_response());
51  }
52 
54 
58  {
59  return (ContactCheckCmd*) _command.get();
60  }
61 
63 
67  {
68  return (ContactCheckRsp*) _response.get();
69  }
70 
71 };
72 
73 LIBEPP_NICBR_NS_END
74 #endif //__CONTACT_CHECK_H__
ContactCheckRsp * get_response()
Returns raw pointer to the response.
Definition: ContactCheck.H:66
void reset()
reset attributes
Definition: ContactCheckRsp.H:58
Project defines.
void set_xml_template(const string &xml_template)
Sets XML template.
EPP ContactCheck Class.
Definition: ContactCheck.H:23
EPP Action Class.
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
void parse_contact_check_rsp(const string &xml_payload, ContactCheckRsp *rsp)
Parse the response to a contact check command.
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
EPP ContactCheckCmd Class.
Definition: ContactCheckCmd.H:23
ContactCheck(const ActionType type=CONTACT_CHECK)
Constructor.
Definition: ContactCheck.H:28
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
void set_response(const string &xml_payload, DomParser *parser)
Pure virtual method to set response from a XML document.
Definition: ContactCheck.H:47
ActionType
Action Types.
Definition: CommonData.H:23
EPP ContactCheckRsp Class.
EPP ContactCheckCmd Class.
ContactCheckCmd * get_command()
Returns raw pointer to the command.
Definition: ContactCheck.H:57
EPP ContactCheckRsp Class.
Definition: ContactCheckRsp.H:24