Author: damitha
Date: Wed Sep 17 22:40:34 2008
New Revision: 696564

URL: http://svn.apache.org/viewvc?rev=696564&view=rev
Log:
Supporting ref params in acks_to element

Modified:
    webservices/sandesha/trunk/c/include/sandesha2_acks_to.h
    webservices/sandesha/trunk/c/include/sandesha2_constants.h
    webservices/sandesha/trunk/c/include/sandesha2_utils.h
    webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
    webservices/sandesha/trunk/c/src/util/ack_mgr.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/wsrm/acks_to.c

Modified: webservices/sandesha/trunk/c/include/sandesha2_acks_to.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_acks_to.h?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_acks_to.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_acks_to.h Wed Sep 17 
22:40:34 2008
@@ -84,6 +84,17 @@
        const axutil_env_t *env, 
     void *om_node);
  
+axutil_array_list_t *AXIS2_CALL
+sandesha2_acks_to_get_ref_param_list(
+    sandesha2_acks_to_t * acks_to,
+    const axutil_env_t * env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_acks_to_add_ref_param(
+    sandesha2_acks_to_t * acks_to,
+    const axutil_env_t * env,
+    axiom_node_t * ref_param_node);
+
 /** @} */
 #ifdef __cplusplus
 }

Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Wed Sep 17 
22:40:34 2008
@@ -241,6 +241,8 @@
        #define SANDESHA2_SEQ_PROP_TO_EPR  "ToEPR"
 
        #define SANDESHA2_SEQ_PROP_ACKS_TO_EPR  "acksToEPR"
+       
+    #define SANDESHA2_SEQ_PROP_ACKS_TO_REF_PARAM  "acksToRefParam"
 
        #define SANDESHA2_SEQUENCE_PROPERTY_RMS_SEQ_ID  "OutSequenceId"
 

Modified: webservices/sandesha/trunk/c/include/sandesha2_utils.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_utils.h?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_utils.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_utils.h Wed Sep 17 22:40:34 
2008
@@ -300,6 +300,15 @@
     const axutil_env_t * env,
     axis2_svc_t * svc);
 
+axis2_char_t *AXIS2_CALL
+sandesha2_util_storage_mgr_get_node_string_from_node_array(
+    const axutil_env_t *env,
+    axutil_array_list_t *node_list);
+
+axutil_array_list_t *AXIS2_CALL
+sandesha2_permanent_storage_mgr_get_node_list_from_string(
+    const axutil_env_t *env,
+    axis2_char_t *node_list_str);
 
 /** @} */
 #ifdef __cplusplus

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c 
Wed Sep 17 22:40:34 2008
@@ -167,8 +167,12 @@
     sandesha2_msg_ctx_t *rm_create_seq_res_msg_ctx = NULL;
     sandesha2_create_seq_res_t *create_seq_res_part = NULL;
     sandesha2_seq_offer_t *seq_offer = NULL;
-    axis2_endpoint_ref_t *acks_to = NULL;
+    axis2_endpoint_ref_t *acks_to_epr = NULL;
+    sandesha2_acks_to_t *acks_to = NULL;
     sandesha2_seq_property_bean_t *acks_to_bean = NULL;
+    sandesha2_seq_property_bean_t *acks_to_ref_param_bean = NULL;
+    axutil_array_list_t *ref_param_list = NULL;
+    axis2_char_t *ref_param_list_str = NULL;
     sandesha2_seq_property_bean_t *to_bean = NULL;
     axis2_engine_t *engine = NULL;
     axis2_char_t *addr_ns_uri = NULL;
@@ -403,10 +407,10 @@
         }
     }
 
-    acks_to = sandesha2_address_get_epr(sandesha2_acks_to_get_address(
-                sandesha2_create_seq_get_acks_to(create_seq_part, env), env), 
env);
+    acks_to = sandesha2_create_seq_get_acks_to(create_seq_part, env);
+    acks_to_epr = 
sandesha2_address_get_epr(sandesha2_acks_to_get_address(acks_to, env), env);
 
-    if(!acks_to || !axis2_endpoint_ref_get_address(acks_to, env))
+    if(!acks_to_epr || !axis2_endpoint_ref_get_address(acks_to_epr, env))
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]Acks to is null");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_INVALID_EPR, 
AXIS2_FAILURE);
@@ -440,8 +444,8 @@
     }
 
     acks_to_bean = sandesha2_seq_property_bean_create_with_data(env, 
rmd_sequence_id, 
-            SANDESHA2_SEQ_PROP_ACKS_TO_EPR, 
(axis2_char_t*)axis2_endpoint_ref_get_address(acks_to, 
-                env));
+            SANDESHA2_SEQ_PROP_ACKS_TO_EPR, 
(axis2_char_t*)axis2_endpoint_ref_get_address(
+                acks_to_epr, env));
 
     if(acks_to_bean)
     {
@@ -449,6 +453,20 @@
         sandesha2_seq_property_bean_free(acks_to_bean, env);
     }
 
+    ref_param_list = sandesha2_acks_to_get_ref_param_list(acks_to, env);
+    if(ref_param_list)
+    {
+        ref_param_list_str = 
sandesha2_util_storage_mgr_get_node_string_from_node_array(env, ref_param_list);
+        acks_to_ref_param_bean = 
sandesha2_seq_property_bean_create_with_data(env, rmd_sequence_id,
+            SANDESHA2_SEQ_PROP_ACKS_TO_REF_PARAM, ref_param_list_str);
+
+        if(acks_to_ref_param_bean)
+        {
+            sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, 
acks_to_ref_param_bean);
+            sandesha2_seq_property_bean_free(acks_to_ref_param_bean, env);
+        }
+    }
+
     axis2_op_ctx_set_response_written(op_ctx, env, AXIS2_TRUE);
     sandesha2_seq_mgr_update_last_activated_time(env, rmd_sequence_id, 
seq_prop_mgr);
 

Modified: webservices/sandesha/trunk/c/src/util/ack_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/ack_mgr.c?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/ack_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/ack_mgr.c Wed Sep 17 22:40:34 2008
@@ -54,6 +54,7 @@
     /*axiom_soap_envelope_t *soap_env = NULL;*/
     axis2_op_ctx_t *op_ctx = NULL;
     axis2_char_t *uuid = NULL;
+    sandesha2_seq_property_bean_t *ref_param_bean = NULL;
     
     AXIS2_PARAM_CHECK(env->error, seq_id, NULL);
     AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
@@ -104,6 +105,33 @@
     /*soap_env = axiom_soap_envelope_create_default_soap_envelope(env, 
      * sandesha2_utils_get_soap_version(env, 
axis2_msg_ctx_get_soap_envelope(ref_msg, env)));
     axis2_msg_ctx_set_soap_envelope(ack_msg_ctx, env, soap_env);*/
+    
+    ref_param_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, 
+            seq_id, SANDESHA2_SEQ_PROP_ACKS_TO_REF_PARAM);
+
+    if(ref_param_bean)
+    {
+        axis2_char_t *ref_param_str = NULL;
+        axutil_array_list_t *ref_param_list = NULL;
+        int i = 0, size = 0;
+
+        ref_param_str = sandesha2_seq_property_bean_get_value(ref_param_bean, 
env);
+        ref_param_list = 
sandesha2_permanent_storage_mgr_get_node_list_from_string(env, 
+                ref_param_str);
+
+        if(ref_param_list)
+        {
+            size = axutil_array_list_size(ref_param_list, env);
+        }
+
+        for(i = 0; i < size; i++)
+        {
+            axiom_node_t *node = NULL;
+
+            node = axutil_array_list_get(ref_param_list, env, i);
+            axis2_endpoint_ref_add_ref_param(to, env, node);
+        }
+    }
 
     axis2_msg_ctx_set_to(ack_msg_ctx, env, to);
 

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Wed Sep 17 22:40:34 
2008
@@ -1446,3 +1446,78 @@
 
     return axis2_rm_assertion_get_from_policy(env, service_policy);
 }
+
+axis2_char_t *AXIS2_CALL
+sandesha2_util_storage_mgr_get_node_string_from_node_array(
+    const axutil_env_t *env,
+    axutil_array_list_t *node_list)
+{
+    axis2_char_t *node_list_str = NULL;
+    int i = 0, size = 0;
+
+    size = axutil_array_list_size(node_list, env);
+    for(i = 0; i < size; i++)
+    {
+        axiom_node_t *node = NULL;
+        axis2_char_t *node_str = NULL;
+        axis2_char_t *temp_str = NULL;
+
+        node = axutil_array_list_get(node_list, env, i);
+        node_str = axiom_node_to_string(node, env);
+
+        temp_str = node_list_str;
+        node_list_str = axutil_strcat(env, temp_str, 
+                node_str, SANDESHA2_PERSISTANT_PROPERTY_SEPERATOR, NULL);
+
+        if(node_str)
+        {
+            AXIS2_FREE(env->allocator, node_str);
+        }
+
+        if(temp_str && axutil_strlen(temp_str) > 0)
+        {
+            AXIS2_FREE(env->allocator, temp_str);
+        }
+    }
+
+    return node_list_str;
+}
+
+axutil_array_list_t *AXIS2_CALL
+sandesha2_permanent_storage_mgr_get_node_list_from_string(
+    const axutil_env_t *env,
+    axis2_char_t *node_list_str)
+{
+    axutil_array_list_t *value_list = NULL;
+    int i = 0, size = 0;
+    axutil_array_list_t *node_list = axutil_array_list_create(env, 0);
+
+    value_list = sandesha2_utils_split(env, node_list_str, 
SANDESHA2_PERSISTANT_PROPERTY_SEPERATOR);
+    if(value_list)
+    {
+        size = axutil_array_list_size(value_list, env);
+    }
+   
+    for(i = 0; i < size; i++)
+    {
+        axiom_stax_builder_t *om_builder = NULL;
+        axiom_xml_reader_t *reader = NULL;
+        axiom_document_t *document = NULL;
+        axis2_char_t *value = NULL;
+        axiom_node_t *node = NULL;
+        
+        value = axutil_array_list_get(value_list, env, i);
+        reader = axiom_xml_reader_create_for_memory(env, value, 
axutil_strlen(value), NULL, 
+                AXIS2_XML_PARSER_TYPE_BUFFER);
+
+        om_builder = axiom_stax_builder_create(env, reader);
+        document = axiom_stax_builder_get_document(om_builder, env);
+        axiom_document_build_all(document, env);
+        node = axiom_document_get_root_element(document, env);
+        axutil_array_list_add(node_list, env, node);
+        axiom_stax_builder_free_self(om_builder, env);
+    }
+
+    return node_list;
+}
+

Modified: webservices/sandesha/trunk/c/src/wsrm/acks_to.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/wsrm/acks_to.c?rev=696564&r1=696563&r2=696564&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/wsrm/acks_to.c (original)
+++ webservices/sandesha/trunk/c/src/wsrm/acks_to.c Wed Sep 17 22:40:34 2008
@@ -17,6 +17,8 @@
 #include <sandesha2_acks_to.h>
 #include <sandesha2_constants.h>
 #include <sandesha2_error.h>
+#include <axis2_addr.h>
+
 /** 
  * @brief AcksTo struct impl
  *     Sandesha2 AcksTo
@@ -152,6 +154,9 @@
     axiom_element_t *acks_to_part = NULL; 
     axiom_node_t *acks_to_node = NULL;
     axutil_qname_t *acks_to_qname = NULL;
+    axutil_qname_t *ref_param_qname = NULL;
+    axiom_element_t *ref_params_ele = NULL; 
+    axiom_node_t *ref_params_node = NULL;
     
     AXIS2_PARAM_CHECK(env->error, om_node, NULL);
      
@@ -194,6 +199,37 @@
     {
         return NULL;
     }
+
+    ref_param_qname =
+        axutil_qname_create(env, EPR_REFERENCE_PARAMETERS, acks_to->rm_ns_val, 
NULL);
+
+    ref_params_ele = axiom_element_get_first_child_with_qname(acks_to_part, 
env,
+        ref_param_qname, acks_to_node, &ref_params_node);
+    
+    if(ref_param_qname)
+    {
+        axutil_qname_free(ref_param_qname, env);
+    }
+
+    if(ref_params_ele)
+    {
+        axiom_child_element_iterator_t *ref_param_iter = NULL;
+
+        ref_param_iter =
+            axiom_element_get_child_elements(ref_params_ele, env, 
ref_params_node);
+        if (ref_param_iter)
+        {
+            while (AXIOM_CHILD_ELEMENT_ITERATOR_HAS_NEXT(ref_param_iter, env))
+            {
+                axiom_node_t *om_node = NULL;
+                axiom_element_t *om_ele = NULL;
+                om_node = AXIOM_CHILD_ELEMENT_ITERATOR_NEXT(ref_param_iter, 
env);
+                om_ele = (axiom_element_t *) 
axiom_node_get_data_element(om_node, env);
+                sandesha2_acks_to_add_ref_param(acks_to, env, om_node);        
            
+            }
+        }
+    }
+
     return acks_to; 
 }
 
@@ -206,6 +242,7 @@
     axiom_namespace_t *rm_ns = NULL;
     axiom_element_t *at_element = NULL;
     axiom_node_t *at_node = NULL;
+    int i = 0, size = 0;
     
     AXIS2_PARAM_CHECK(env->error, om_node, NULL);
     
@@ -227,6 +264,14 @@
     }
     sandesha2_address_to_om_node(acks_to->address, env, at_node);
     axiom_node_add_child((axiom_node_t*)om_node, env, at_node);
+    
+    size = axutil_array_list_size(acks_to->ref_param_list, env);
+    for(i = 0; i < size; i++)
+    {
+        axiom_node_t *node = axutil_array_list_get(acks_to->ref_param_list, 
env, i);
+        axiom_node_add_child((axiom_node_t*)om_node, env, node);
+    }
+
     return (axiom_node_t*)om_node;
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to