feb9127c0fb95dd864532144938d91b05b4d15cc
[gssweb.git] / json_gssapi / src / GSSImportName.cpp
1 /*
2  * Copyright (c) 2014 <copyright holder> <email>
3  * 
4  * For license details, see the LICENSE file in the root of this project.
5  * 
6  */
7
8 #include "GSSImportName.h"
9 #include "GSSException.h"
10
11 void GSSImportName::execute()
12 {
13   this->outputName = GSSName(inputName, inputNameType, function);
14 }
15
16 JSONObject *GSSImportName::toJSON()
17 {
18   return new JSONObject();
19 }
20
21 GSSImportName::GSSImportName(JSONObject *params, gss_imp_name_type fn) : GSSCommand(params)
22 {
23   /* Variables */
24   /* Error checking */
25   /* Setup */
26   /* Main */
27   loadParameters(params);
28   function = fn;
29   /* Cleanup */
30   /* Return */
31   
32 }
33
34 bool GSSImportName::loadParameters(JSONObject *params)
35 {
36   /* Variables */
37   /* Error checking */
38   /* Setup */
39   // Should I zeroOut?
40   
41   /* Main processing */
42   // Easy stuff(*params)
43   std::string input_name = (*params)["arguments"]["input_name"].string();
44   std::string input_name_type = (*params)["arguments"]["input_name_type"].string();
45   
46   this->inputName.setValue( input_name );
47   this->inputNameType.setValue( input_name_type );
48   
49   /* Cleanup */
50   /* Return */
51   return true;
52 }
53
54
55 /* Variables */
56 /* Error checking */
57 /* Setup */
58 /* Main */
59 /* Cleanup */
60 /* Return */