2 * Copyright (c) 2014 <copyright holder> <email>
4 * For license details, see the LICENSE file in the root of this project.
8 #include "GSSImportName.h"
9 #include "GSSException.h"
11 void GSSImportName::execute()
13 this->outputName = GSSName(inputName, inputNameType, function);
14 this->retVal = this->outputName.getMajorStatus();
15 this->minor_status = this->outputName.getMinorStatus();
16 this->outputName.setKey("constant for now");
19 JSONObject *GSSImportName::toJSON()
22 JSONObject *ret = new JSONObject();
23 JSONObject *values = new JSONObject();
30 values->set("major_status", this->retVal);
31 values->set("minor_status", this->minor_status);
32 values->set("gss_name", this->outputName.getKey().c_str() );
33 ret->set("command", "gss_import_name");
34 ret->set("return_values", *values);
42 GSSImportName::GSSImportName(JSONObject *params, gss_imp_name_type fn) : GSSCommand(params)
48 loadParameters(params);
55 bool GSSImportName::loadParameters(JSONObject *params)
63 // Easy stuff(*params)
64 std::string input_name = (*params)["arguments"]["input_name"].string();
65 std::string input_name_type = (*params)["arguments"]["input_name_type"].string();
67 this->inputName.setValue( input_name );
68 this->inputNameType.setValue( input_name_type );