Commit 1a218504 authored by YannGarcia's avatar YannGarcia
Browse files

Start TPs for group Pull Service

parent 24851ae3
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
  loggers::get_instance().log("<<< json_codec::encode");
  return 0;
}

*/
int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params)
{
  loggers::get_instance().log_msg(">>> json_codec::decode: p_data=", p_data);
@@ -64,16 +64,10 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
  loggers::get_instance().log("json_codec::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str());
  TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));

  if (it->second.find("\"DequeueRegistrationQueueUri\"") != std::string::npos) { 
    LibNg112__DequeueRegistration::DequeueRegistrationRequest dequeue_registration_request;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    dequeue_registration_request.decode(LibNg112__DequeueRegistration::DequeueRegistrationRequest_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.dequeueRegistrationRequest() = dequeue_registration_request;
  } else if (it->second.find("\"DequeueRegistrationStatusCode\"") != std::string::npos) { 
    LibNg112__DequeueRegistration::DequeueRegistrationResponse dequeue_registration_response;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    dequeue_registration_response.decode(LibNg112__DequeueRegistration::DequeueRegistrationResponse_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.dequeueRegistrationResponse() = dequeue_registration_response;
  if ((it->second.find("\"code\"") != std::string::npos) && (it->second.find("\"message\"")) != std::string::npos) { 
    LibJrcSimu__TypesAndValues::ProblemDetails problem_details;
    problem_details.decode(LibJrcSimu__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.problem__details() = problem_details;
  } else {
    loggers::get_instance().warning("json_codec::decode: Unsupported variant");
    return -1;
@@ -82,6 +76,6 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
  loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type&)msg);
  return 0;
}
*/


json_codec_factory json_codec_factory::_f;
+1 −1
Original line number Diff line number Diff line
@@ -18,6 +18,6 @@ public:
  virtual ~json_codec() { };

  virtual int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data) { return -1; };
  virtual int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL) { return -1; };
  virtual int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL);

}; // End of class json_codec
+4 −0
Original line number Diff line number Diff line
@@ -105,6 +105,10 @@ int xml_codec::decode (const OCTETSTRING& p_data, LibHttp__XmlMessageBodyTypes::
    http__www__cise__eu__servicemodel__v1__message::PullResponse pull_response;
    pull_response.decode(http__www__cise__eu__servicemodel__v1__message::PullResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.pull__response() = pull_response;
  } else if ((it->second.find("<Acknowledgement") != std::string::npos) || (it->second.find(":Acknowledgement") != std::string::npos)) {
    http__www__cise__eu__servicemodel__v1__message::Acknowledgement acknowledgement;
    acknowledgement.decode(http__www__cise__eu__servicemodel__v1__message::Acknowledgement_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.acknowledgement() = acknowledgement;
  } else {
    loggers::get_instance().warning("xml_codec::decode: Unsupported variant");
    return -1;
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ namespace LibCise__Functions {
    time_t t = std::time(nullptr);
    auto tm = *std::localtime(&t);
    std::ostringstream oss;
    oss << std::put_time(&tm, "%FT%T%z");
    oss << std::put_time(&tm, "%FT%T");//%FT%T%Z

    CHARSTRING dt(oss.str().c_str());
    loggers::get_instance().log_msg("fx__get__current__date__time: ", dt);
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
		},
		{
			"path": "../../frameworks/cisedist"
		},
		{
			"path": "../../frameworks/cise-sim"
		}
	],
	"settings": {
Loading