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