libepp_nicbr
ContactUpdate.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: ContactUpdate.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __CONTACT_UPDATE_H__
8 #define __CONTACT_UPDATE_H__
9 
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 
14 #include "Action.H"
15 #include "ContactUpdateCmd.H"
16 #include "Response.H"
17 
18 using std::auto_ptr;
19 
20 LIBEPP_NICBR_NS_BEGIN
21 
23 class ContactUpdate : public Action
24 {
25 public:
26 
28  ContactUpdate(const ActionType type = CONTACT_UPDATE) : Action(type)
29  {
30  if (type == CONTACT_UPDATE) {
31  _command = auto_ptr<ContactUpdateCmd>(new ContactUpdateCmd());
32  _response = auto_ptr<Response>(new Response());
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_update_rsp(xml_payload, get_response());
51  }
52 
54 
58  {
59  return (ContactUpdateCmd*) _command.get();
60  }
61 
62 };
63 
64 LIBEPP_NICBR_NS_END
65 #endif //__CONTACT_UPDATE_H__
EPP Response Class.
Definition: Response.H:24
ContactUpdateCmd * get_command()
Returns raw pointer to the command.
Definition: ContactUpdate.H:57
Project defines.
void parse_contact_update_rsp(const string &xml_payload, Response *rsp)
Parse the response to a contact update command.
EPP Response Class.
EPP Action Class.
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
EPP ContactUpdateCmd Class.
void set_xml_template(const string &xml_template)
Sets the xml template and parses the tags.
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
EPP ContactUpdate Class.
Definition: ContactUpdate.H:23
Response * get_response()
Returns raw pointer to the response.
Definition: Action.H:60
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
void set_response(const string &xml_payload, DomParser *parser)
Sets the response attribute.
Definition: ContactUpdate.H:47
ContactUpdate(const ActionType type=CONTACT_UPDATE)
Constructor.
Definition: ContactUpdate.H:28
EPP ContactUpdateCmd Class.
Definition: ContactUpdateCmd.H:26
void reset()
reset attributes
Definition: Response.H:161