libepp_nicbr
DomainCreate.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: DomainCreate.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __DOMAIN_CREATE_H__
8 #define __DOMAIN_CREATE_H__
9 
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 
14 #include "Action.H"
15 #include "DomainCreateCmd.H"
16 #include "DomainCreateRsp.H"
17 
18 using std::auto_ptr;
19 
20 LIBEPP_NICBR_NS_BEGIN
21 
23 class DomainCreate : public Action
24 {
25 public:
27  DomainCreate(const ActionType type = DOMAIN_CREATE) : Action(type)
28  {
29  if (type == DOMAIN_CREATE) {
30  _command = auto_ptr<DomainCreateCmd>(new DomainCreateCmd());
31  _response = auto_ptr<DomainCreateRsp>(new DomainCreateRsp());
32  }
33  }
34 
36 
39  void set_xml_template(const string &xml_template);
40 
42 
46  void set_response(const string &xml_payload, DomParser *parser)
47  {
48  get_response()->reset();
49  parser->parse_domain_create_rsp(xml_payload, get_response());
50  }
51 
53 
57  {
58  return (DomainCreateCmd*) _command.get();
59  }
60 
62 
66  {
67  return (DomainCreateRsp*) _response.get();
68  }
69 };
70 
71 LIBEPP_NICBR_NS_END
72 #endif //__DOMAIN_CREATE_H__
DomainCreateCmd * get_command()
Returns raw pointer to the command.
Definition: DomainCreate.H:56
EPP DomainCreateRsp Class.
Definition: DomainCreateRsp.H:21
Project defines.
EPP DomainCreateCmd Class.
DomainCreateRsp * get_response()
Returns raw pointer to the response.
Definition: DomainCreate.H:65
EPP Action Class.
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
void parse_domain_create_rsp(const string &xml_payload, DomainCreateRsp *rsp)
Parse the response to a domain create command.
void set_response(const string &xml_payload, DomParser *parser)
Pure virtual method to set response from a XML document.
Definition: DomainCreate.H:46
EPP DomainCreate Class.
Definition: DomainCreate.H:23
EPP DomainCreateRsp Class.
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
EPP DomainCreateCmd Class.
Definition: DomainCreateCmd.H:32
DomainCreate(const ActionType type=DOMAIN_CREATE)
Constructor.
Definition: DomainCreate.H:27
void set_xml_template(const string &xml_template)
Sets XML template.