From 4847f59f4c95cade2d07f87a514cfbc996d2f833 Mon Sep 17 00:00:00 2001 From: bri Date: Mon, 10 Feb 2014 18:14:25 +0400 Subject: [PATCH] Check-in operation without any modifications is possible --- src/CheckIn.cpp | 229 ++++++++++++++++++++++++++++++++++++++++++- src/CheckIn.h | 56 ++++++++++- src/SimanIO_Link.cxx | 3 +- 3 files changed, 285 insertions(+), 3 deletions(-) diff --git a/src/CheckIn.cpp b/src/CheckIn.cpp index 56cea6b..8f865de 100644 --- a/src/CheckIn.cpp +++ b/src/CheckIn.cpp @@ -32,6 +32,8 @@ isValidArgs1 = false; + isValidArgs2 = false; + qname = axutil_qname_create (Environment::getEnv(), "checkIn", "http://salome.service.ws_server.splat.org", @@ -39,7 +41,7 @@ } - org_splat_ws_server_service_salome::CheckIn::CheckIn(std::string arg_Args0,int64_t arg_Args1) + org_splat_ws_server_service_salome::CheckIn::CheckIn(std::string arg_Args0,int64_t arg_Args1,int64_t arg_Args2) { qname = NULL; @@ -50,6 +52,8 @@ isValidArgs1 = true; + isValidArgs2 = true; + qname = axutil_qname_create (Environment::getEnv(), "checkIn", "http://salome.service.ws_server.splat.org", @@ -59,6 +63,8 @@ property_Args1 = arg_Args1; + property_Args2 = arg_Args2; + } org_splat_ws_server_service_salome::CheckIn::~CheckIn() { @@ -243,6 +249,78 @@ element_qname = NULL; } + + + /* + * building args2 element + */ + + + + /* + * because elements are ordered this works fine + */ + + + if(current_node != NULL && is_early_node_valid) + { + current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); + + + while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) + { + current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); + } + if(current_node != NULL) + { + current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); + mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); + } + + } + is_early_node_valid = false; + + element_qname = axutil_qname_create(Environment::getEnv(), "args2", "http://salome.service.ws_server.splat.org", NULL); + + + if ( + (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) + { + if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) + { + is_early_node_valid = true; + } + + + text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); + if(text_value != NULL) + { + status = setArgs2(axutil_strtol(text_value, (char**)NULL, 0)); + } + + else + { + WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element args2"); + status = AXIS2_FAILURE; + } + + if(AXIS2_FAILURE == status) + { + WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for args2 "); + if(element_qname) + { + axutil_qname_free(element_qname, Environment::getEnv()); + } + return AXIS2_FAILURE; + } + } + + if(element_qname) + { + axutil_qname_free(element_qname, Environment::getEnv()); + element_qname = NULL; + } + return status; } @@ -293,6 +371,8 @@ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; + axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; + axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; @@ -462,6 +542,70 @@ } + if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING))) + { + p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); + sprintf(p_prefix, "n%d", (*next_ns_index)++); + axutil_hash_set(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING, p_prefix); + + axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), + "http://salome.service.ws_server.splat.org", p_prefix)); + } + + + if (!isValidArgs2) + { + + /* no need to complain for minoccurs=0 element */ + + + } + else + { + start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * + (4 + axutil_strlen(p_prefix) + + axutil_strlen("args2"))); + + /* axutil_strlen("<:>") + 1 = 4 */ + end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * + (5 + axutil_strlen(p_prefix) + axutil_strlen("args2"))); + /* axutil_strlen("") + 1 = 5 */ + + + + + + + /* + * parsing args2 element + */ + + + + sprintf(start_input_str, "<%s%sargs2>", + p_prefix?p_prefix:"", + (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); + + start_input_str_len = axutil_strlen(start_input_str); + sprintf(end_input_str, "", + p_prefix?p_prefix:"", + (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); + end_input_str_len = axutil_strlen(end_input_str); + + sprintf (text_value_3, AXIS2_PRINTF_INT64_FORMAT_SPECIFIER, (int64_t) property_Args2); + + axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); + + axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); + + axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); + + + AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); + AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); + } + + if(namespaces) { axutil_hash_index_t *hi; @@ -647,3 +791,86 @@ + /** + * Getter for args2 by Property Number 3 + */ + int64_t WSF_CALL + org_splat_ws_server_service_salome::CheckIn::getProperty3() + { + return getArgs2(); + } + + /** + * getter for args2. + */ + int64_t WSF_CALL + org_splat_ws_server_service_salome::CheckIn::getArgs2() + { + return property_Args2; + } + + /** + * setter for args2 + */ + bool WSF_CALL + org_splat_ws_server_service_salome::CheckIn::setArgs2( + const int64_t arg_Args2) + { + + + if(isValidArgs2 && + arg_Args2 == property_Args2) + { + + return true; + } + + + + + resetArgs2(); + + + property_Args2 = arg_Args2; + isValidArgs2 = true; + + return true; + } + + + + /** + * resetter for args2 + */ + bool WSF_CALL + org_splat_ws_server_service_salome::CheckIn::resetArgs2() + { + int i = 0; + int count = 0; + + + + isValidArgs2 = false; + return true; + } + + /** + * Check whether args2 is nill + */ + bool WSF_CALL + org_splat_ws_server_service_salome::CheckIn::isArgs2Nil() + { + return !isValidArgs2; + } + + /** + * Set args2 to nill (currently the same as reset) + */ + bool WSF_CALL + org_splat_ws_server_service_salome::CheckIn::setArgs2Nil() + { + return resetArgs2(); + } + + + diff --git a/src/CheckIn.h b/src/CheckIn.h index 091f652..1f756c4 100644 --- a/src/CheckIn.h +++ b/src/CheckIn.h @@ -46,6 +46,10 @@ namespace org_splat_ws_server_service_salome bool isValidArgs1; + int64_t property_Args2; + + + bool isValidArgs2; /*** Private methods ***/ @@ -55,6 +59,10 @@ namespace org_splat_ws_server_service_salome setArgs1Nil(); + bool WSF_CALL + setArgs2Nil(); + + /******************************* public functions *********************************/ @@ -80,9 +88,10 @@ namespace org_splat_ws_server_service_salome * @param * @param Args0 std::string * @param Args1 int64_t + * @param Args2 int64_t * @return newly created CheckIn object */ - CheckIn(std::string arg_Args0,int64_t arg_Args1); + CheckIn(std::string arg_Args0,int64_t arg_Args1,int64_t arg_Args2); /********************************** Class get set methods **************************************/ @@ -135,6 +144,30 @@ namespace org_splat_ws_server_service_salome WSF_EXTERN bool WSF_CALL resetArgs1(); + + + /** + * Getter for args2. + * @return int64_t* + */ + WSF_EXTERN int64_t WSF_CALL + getArgs2(); + + /** + * Setter for args2. + * @param arg_Args2 int64_t* + * @return true on success, false otherwise + */ + WSF_EXTERN bool WSF_CALL + setArgs2(const int64_t arg_Args2); + + /** + * Re setter for args2 + * @return true on success, false + */ + WSF_EXTERN bool WSF_CALL + resetArgs2(); + /******************************* Checking and Setting NIL values *********************************/ @@ -173,6 +206,16 @@ namespace org_splat_ws_server_service_salome + /** + * Check whether args2 is Nill + * @return true if the element is Nil, false otherwise + */ + bool WSF_CALL + isArgs2Nil(); + + + + /**************************** Serialize and De serialize functions ***************************/ /*********** These functions are for use only inside the generated code *********************/ @@ -249,6 +292,17 @@ namespace org_splat_ws_server_service_salome getProperty2(); + + + /** + * Getter for args2 by property number (3) + * @return int64_t + */ + + int64_t WSF_CALL + getProperty3(); + + }; diff --git a/src/SimanIO_Link.cxx b/src/SimanIO_Link.cxx index fca55dd..25b4899 100644 --- a/src/SimanIO_Link.cxx +++ b/src/SimanIO_Link.cxx @@ -297,7 +297,8 @@ void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf) CheckIn* aCheckInRequest = new CheckIn(); CheckInResponse* aCheckInResponse = new CheckInResponse(); aCheckInRequest->setArgs0(aPutFileResponse->get_return()); - aCheckInRequest->setArgs1(atoll(myUser.c_str())); + aCheckInRequest->setArgs1(atoll(myScenario.c_str())); + aCheckInRequest->setArgs2(atoll(myUser.c_str())); aCheckInResponse = aStub->checkIn(aCheckInRequest); //Delete the directories -- 2.39.2