libepp_nicbr
AsnCreate.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: AsnCreate.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __ASNCREATE_H__
8 #define __ASNCREATE_H__
9 
10 #include "libepp_nicbr.H"
11 
12 #include "Action.H"
13 #include "AsnCreateCmd.H"
14 #include "AsnCreateRsp.H"
15 
16 using std::auto_ptr;
17 
18 LIBEPP_NICBR_NS_BEGIN
19 
21 class AsnCreate : public Action
22 {
23 public:
25  AsnCreate(const ActionType type = ASN_CREATE) : Action(type)
26  {
27  if (type == ASN_CREATE) {
28  _command = auto_ptr<AsnCreateCmd>(new AsnCreateCmd());
29  _response = auto_ptr<AsnCreateRsp>(new AsnCreateRsp());
30  }
31  }
32 
34 
37  void set_xml_template(const string &xml_template);
38 
40 
44  void set_response(const string &xml_payload, DomParser *parser)
45  {
46  get_response()->reset();
47  parser->parse_asn_create_rsp(xml_payload, get_response());
48  }
49 
51 
55  {
56  return (AsnCreateCmd*) _command.get();
57  }
58 
60 
64  {
65  return (AsnCreateRsp*) _response.get();
66  }
67 };
68 
69 LIBEPP_NICBR_NS_END
70 #endif // __ASNCREATE_H__
AsnCreateCmd * get_command()
Returns raw pointer to the command.
Definition: AsnCreate.H:54
Project defines.
EPP Action Class.
EPP AnsCreateRsp Class.
Definition: AsnCreateRsp.H:21
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
AsnCreate(const ActionType type=ASN_CREATE)
Constructor.
Definition: AsnCreate.H:25
EPP AsnCreate Class.
Definition: AsnCreateCmd.H:25
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
void set_response(const string &xml_payload, DomParser *parser)
Pure virtual method to set response from a XML document.
Definition: AsnCreate.H:44
EPP AsnCreateCmd Class.
EPP AsnCreate Class.
Definition: AsnCreate.H:21
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
void set_xml_template(const string &xml_template)
Sets XML template.
AsnCreateRsp * get_response()
Returns raw pointer to the response.
Definition: AsnCreate.H:63
EPP AsnCreateRsp Class.