You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sh...@apache.org on 2009/08/18 12:45:18 UTC
svn commit: r805352 [2/5] - in /webservices/axis2/trunk/c/neethi/src: ./
rmpolicy/ secpolicy/builder/ secpolicy/model/
Modified: webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion.c (original)
+++ webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion.c Tue Aug 18 10:45:16 2009
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -40,7 +39,7 @@
axis2_char_t *storage_mgr;
axis2_char_t *message_types_to_drop;
axis2_char_t *max_retrans_count;
- axis2_char_t *sender_sleep_time;
+ axis2_char_t *sender_sleep_time;
axis2_char_t *invoker_sleep_time;
axis2_char_t *polling_wait_time;
axis2_char_t *terminate_delay;
@@ -53,10 +52,10 @@
{
axis2_rm_assertion_t *rm_assertion;
- rm_assertion = (axis2_rm_assertion_t *) AXIS2_MALLOC(env->allocator,
- sizeof(axis2_rm_assertion_t));
+ rm_assertion = (axis2_rm_assertion_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(axis2_rm_assertion_t));
- if (rm_assertion == NULL)
+ if(rm_assertion == NULL)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
@@ -121,7 +120,7 @@
axis2_bool_t is_sequence_str)
{
rm_assertion->is_sequence_str = is_sequence_str;
-
+
return AXIS2_SUCCESS;
}
@@ -139,9 +138,8 @@
const axutil_env_t * env,
axis2_bool_t is_sequence_transport_security)
{
- rm_assertion->is_sequence_transport_security =
- is_sequence_transport_security;
-
+ rm_assertion->is_sequence_transport_security = is_sequence_transport_security;
+
return AXIS2_SUCCESS;
}
@@ -160,11 +158,10 @@
axis2_bool_t is_exactly_once)
{
rm_assertion->is_exactly_once = is_exactly_once;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axis2_rm_assertion_get_is_atleast_once(
axis2_rm_assertion_t *rm_assertion,
@@ -180,7 +177,7 @@
axis2_bool_t is_atleast_once)
{
rm_assertion->is_atleast_once = is_atleast_once;
-
+
return AXIS2_SUCCESS;
}
@@ -199,7 +196,7 @@
axis2_bool_t is_atmost_once)
{
rm_assertion->is_atmost_once = is_atmost_once;
-
+
return AXIS2_SUCCESS;
}
@@ -218,7 +215,7 @@
axis2_bool_t is_inorder)
{
rm_assertion->is_inorder = is_inorder;
-
+
return AXIS2_SUCCESS;
}
@@ -237,7 +234,7 @@
axis2_char_t* inactivity_timeout)
{
rm_assertion->inactivity_timeout = inactivity_timeout;
-
+
return AXIS2_SUCCESS;
}
@@ -256,11 +253,10 @@
axis2_char_t* retrans_interval)
{
rm_assertion->retrans_interval = retrans_interval;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_ack_interval(
axis2_rm_assertion_t *rm_assertion,
@@ -276,11 +272,10 @@
axis2_char_t* ack_interval)
{
rm_assertion->ack_interval = ack_interval;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axis2_rm_assertion_get_is_exp_backoff(
axis2_rm_assertion_t *rm_assertion,
@@ -296,12 +291,10 @@
axis2_bool_t is_exp_backoff)
{
rm_assertion->is_exp_backoff = is_exp_backoff;
-
+
return AXIS2_SUCCESS;
}
-
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_storage_mgr(
axis2_rm_assertion_t *rm_assertion,
@@ -317,12 +310,10 @@
axis2_char_t* storage_mgr)
{
rm_assertion->storage_mgr = storage_mgr;
-
+
return AXIS2_SUCCESS;
}
-
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_message_types_to_drop(
axis2_rm_assertion_t *rm_assertion,
@@ -338,11 +329,10 @@
axis2_char_t* message_types_to_drop)
{
rm_assertion->message_types_to_drop = message_types_to_drop;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_max_retrans_count(
axis2_rm_assertion_t *rm_assertion,
@@ -358,11 +348,10 @@
axis2_char_t* max_retrans_count)
{
rm_assertion->max_retrans_count = max_retrans_count;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_sender_sleep_time(
axis2_rm_assertion_t *rm_assertion,
@@ -378,11 +367,10 @@
axis2_char_t* sender_sleep_time)
{
rm_assertion->sender_sleep_time = sender_sleep_time;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_invoker_sleep_time(
axis2_rm_assertion_t *rm_assertion,
@@ -398,12 +386,10 @@
axis2_char_t* invoker_sleep_time)
{
rm_assertion->invoker_sleep_time = invoker_sleep_time;
-
+
return AXIS2_SUCCESS;
}
-
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_polling_wait_time(
axis2_rm_assertion_t *rm_assertion,
@@ -419,7 +405,7 @@
axis2_char_t* polling_wait_time)
{
rm_assertion->polling_wait_time = polling_wait_time;
-
+
return AXIS2_SUCCESS;
}
@@ -438,11 +424,10 @@
axis2_char_t* terminate_delay)
{
rm_assertion->terminate_delay = terminate_delay;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_rm_assertion_get_sandesha2_db(
axis2_rm_assertion_t *rm_assertion,
@@ -458,11 +443,10 @@
axis2_char_t* sandesha2_db)
{
rm_assertion->sandesha2_db = sandesha2_db;
-
+
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_rm_assertion_t* AXIS2_CALL
axis2_rm_assertion_get_from_policy(
const axutil_env_t *env,
@@ -480,30 +464,27 @@
alternatives = neethi_policy_get_alternatives(policy, env);
- component =
- (neethi_operator_t *) axutil_array_list_get(alternatives, env, 0);
- all = (neethi_all_t *) neethi_operator_get_value(component, env);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component, env);
arraylist = neethi_all_get_policy_components(all, env);
- for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+ for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
- i);
- assertion =
- (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if (value)
+ if(value)
{
- if (type == ASSERTION_TYPE_RM_ASSERTION)
+ if(type == ASSERTION_TYPE_RM_ASSERTION)
{
return (axis2_rm_assertion_t *)value;
}
}
}
-
+
return NULL;
}
Modified: webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/rmpolicy/rm_assertion_builder.c Tue Aug 18 10:45:16 2009
@@ -19,8 +19,6 @@
/*private functions*/
-
-
static axis2_status_t AXIS2_CALL
axis2_rm_assertion_builder_process_sandesha2_assertions(
const axutil_env_t *env,
@@ -49,13 +47,10 @@
axiom_node_t *da_node,
axiom_element_t *da_element);
-
-
/* This functions retrives a rm_assertion axiom_node
* which may be 1.0 or 1.1 and return a rm_assertion
* struct */
-
AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
axis2_rm_assertion_builder_build(
const axutil_env_t *env,
@@ -72,21 +67,19 @@
node_qname = axiom_element_get_qname(rm_assertion_ele, env, rm_assertion_node);
if(!node_qname)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Cannot get qname from element");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] Cannot get qname from element");
return NULL;
}
ns = axutil_qname_get_uri(node_qname, env);
if(!ns)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Cannot get namespace from element.");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] Cannot get namespace from element.");
return NULL;
}
rm_assertion = axis2_rm_assertion_create(env);
- if (!rm_assertion)
+ if(!rm_assertion)
{
return NULL;
}
@@ -98,16 +91,16 @@
if(!axutil_strcmp(ns, AXIS2_RM_POLICY_10_NS))
{
- status = axis2_rm_assertion_builder_populate_for_10(env, rm_assertion,
- rm_assertion_node, rm_assertion_ele);
+ status = axis2_rm_assertion_builder_populate_for_10(env, rm_assertion, rm_assertion_node,
+ rm_assertion_ele);
axiom_children_iterator_reset(children_iter, env);
}
else if(!axutil_strcmp(ns, AXIS2_RM_POLICY_11_NS))
{
- status = axis2_rm_assertion_builder_populate_for_11(env, rm_assertion,
- rm_assertion_node, rm_assertion_ele);
+ status = axis2_rm_assertion_builder_populate_for_11(env, rm_assertion, rm_assertion_node,
+ rm_assertion_ele);
}
if(status == AXIS2_FAILURE)
@@ -118,9 +111,9 @@
}
/*children_iter = axiom_element_get_children(rm_assertion_ele, env, rm_assertion_node);*/
- if (children_iter)
+ if(children_iter)
{
- while (axiom_children_iterator_has_next(children_iter, env))
+ while(axiom_children_iterator_has_next(children_iter, env))
{
axiom_node_t *node = NULL;
axiom_element_t *ele = NULL;
@@ -128,13 +121,11 @@
axutil_qname_t *node_qname = NULL;
node = axiom_children_iterator_next(children_iter, env);
- if (node)
+ if(node)
{
- if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
{
- ele =
- (axiom_element_t *) axiom_node_get_data_element(node,
- env);
+ ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
node_qname = axiom_element_get_qname(ele, env, node);
if(!node_qname)
{
@@ -151,8 +142,8 @@
}
if(!axutil_strcmp(ns, AXIS2_SANDESHA2_NS))
{
- status = axis2_rm_assertion_builder_process_sandesha2_assertions(
- env, rm_assertion, node, ele);
+ status = axis2_rm_assertion_builder_process_sandesha2_assertions(env,
+ rm_assertion, node, ele);
if(status == AXIS2_FAILURE)
{
axis2_rm_assertion_free(rm_assertion, env);
@@ -164,10 +155,8 @@
}
}
}
- assertion =
- neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)axis2_rm_assertion_free,
- rm_assertion,
- ASSERTION_TYPE_RM_ASSERTION);
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)axis2_rm_assertion_free, rm_assertion, ASSERTION_TYPE_RM_ASSERTION);
return assertion;
}
@@ -184,25 +173,21 @@
/* In rm 1.0 it is just child elements which inside
* rm_assertion contains all the properties. */
-
- children_iter = axiom_element_get_children(rm_assertion_element,
- env, rm_assertion_node);
- if (children_iter)
+ children_iter = axiom_element_get_children(rm_assertion_element, env, rm_assertion_node);
+ if(children_iter)
{
- while (axiom_children_iterator_has_next(children_iter, env))
+ while(axiom_children_iterator_has_next(children_iter, env))
{
axiom_node_t *node = NULL;
axiom_element_t *ele = NULL;
axis2_char_t *local_name = NULL;
node = axiom_children_iterator_next(children_iter, env);
- if (node)
+ if(node)
{
- if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
{
- ele =
- (axiom_element_t *) axiom_node_get_data_element(node,
- env);
- if (ele)
+ ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
+ if(ele)
{
axutil_qname_t *node_qname = NULL;
axis2_char_t *ns = NULL;
@@ -221,36 +206,38 @@
"[neethi] Cannot get namespace from element.");
return AXIS2_FAILURE;
}
-
+
if(axutil_strcmp(ns, AXIS2_RM_POLICY_10_NS))
{
continue;
}
local_name = axiom_element_get_localname(ele, env);
- if (local_name)
+ if(local_name)
{
if(!axutil_strcmp(local_name, AXIS2_RM_INACTIVITY_TIMEOUT))
{
- axis2_char_t *inactivity_timeout = NULL;
- axutil_qname_t *qname =NULL;
+ axis2_char_t *inactivity_timeout = NULL;
+ axutil_qname_t *qname = NULL;
- qname = axutil_qname_create(env, "Milliseconds", NULL, NULL);
+ qname = axutil_qname_create(env, "Milliseconds", NULL, NULL);
- inactivity_timeout = axiom_element_get_attribute_value(ele, env, qname);
+ inactivity_timeout = axiom_element_get_attribute_value(ele, env,
+ qname);
if(qname)
{
axutil_qname_free(qname, env);
qname = NULL;
}
- status = axis2_rm_assertion_set_inactivity_timeout(
- rm_assertion, env, inactivity_timeout);
+ status = axis2_rm_assertion_set_inactivity_timeout(rm_assertion,
+ env, inactivity_timeout);
}
- else if(!axutil_strcmp(local_name, AXIS2_RM_BASE_RETRANSMISSION_INTERVAL))
+ else if(!axutil_strcmp(local_name,
+ AXIS2_RM_BASE_RETRANSMISSION_INTERVAL))
{
axis2_char_t *rti = NULL;
- axutil_qname_t *qname =NULL;
+ axutil_qname_t *qname = NULL;
qname = axutil_qname_create(env, "Milliseconds", NULL, NULL);
rti = axiom_element_get_attribute_value(ele, env, qname);
@@ -259,17 +246,18 @@
axutil_qname_free(qname, env);
qname = NULL;
}
- status = axis2_rm_assertion_set_retrans_interval(
- rm_assertion, env, rti);
+ status = axis2_rm_assertion_set_retrans_interval(rm_assertion, env,
+ rti);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_EXPONENTIAL_BACK_OFF))
{
- status = axis2_rm_assertion_set_is_exp_backoff(rm_assertion, env, AXIS2_TRUE);
+ status = axis2_rm_assertion_set_is_exp_backoff(rm_assertion, env,
+ AXIS2_TRUE);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_ACKNOWLEDGEMENT_INTERVAL))
{
axis2_char_t *ack_interval = NULL;
- axutil_qname_t *qname =NULL;
+ axutil_qname_t *qname = NULL;
qname = axutil_qname_create(env, "Milliseconds", NULL, NULL);
@@ -279,8 +267,8 @@
axutil_qname_free(qname, env);
qname = NULL;
}
- status = axis2_rm_assertion_set_ack_interval(
- rm_assertion, env, ack_interval);
+ status = axis2_rm_assertion_set_ack_interval(rm_assertion, env,
+ ack_interval);
}
else
{
@@ -302,7 +290,6 @@
* for policy element. Becasue then the processing become
* complex.So we just parse the axiom model */
-
static axis2_status_t AXIS2_CALL
axis2_rm_assertion_builder_populate_for_11(
const axutil_env_t *env,
@@ -315,32 +302,27 @@
axiom_node_t *child_node = NULL;
axiom_element_t *child_element = NULL;
-
child_node = axiom_node_get_first_element(rm_assertion_node, env);
- if (child_node)
+ if(child_node)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
- children_iter = axiom_element_get_children(child_element,
- env, child_node);
- if (children_iter)
+ children_iter = axiom_element_get_children(child_element, env, child_node);
+ if(children_iter)
{
- while (axiom_children_iterator_has_next(children_iter, env))
+ while(axiom_children_iterator_has_next(children_iter, env))
{
axiom_node_t *node = NULL;
axiom_element_t *ele = NULL;
axis2_char_t *local_name = NULL;
node = axiom_children_iterator_next(children_iter, env);
- if (node)
+ if(node)
{
- if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
{
- ele =
- (axiom_element_t *) axiom_node_get_data_element(node,
- env);
- if (ele)
+ ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
+ if(ele)
{
axutil_qname_t *node_qname = NULL;
axis2_char_t *ns = NULL;
@@ -348,7 +330,7 @@
if(!node)
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Cannot get qname from element");
+ "[neethi] Cannot get qname from element");
return AXIS2_FAILURE;
}
@@ -365,25 +347,30 @@
continue;
}
local_name = axiom_element_get_localname(ele, env);
- if (local_name)
+ if(local_name)
{
- if(!axutil_strcmp(local_name, AXIS2_RM_SEQUENCE_STR))
+ if(!axutil_strcmp(local_name, AXIS2_RM_SEQUENCE_STR))
{
- status = axis2_rm_assertion_set_is_sequence_str(rm_assertion, env, AXIS2_TRUE);
- }
- else if(!axutil_strcmp(local_name, AXIS2_RM_SEQUENCE_TRANSPORT_SECURITY))
+ status = axis2_rm_assertion_set_is_sequence_str(
+ rm_assertion, env, AXIS2_TRUE);
+ }
+ else if(!axutil_strcmp(local_name,
+ AXIS2_RM_SEQUENCE_TRANSPORT_SECURITY))
{
- status = axis2_rm_assertion_set_is_sequence_transport_security(rm_assertion, env, AXIS2_TRUE);
+ status
+ = axis2_rm_assertion_set_is_sequence_transport_security(
+ rm_assertion, env, AXIS2_TRUE);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_DELIVERY_ASSURANCE))
{
- status = axis2_rm_assertion_builder_process_delivery_assuarance(
- env, rm_assertion, node, ele);
+ status
+ = axis2_rm_assertion_builder_process_delivery_assuarance(
+ env, rm_assertion, node, ele);
}
else
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Unknown Assertion %s ", local_name);
+ "[neethi] Unknown Assertion %s ", local_name);
return AXIS2_FAILURE;
}
}
@@ -392,13 +379,12 @@
}
}
}
- }
- }
+ }
+ }
return status;
}
-
static axis2_status_t AXIS2_CALL
axis2_rm_assertion_builder_process_delivery_assuarance(
const axutil_env_t *env,
@@ -412,49 +398,50 @@
axiom_element_t *child_element = NULL;
child_node = axiom_node_get_first_element(da_node, env);
- if (child_node)
+ if(child_node)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
- children_iter = axiom_element_get_children(child_element,
- env, child_node);
- if (children_iter)
+ children_iter = axiom_element_get_children(child_element, env, child_node);
+ if(children_iter)
{
- while (axiom_children_iterator_has_next(children_iter, env))
+ while(axiom_children_iterator_has_next(children_iter, env))
{
axiom_node_t *node = NULL;
axiom_element_t *ele = NULL;
axis2_char_t *local_name = NULL;
node = axiom_children_iterator_next(children_iter, env);
- if (node)
+ if(node)
{
- if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
{
- ele =
- (axiom_element_t *) axiom_node_get_data_element(node,
- env);
- if (ele)
+ ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
+ if(ele)
{
local_name = axiom_element_get_localname(ele, env);
- if (local_name)
+ if(local_name)
{
- if(!axutil_strcmp(local_name, AXIS2_RM_EXACTLY_ONCE))
+ if(!axutil_strcmp(local_name, AXIS2_RM_EXACTLY_ONCE))
{
- status = axis2_rm_assertion_set_is_exactly_once(rm_assertion, env, AXIS2_TRUE);
- }
+ status = axis2_rm_assertion_set_is_exactly_once(
+ rm_assertion, env, AXIS2_TRUE);
+ }
else if(!axutil_strcmp(local_name, AXIS2_RM_AT_LEAST_ONCE))
{
- status = axis2_rm_assertion_set_is_atleast_once(rm_assertion, env, AXIS2_TRUE);
+ status = axis2_rm_assertion_set_is_atleast_once(
+ rm_assertion, env, AXIS2_TRUE);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_AT_MOST_ONCE))
{
- status = axis2_rm_assertion_set_is_atmost_once(rm_assertion, env, AXIS2_TRUE);
- }
+ status = axis2_rm_assertion_set_is_atmost_once(
+ rm_assertion, env, AXIS2_TRUE);
+ }
else if(!axutil_strcmp(local_name, AXIS2_RM_IN_ORDER))
{
- status = axis2_rm_assertion_set_is_inorder(rm_assertion, env, AXIS2_TRUE); }
+ status = axis2_rm_assertion_set_is_inorder(rm_assertion,
+ env, AXIS2_TRUE);
+ }
else
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
@@ -467,13 +454,11 @@
}
}
}
- }
- }
+ }
+ }
return status;
}
-
-
static axis2_status_t AXIS2_CALL
axis2_rm_assertion_builder_process_sandesha2_assertions(
const axutil_env_t *env,
@@ -484,10 +469,10 @@
axis2_status_t status = AXIS2_FAILURE;
axis2_char_t *local_name = NULL;
- if (element)
+ if(element)
{
local_name = axiom_element_get_localname(element, env);
- if (local_name)
+ if(local_name)
{
if(!axutil_strcmp(local_name, AXIS2_RM_BASE_RETRANSMISSION_INTERVAL))
{
@@ -499,7 +484,8 @@
{
axis2_char_t *inactivity_timeout = NULL;
inactivity_timeout = axiom_element_get_text(element, env, node);
- return axis2_rm_assertion_set_inactivity_timeout(rm_assertion, env, inactivity_timeout);
+ return axis2_rm_assertion_set_inactivity_timeout(rm_assertion, env,
+ inactivity_timeout);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_ACKNOWLEDGEMENT_INTERVAL))
{
@@ -523,7 +509,8 @@
{
axis2_char_t *message_types_to_drop = NULL;
message_types_to_drop = axiom_element_get_text(element, env, node);
- return axis2_rm_assertion_set_message_types_to_drop(rm_assertion, env, message_types_to_drop);
+ return axis2_rm_assertion_set_message_types_to_drop(rm_assertion, env,
+ message_types_to_drop);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_MAX_RETRANS_COUNT))
{
@@ -535,19 +522,22 @@
{
axis2_char_t *sender_sleep_time = NULL;
sender_sleep_time = axiom_element_get_text(element, env, node);
- return axis2_rm_assertion_set_sender_sleep_time(rm_assertion, env, sender_sleep_time);
+ return axis2_rm_assertion_set_sender_sleep_time(rm_assertion, env,
+ sender_sleep_time);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_INVOKER_SLEEP_TIME))
{
axis2_char_t *invoker_sleep_time = NULL;
invoker_sleep_time = axiom_element_get_text(element, env, node);
- return axis2_rm_assertion_set_invoker_sleep_time(rm_assertion, env, invoker_sleep_time);
+ return axis2_rm_assertion_set_invoker_sleep_time(rm_assertion, env,
+ invoker_sleep_time);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_POLLING_WAIT_TIME))
{
axis2_char_t *polling_wait_time = NULL;
polling_wait_time = axiom_element_get_text(element, env, node);
- return axis2_rm_assertion_set_polling_wait_time(rm_assertion, env, polling_wait_time);
+ return axis2_rm_assertion_set_polling_wait_time(rm_assertion, env,
+ polling_wait_time);
}
else if(!axutil_strcmp(local_name, AXIS2_RM_TERMINATE_DELAY))
{
@@ -557,8 +547,8 @@
}
else
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Unknown Assertion %s ", local_name);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] Unknown Assertion %s ",
+ local_name);
return AXIS2_FAILURE;
}
}
@@ -566,4 +556,3 @@
return status;
}
-
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c Tue Aug 18 10:45:16 2009
@@ -38,10 +38,10 @@
child_node = axiom_node_get_first_element(node, env);
- if (child_node)
+ if(child_node)
{
algo_node = axiom_node_get_first_element(child_node, env);
- if (!algo_node)
+ if(!algo_node)
{
return NULL;
}
@@ -51,30 +51,27 @@
return NULL;
}
- if (axiom_node_get_node_type(algo_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(algo_node, env) == AXIOM_ELEMENT)
{
- algo_element =
- (axiom_element_t *) axiom_node_get_data_element(algo_node, env);
- if (algo_element)
+ algo_element = (axiom_element_t *)axiom_node_get_data_element(algo_node, env);
+ if(algo_element)
{
axis2_status_t status = AXIS2_FAILURE;
axis2_char_t *algosuite_string = NULL;
algosuite_string = axiom_element_get_localname(algo_element, env);
- if (!algosuite_string)
+ if(!algosuite_string)
{
return NULL;
}
- status = rp_algorithmsuite_set_algosuite(algorithmsuite, env,
- algosuite_string);
- if(AXIS2_FAILURE == status){
+ status = rp_algorithmsuite_set_algosuite(algorithmsuite, env, algosuite_string);
+ if(AXIS2_FAILURE == status)
+ {
return NULL;
}
- assertion =
- neethi_assertion_create_with_args(env,
- (AXIS2_FREE_VOID_ARG)rp_algorithmsuite_free,
- algorithmsuite,
- ASSERTION_TYPE_ALGORITHM_SUITE);
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)rp_algorithmsuite_free, algorithmsuite,
+ ASSERTION_TYPE_ALGORITHM_SUITE);
return assertion;
}
else
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c Tue Aug 18 10:45:16 2009
@@ -24,7 +24,8 @@
/*private functions*/
-axis2_status_t AXIS2_CALL asymmetric_binding_process_alternatives(
+axis2_status_t AXIS2_CALL
+asymmetric_binding_process_alternatives(
const axutil_env_t *env,
neethi_all_t *all,
rp_asymmetric_binding_t *asymmetric_binding);
@@ -50,40 +51,32 @@
asymmetric_binding = rp_asymmetric_binding_create(env);
child_node = axiom_node_get_first_element(node, env);
- if (!child_node)
+ if(!child_node)
{
return NULL;
}
- if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if (!policy)
+ if(!policy)
{
return NULL;
}
- normalized_policy =
- neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
- alternatives =
- neethi_policy_get_alternatives(normalized_policy, env);
+ normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ alternatives = neethi_policy_get_alternatives(normalized_policy, env);
neethi_policy_free(policy, env);
policy = NULL;
- component =
- (neethi_operator_t *) axutil_array_list_get(alternatives, env,
- 0);
- all = (neethi_all_t *) neethi_operator_get_value(component, env);
- asymmetric_binding_process_alternatives(env, all,
- asymmetric_binding);
-
- assertion =
- neethi_assertion_create_with_args(env,
- (AXIS2_FREE_VOID_ARG)rp_asymmetric_binding_free,
- asymmetric_binding,
- ASSERTION_TYPE_ASSYMMETRIC_BINDING);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component, env);
+ asymmetric_binding_process_alternatives(env, all, asymmetric_binding);
+
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)rp_asymmetric_binding_free, asymmetric_binding,
+ ASSERTION_TYPE_ASSYMMETRIC_BINDING);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
@@ -117,125 +110,112 @@
commons = rp_binding_commons_create(env);
as_commons = rp_symmetric_asymmetric_binding_commons_create(env);
- for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+ for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
- i);
- assertion =
- (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if (type == ASSERTION_TYPE_INITIATOR_TOKEN)
+ if(type == ASSERTION_TYPE_INITIATOR_TOKEN)
{
rp_property_t *initiator_token = NULL;
- initiator_token =
- (rp_property_t *) neethi_assertion_get_value(assertion, env);
- if (initiator_token)
+ initiator_token = (rp_property_t *)neethi_assertion_get_value(assertion, env);
+ if(initiator_token)
{
- rp_asymmetric_binding_set_initiator_token(asymmetric_binding,
- env, initiator_token);
+ rp_asymmetric_binding_set_initiator_token(asymmetric_binding, env, initiator_token);
}
else
return AXIS2_FAILURE;
}
- else if (type == ASSERTION_TYPE_RECIPIENT_TOKEN)
+ else if(type == ASSERTION_TYPE_RECIPIENT_TOKEN)
{
rp_property_t *recipient_token = NULL;
- recipient_token =
- (rp_property_t *) neethi_assertion_get_value(assertion, env);
- if (recipient_token)
+ recipient_token = (rp_property_t *)neethi_assertion_get_value(assertion, env);
+ if(recipient_token)
{
- rp_asymmetric_binding_set_recipient_token(asymmetric_binding,
- env, recipient_token);
+ rp_asymmetric_binding_set_recipient_token(asymmetric_binding, env, recipient_token);
}
else
return AXIS2_FAILURE;
}
- else if (type == ASSERTION_TYPE_ALGORITHM_SUITE)
+ else if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
{
rp_algorithmsuite_t *algorithmsuite = NULL;
- algorithmsuite =
- (rp_algorithmsuite_t *) neethi_assertion_get_value(assertion,
- env);
- if (algorithmsuite)
+ algorithmsuite = (rp_algorithmsuite_t *)neethi_assertion_get_value(assertion, env);
+ if(algorithmsuite)
{
- rp_binding_commons_set_algorithmsuite(commons, env,
- algorithmsuite);
+ rp_binding_commons_set_algorithmsuite(commons, env, algorithmsuite);
}
else
return AXIS2_FAILURE;
}
- else if (type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
+ else if(type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
{
rp_binding_commons_set_include_timestamp(commons, env, AXIS2_TRUE);
}
- else if (type == ASSERTION_TYPE_LAYOUT)
+ else if(type == ASSERTION_TYPE_LAYOUT)
{
rp_layout_t *layout = NULL;
- layout = (rp_layout_t *) neethi_assertion_get_value(assertion, env);
- if (layout)
+ layout = (rp_layout_t *)neethi_assertion_get_value(assertion, env);
+ if(layout)
{
rp_binding_commons_set_layout(commons, env, layout);
}
else
return AXIS2_FAILURE;
}
- else if (type == ASSERTION_TYPE_ENCRYPT_BEFORE_SIGNING)
+ else if(type == ASSERTION_TYPE_ENCRYPT_BEFORE_SIGNING)
{
- rp_symmetric_asymmetric_binding_commons_set_protection_order
- (as_commons, env, RP_ENCRYPT_BEFORE_SIGNING);
+ rp_symmetric_asymmetric_binding_commons_set_protection_order(as_commons, env,
+ RP_ENCRYPT_BEFORE_SIGNING);
}
- else if (type == ASSERTION_TYPE_SIGN_BEFORE_ENCRYPTING)
+ else if(type == ASSERTION_TYPE_SIGN_BEFORE_ENCRYPTING)
{
- rp_symmetric_asymmetric_binding_commons_set_protection_order
- (as_commons, env, RP_SIGN_BEFORE_ENCRYPTING);
+ rp_symmetric_asymmetric_binding_commons_set_protection_order(as_commons, env,
+ RP_SIGN_BEFORE_ENCRYPTING);
}
- else if (type == ASSERTION_TYPE_ENCRYPT_SIGNATURE)
+ else if(type == ASSERTION_TYPE_ENCRYPT_SIGNATURE)
{
- rp_symmetric_asymmetric_binding_commons_set_signature_protection
- (as_commons, env, AXIS2_TRUE);
+ rp_symmetric_asymmetric_binding_commons_set_signature_protection(as_commons, env,
+ AXIS2_TRUE);
}
- else if (type == ASSERTION_TYPE_PROTECT_TOKENS)
+ else if(type == ASSERTION_TYPE_PROTECT_TOKENS)
{
- rp_symmetric_asymmetric_binding_commons_set_token_protection
- (as_commons, env, AXIS2_TRUE);
+ rp_symmetric_asymmetric_binding_commons_set_token_protection(as_commons, env,
+ AXIS2_TRUE);
}
- else if (type == ASSERTION_TYPE_ONLY_SIGN_ENTIRE_HEADERS_AND_BODY)
+ else if(type == ASSERTION_TYPE_ONLY_SIGN_ENTIRE_HEADERS_AND_BODY)
{
- rp_symmetric_asymmetric_binding_commons_set_entire_headers_and_body_signatures
- (as_commons, env, AXIS2_TRUE);
+ rp_symmetric_asymmetric_binding_commons_set_entire_headers_and_body_signatures(
+ as_commons, env, AXIS2_TRUE);
}
- else if (type == ASSERTION_TYPE_SUPPORTING_TOKENS)
+ else if(type == ASSERTION_TYPE_SUPPORTING_TOKENS)
{
rp_supporting_tokens_t *supporting_tokens = NULL;
- supporting_tokens =
- (rp_supporting_tokens_t *) neethi_assertion_get_value(assertion,
- env);
- if (supporting_tokens)
+ supporting_tokens
+ = (rp_supporting_tokens_t *)neethi_assertion_get_value(assertion, env);
+ if(supporting_tokens)
{
rp_property_type_t type;
type = rp_supporting_tokens_get_type(supporting_tokens, env);
- if (type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
+ if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
{
- rp_binding_commons_set_signed_supporting_tokens(commons,
- env,
- supporting_tokens);
+ rp_binding_commons_set_signed_supporting_tokens(commons, env, supporting_tokens);
}
- else if (type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
+ else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
{
- rp_binding_commons_set_signed_endorsing_supporting_tokens
- (commons, env, supporting_tokens);
+ rp_binding_commons_set_signed_endorsing_supporting_tokens(commons, env,
+ supporting_tokens);
}
- else if (type == RP_PROPERTY_SUPPORTING_SUPPORTING_TOKEN)
+ else if(type == RP_PROPERTY_SUPPORTING_SUPPORTING_TOKEN)
{
- rp_binding_commons_set_supporting_tokens
- (commons, env, supporting_tokens);
+ rp_binding_commons_set_supporting_tokens(commons, env, supporting_tokens);
}
- else if (type == RP_PROPERTY_ENDORSING_SUPPORTING_TOKEN)
+ else if(type == RP_PROPERTY_ENDORSING_SUPPORTING_TOKEN)
{
- rp_binding_commons_set_endorsing_supporting_tokens
- (commons, env, supporting_tokens);
+ rp_binding_commons_set_endorsing_supporting_tokens(commons, env,
+ supporting_tokens);
}
else
return AXIS2_FAILURE;
@@ -246,10 +226,9 @@
else
return AXIS2_FAILURE;
}
- rp_symmetric_asymmetric_binding_commons_set_binding_commons(as_commons, env,
- commons);
- rp_asymmetric_binding_set_symmetric_asymmetric_binding_commons
- (asymmetric_binding, env, as_commons);
+ rp_symmetric_asymmetric_binding_commons_set_binding_commons(as_commons, env, commons);
+ rp_asymmetric_binding_set_symmetric_asymmetric_binding_commons(asymmetric_binding, env,
+ as_commons);
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/bootstrap_policy_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/bootstrap_policy_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/bootstrap_policy_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/bootstrap_policy_builder.c Tue Aug 18 10:45:16 2009
@@ -34,26 +34,23 @@
neethi_assertion_t *assertion = NULL;
child_node = axiom_node_get_first_element(node, env);
- if (!child_node)
+ if(!child_node)
{
return NULL;
}
- if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if (!policy)
+ if(!policy)
{
return NULL;
}
- assertion = neethi_assertion_create_with_args(env,
- NULL, /*this policy should not be deleted*/
- policy,
- ASSERTION_TYPE_BOOTSTRAP_POLICY);
+ assertion = neethi_assertion_create_with_args(env, NULL, /*this policy should not be deleted*/
+ policy, ASSERTION_TYPE_BOOTSTRAP_POLICY);
return assertion;
}
else
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c Tue Aug 18 10:45:16 2009
@@ -25,7 +25,8 @@
/*private functions*/
-axis2_status_t AXIS2_CALL encryption_token_process_alternatives(
+axis2_status_t AXIS2_CALL
+encryption_token_process_alternatives(
const axutil_env_t *env,
neethi_all_t *all,
rp_property_t *encryption_token);
@@ -51,39 +52,32 @@
encryption_token = rp_property_create(env);
child_node = axiom_node_get_first_element(node, env);
- if (!child_node)
+ if(!child_node)
{
return NULL;
}
- if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if (!policy)
+ if(!policy)
{
return NULL;
}
- normalized_policy =
- neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
neethi_policy_free(policy, env);
policy = NULL;
- alternatives =
- neethi_policy_get_alternatives(normalized_policy, env);
- component =
- (neethi_operator_t *) axutil_array_list_get(alternatives, env,
- 0);
- all = (neethi_all_t *) neethi_operator_get_value(component, env);
+ alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component, env);
encryption_token_process_alternatives(env, all, encryption_token);
- assertion =
- neethi_assertion_create_with_args(env,
- (AXIS2_FREE_VOID_ARG)rp_property_free,
- encryption_token,
- ASSERTION_TYPE_ENCRYPTION_TOKEN);
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)rp_property_free, encryption_token,
+ ASSERTION_TYPE_ENCRYPTION_TOKEN);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
@@ -114,27 +108,22 @@
arraylist = neethi_all_get_policy_components(all, env);
- for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+ for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
- i);
- assertion =
- (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if (value)
+ if(value)
{
- if (type == ASSERTION_TYPE_X509_TOKEN)
+ if(type == ASSERTION_TYPE_X509_TOKEN)
{
rp_x509_token_t *x509_token = NULL;
- x509_token =
- (rp_x509_token_t *) neethi_assertion_get_value(assertion,
- env);
- if (x509_token)
+ x509_token = (rp_x509_token_t *)neethi_assertion_get_value(assertion, env);
+ if(x509_token)
{
- rp_property_set_value(encryption_token, env, x509_token,
- RP_PROPERTY_X509_TOKEN);
+ rp_property_set_value(encryption_token, env, x509_token, RP_PROPERTY_X509_TOKEN);
}
else
return AXIS2_FAILURE;
@@ -145,7 +134,8 @@
issued_token = (rp_issued_token_t *)neethi_assertion_get_value(assertion, env);
if(issued_token)
{
- rp_property_set_value(encryption_token, env, issued_token, RP_PROPERTY_ISSUED_TOKEN);
+ rp_property_set_value(encryption_token, env, issued_token,
+ RP_PROPERTY_ISSUED_TOKEN);
}
else
return AXIS2_FAILURE;
@@ -161,15 +151,16 @@
else
return AXIS2_FAILURE;
}
- else if (type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
+ else if(type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
{
rp_security_context_token_t *security_context_token = NULL;
- security_context_token =
- (rp_security_context_token_t *) neethi_assertion_get_value(assertion, env);
+ security_context_token = (rp_security_context_token_t *)neethi_assertion_get_value(
+ assertion, env);
- if (security_context_token)
+ if(security_context_token)
{
- rp_property_set_value(encryption_token, env, security_context_token, RP_PROPERTY_SECURITY_CONTEXT_TOKEN);
+ rp_property_set_value(encryption_token, env, security_context_token,
+ RP_PROPERTY_SECURITY_CONTEXT_TOKEN);
}
else
return AXIS2_FAILURE;
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c Tue Aug 18 10:45:16 2009
@@ -34,29 +34,23 @@
https_token = rp_https_token_create(env);
- value =
- axiom_element_get_attribute_value_by_name(element, env,
- RP_REQUIRE_CLIENT_CERTIFICATE);
+ value = axiom_element_get_attribute_value_by_name(element, env, RP_REQUIRE_CLIENT_CERTIFICATE);
- if (value)
+ if(value)
{
- if (axutil_strcmp(value, "true") == 0)
+ if(axutil_strcmp(value, "true") == 0)
{
- rp_https_token_set_require_client_certificate(https_token, env,
- AXIS2_TRUE);
+ rp_https_token_set_require_client_certificate(https_token, env, AXIS2_TRUE);
}
- else if (axutil_strcmp(value, "false") == 0)
+ else if(axutil_strcmp(value, "false") == 0)
{
- rp_https_token_set_require_client_certificate(https_token, env,
- AXIS2_FALSE);
+ rp_https_token_set_require_client_certificate(https_token, env, AXIS2_FALSE);
}
else
return NULL;
}
- assertion =
- neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_https_token_free,
- https_token,
- ASSERTION_TYPE_HTTPS_TOKEN);
+ assertion = neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_https_token_free,
+ https_token, ASSERTION_TYPE_HTTPS_TOKEN);
return assertion;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c Tue Aug 18 10:45:16 2009
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +25,8 @@
/*private functions*/
-axis2_status_t AXIS2_CALL initiator_token_process_alternatives(
+axis2_status_t AXIS2_CALL
+initiator_token_process_alternatives(
const axutil_env_t * env,
neethi_all_t * all,
rp_property_t * initiator_token);
@@ -52,39 +52,32 @@
initiator_token = rp_property_create(env);
child_node = axiom_node_get_first_element(node, env);
- if (!child_node)
+ if(!child_node)
{
return NULL;
}
- if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if (!policy)
+ if(!policy)
{
return NULL;
}
- normalized_policy =
- neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
neethi_policy_free(policy, env);
policy = NULL;
- alternatives =
- neethi_policy_get_alternatives(normalized_policy, env);
- component =
- (neethi_operator_t *) axutil_array_list_get(alternatives, env,
- 0);
- all = (neethi_all_t *) neethi_operator_get_value(component, env);
+ alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component, env);
initiator_token_process_alternatives(env, all, initiator_token);
- assertion =
- neethi_assertion_create_with_args(env,
- (AXIS2_FREE_VOID_ARG)rp_property_free,
- initiator_token,
- ASSERTION_TYPE_INITIATOR_TOKEN);
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)rp_property_free, initiator_token,
+ ASSERTION_TYPE_INITIATOR_TOKEN);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
@@ -115,27 +108,22 @@
arraylist = neethi_all_get_policy_components(all, env);
- for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+ for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
- i);
- assertion =
- (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if (value)
+ if(value)
{
- if (type == ASSERTION_TYPE_X509_TOKEN)
+ if(type == ASSERTION_TYPE_X509_TOKEN)
{
rp_x509_token_t *x509_token = NULL;
- x509_token =
- (rp_x509_token_t *) neethi_assertion_get_value(assertion,
- env);
- if (x509_token)
+ x509_token = (rp_x509_token_t *)neethi_assertion_get_value(assertion, env);
+ if(x509_token)
{
- rp_property_set_value(initiator_token, env, x509_token,
- RP_PROPERTY_X509_TOKEN);
+ rp_property_set_value(initiator_token, env, x509_token, RP_PROPERTY_X509_TOKEN);
}
else
return AXIS2_FAILURE;
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c Tue Aug 18 10:45:16 2009
@@ -18,33 +18,34 @@
#include <rp_issued_token_builder.h>
AXIS2_EXTERN neethi_assertion_t * AXIS2_CALL
-rp_issued_token_builder_build(const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
+rp_issued_token_builder_build(
+ const axutil_env_t *env,
+ axiom_node_t *node,
+ axiom_element_t *element)
{
- rp_issued_token_t *issued_token= NULL;
- neethi_policy_t *policy= NULL;
- neethi_policy_t *normalized_policy= NULL;
- neethi_all_t *all= NULL;
- axutil_array_list_t *alternatives= NULL;
- neethi_operator_t *component= NULL;
- axis2_char_t *inclusion_value= NULL;
- axutil_qname_t *qname= NULL;
- axiom_node_t *issuer_node= NULL;
- axiom_element_t *issuer_ele= NULL;
- axiom_element_t *issuer_first_child_ele= NULL;
- axiom_node_t *issuer_first_child_node= NULL;
- axiom_node_t *req_sec_tok_template_node= NULL;
- axiom_element_t *req_sec_tok_template_ele= NULL;
- axiom_node_t *policy_node= NULL;
- axiom_element_t *policy_ele= NULL;
- neethi_assertion_t *assertion= NULL;
-
- issued_token = rp_issued_token_create(env);
- qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_11, RP_SP_PREFIX);
- inclusion_value = axiom_element_get_attribute_value(element, env, qname);
- axutil_qname_free(qname, env);
- qname = NULL;
+ rp_issued_token_t *issued_token = NULL;
+ neethi_policy_t *policy = NULL;
+ neethi_policy_t *normalized_policy = NULL;
+ neethi_all_t *all = NULL;
+ axutil_array_list_t *alternatives = NULL;
+ neethi_operator_t *component = NULL;
+ axis2_char_t *inclusion_value = NULL;
+ axutil_qname_t *qname = NULL;
+ axiom_node_t *issuer_node = NULL;
+ axiom_element_t *issuer_ele = NULL;
+ axiom_element_t *issuer_first_child_ele = NULL;
+ axiom_node_t *issuer_first_child_node = NULL;
+ axiom_node_t *req_sec_tok_template_node = NULL;
+ axiom_element_t *req_sec_tok_template_ele = NULL;
+ axiom_node_t *policy_node = NULL;
+ axiom_element_t *policy_ele = NULL;
+ neethi_assertion_t *assertion = NULL;
+
+ issued_token = rp_issued_token_create(env);
+ qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_11, RP_SP_PREFIX);
+ inclusion_value = axiom_element_get_attribute_value(element, env, qname);
+ axutil_qname_free(qname, env);
+ qname = NULL;
if(!inclusion_value)
{
@@ -55,120 +56,109 @@
qname = NULL;
}
- if (inclusion_value)
- {
- rp_issued_token_set_inclusion(issued_token, env, inclusion_value);
- }
-
- qname = axutil_qname_create(env, RP_ISSUER, RP_SP_NS_11, RP_SP_PREFIX);
- issuer_ele = axiom_element_get_first_child_with_qname(element, env, qname,
- node, &issuer_node);
- if (issuer_ele)
- {
- issuer_first_child_ele = axiom_element_get_first_element(issuer_ele,
- env, issuer_node, &issuer_first_child_node);
- if (issuer_first_child_ele)
- {
- rp_issued_token_set_issuer_epr(issued_token, env,
- issuer_first_child_node);
- }
- }
- axutil_qname_free(qname, env);
- qname = NULL;
-
- qname = axutil_qname_create(env, RP_REQUEST_SEC_TOKEN_TEMPLATE, RP_SP_NS_11,
- RP_SP_PREFIX);
- req_sec_tok_template_ele = axiom_element_get_first_child_with_qname(
- element, env, qname, node, &req_sec_tok_template_node);
- if (req_sec_tok_template_ele)
- {
- rp_issued_token_set_requested_sec_token_template(issued_token, env,
- req_sec_tok_template_node);
- }
- else
- {
- return NULL;
- }
-
- axutil_qname_free(qname, env);
- qname = NULL;
-
- qname = axutil_qname_create(env, RP_POLICY, RP_POLICY_NS, RP_POLICY_PREFIX);
- policy_ele = axiom_element_get_first_child_with_qname(element, env, qname,
- node, &policy_node);
- if (policy_ele)
- {
- policy = neethi_engine_get_policy(env, policy_node, policy_ele);
- if (!policy)
- {
- return NULL;
- }
- normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE,
- policy);
- neethi_policy_free(policy, env);
- policy = NULL;
- alternatives = neethi_policy_get_alternatives(normalized_policy, env);
- component = (neethi_operator_t *) axutil_array_list_get(alternatives,
- env, 0);
- all = (neethi_all_t *) neethi_operator_get_value(component, env);
- if(AXIS2_FAILURE == rp_issued_token_builder_process_alternatives(env, all, issued_token))
- return NULL;
- assertion = neethi_assertion_create_with_args(env,
- (AXIS2_FREE_VOID_ARG)rp_issued_token_free, issued_token,
- ASSERTION_TYPE_ISSUED_TOKEN);
-
- neethi_policy_free(normalized_policy, env);
- normalized_policy = NULL;
-
- return assertion;
- }
-
- assertion = neethi_assertion_create(env);
- neethi_assertion_set_value(
- assertion,
- env,
- issued_token,
- ASSERTION_TYPE_ISSUED_TOKEN);
+ if(inclusion_value)
+ {
+ rp_issued_token_set_inclusion(issued_token, env, inclusion_value);
+ }
+
+ qname = axutil_qname_create(env, RP_ISSUER, RP_SP_NS_11, RP_SP_PREFIX);
+ issuer_ele = axiom_element_get_first_child_with_qname(element, env, qname, node, &issuer_node);
+ if(issuer_ele)
+ {
+ issuer_first_child_ele = axiom_element_get_first_element(issuer_ele, env, issuer_node,
+ &issuer_first_child_node);
+ if(issuer_first_child_ele)
+ {
+ rp_issued_token_set_issuer_epr(issued_token, env, issuer_first_child_node);
+ }
+ }
+ axutil_qname_free(qname, env);
+ qname = NULL;
+
+ qname = axutil_qname_create(env, RP_REQUEST_SEC_TOKEN_TEMPLATE, RP_SP_NS_11, RP_SP_PREFIX);
+ req_sec_tok_template_ele = axiom_element_get_first_child_with_qname(element, env, qname, node,
+ &req_sec_tok_template_node);
+ if(req_sec_tok_template_ele)
+ {
+ rp_issued_token_set_requested_sec_token_template(issued_token, env,
+ req_sec_tok_template_node);
+ }
+ else
+ {
+ return NULL;
+ }
+
+ axutil_qname_free(qname, env);
+ qname = NULL;
+ qname = axutil_qname_create(env, RP_POLICY, RP_POLICY_NS, RP_POLICY_PREFIX);
+ policy_ele = axiom_element_get_first_child_with_qname(element, env, qname, node, &policy_node);
+ if(policy_ele)
+ {
+ policy = neethi_engine_get_policy(env, policy_node, policy_ele);
+ if(!policy)
+ {
+ return NULL;
+ }
+ normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ neethi_policy_free(policy, env);
+ policy = NULL;
+ alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component, env);
+ if(AXIS2_FAILURE == rp_issued_token_builder_process_alternatives(env, all, issued_token))
+ return NULL;
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)rp_issued_token_free, issued_token, ASSERTION_TYPE_ISSUED_TOKEN);
+
+ neethi_policy_free(normalized_policy, env);
+ normalized_policy = NULL;
+
+ return assertion;
+ }
+
+ assertion = neethi_assertion_create(env);
+ neethi_assertion_set_value(assertion, env, issued_token, ASSERTION_TYPE_ISSUED_TOKEN);
- return assertion;
+ return assertion;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL rp_issued_token_builder_process_alternatives(
- const axutil_env_t *env, neethi_all_t *all,
- rp_issued_token_t *issued_token) {
- neethi_operator_t *operator= NULL;
- axutil_array_list_t *arraylist= NULL;
- neethi_assertion_t *assertion= NULL;
- neethi_assertion_type_t type;
-
- int i = 0;
-
- arraylist = neethi_all_get_policy_components(all, env);
-
- for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
- {
- operator
- =(neethi_operator_t *) axutil_array_list_get(arraylist, env, i);
- assertion = (neethi_assertion_t *) neethi_operator_get_value(operator,
- env);
- type = neethi_assertion_get_type(assertion, env);
-
- if (type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10)
- {
- rp_issued_token_set_derivedkeys(issued_token, env, AXIS2_TRUE);
- }
- else if (type == ASSERTION_TYPE_REQUIRE_EXTERNAL_REFERENCE)
- {
- rp_issued_token_set_require_exernal_reference(issued_token, env, AXIS2_TRUE);
- }
- else if (type == ASSERTION_TYPE_REQUIRE_INTERNAL_REFERENCE)
- {
- rp_issued_token_set_require_internal_reference(issued_token, env, AXIS2_TRUE);
- }
- else
- return AXIS2_FAILURE;
- }
- return AXIS2_SUCCESS;
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_builder_process_alternatives(
+ const axutil_env_t *env,
+ neethi_all_t *all,
+ rp_issued_token_t *issued_token)
+{
+ neethi_operator_t *operator = NULL;
+ axutil_array_list_t *arraylist = NULL;
+ neethi_assertion_t *assertion = NULL;
+ neethi_assertion_type_t type;
+
+ int i = 0;
+
+ arraylist = neethi_all_get_policy_components(all, env);
+
+ for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
+ {
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+ type = neethi_assertion_get_type(assertion, env);
+
+ if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10)
+ {
+ rp_issued_token_set_derivedkeys(issued_token, env, AXIS2_TRUE);
+ }
+ else if(type == ASSERTION_TYPE_REQUIRE_EXTERNAL_REFERENCE)
+ {
+ rp_issued_token_set_require_exernal_reference(issued_token, env, AXIS2_TRUE);
+ }
+ else if(type == ASSERTION_TYPE_REQUIRE_INTERNAL_REFERENCE)
+ {
+ rp_issued_token_set_require_internal_reference(issued_token, env, AXIS2_TRUE);
+ }
+ else
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c Tue Aug 18 10:45:16 2009
@@ -38,10 +38,10 @@
child_node = axiom_node_get_first_element(node, env);
- if (child_node)
+ if(child_node)
{
layout_node = axiom_node_get_first_element(child_node, env);
- if (!layout_node)
+ if(!layout_node)
{
return NULL;
}
@@ -51,22 +51,19 @@
return NULL;
}
- if (axiom_node_get_node_type(layout_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(layout_node, env) == AXIOM_ELEMENT)
{
- layout_element =
- (axiom_element_t *) axiom_node_get_data_element(layout_node, env);
- if (layout_element)
+ layout_element = (axiom_element_t *)axiom_node_get_data_element(layout_node, env);
+ if(layout_element)
{
axis2_char_t *local_name = NULL;
local_name = axiom_element_get_localname(layout_element, env);
- if (!local_name)
+ if(!local_name)
return NULL;
rp_layout_set_value(layout, env, local_name);
- assertion =
- neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_layout_free,
- layout,
- ASSERTION_TYPE_LAYOUT);
+ assertion = neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_layout_free,
+ layout, ASSERTION_TYPE_LAYOUT);
return assertion;
}
else
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c Tue Aug 18 10:45:16 2009
@@ -25,7 +25,8 @@
/*private functions*/
-axis2_status_t AXIS2_CALL protection_token_process_alternatives(
+axis2_status_t AXIS2_CALL
+protection_token_process_alternatives(
const axutil_env_t *env,
neethi_all_t *all,
rp_property_t *protection_token);
@@ -51,39 +52,32 @@
protection_token = rp_property_create(env);
child_node = axiom_node_get_first_element(node, env);
- if (!child_node)
+ if(!child_node)
{
return NULL;
}
- if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element =
- (axiom_element_t *) axiom_node_get_data_element(child_node, env);
- if (child_element)
+ child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
+ if(child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if (!policy)
+ if(!policy)
{
return NULL;
}
- normalized_policy =
- neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
neethi_policy_free(policy, env);
policy = NULL;
- alternatives =
- neethi_policy_get_alternatives(normalized_policy, env);
- component =
- (neethi_operator_t *) axutil_array_list_get(alternatives, env,
- 0);
- all = (neethi_all_t *) neethi_operator_get_value(component, env);
+ alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component, env);
protection_token_process_alternatives(env, all, protection_token);
- assertion =
- neethi_assertion_create_with_args(env,
- (AXIS2_FREE_VOID_ARG)rp_property_free,
- protection_token,
- ASSERTION_TYPE_PROTECTION_TOKEN);
+ assertion = neethi_assertion_create_with_args(env,
+ (AXIS2_FREE_VOID_ARG)rp_property_free, protection_token,
+ ASSERTION_TYPE_PROTECTION_TOKEN);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
@@ -114,27 +108,22 @@
arraylist = neethi_all_get_policy_components(all, env);
- for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+ for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
- i);
- assertion =
- (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if (value)
+ if(value)
{
- if (type == ASSERTION_TYPE_X509_TOKEN)
+ if(type == ASSERTION_TYPE_X509_TOKEN)
{
rp_x509_token_t *x509_token = NULL;
- x509_token =
- (rp_x509_token_t *) neethi_assertion_get_value(assertion,
- env);
- if (x509_token)
+ x509_token = (rp_x509_token_t *)neethi_assertion_get_value(assertion, env);
+ if(x509_token)
{
- rp_property_set_value(protection_token, env, x509_token,
- RP_PROPERTY_X509_TOKEN);
+ rp_property_set_value(protection_token, env, x509_token, RP_PROPERTY_X509_TOKEN);
}
else
return AXIS2_FAILURE;
@@ -145,7 +134,8 @@
issued_token = (rp_issued_token_t *)neethi_assertion_get_value(assertion, env);
if(issued_token)
{
- rp_property_set_value(protection_token, env, issued_token, RP_PROPERTY_ISSUED_TOKEN);
+ rp_property_set_value(protection_token, env, issued_token,
+ RP_PROPERTY_ISSUED_TOKEN);
}
else
return AXIS2_FAILURE;
@@ -161,15 +151,16 @@
else
return AXIS2_FAILURE;
}
- else if (type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
+ else if(type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
{
rp_security_context_token_t *security_context_token = NULL;
- security_context_token =
- (rp_security_context_token_t *) neethi_assertion_get_value(assertion, env);
+ security_context_token = (rp_security_context_token_t *)neethi_assertion_get_value(
+ assertion, env);
- if (security_context_token)
+ if(security_context_token)
{
- rp_property_set_value(protection_token, env, security_context_token, RP_PROPERTY_SECURITY_CONTEXT_TOKEN);
+ rp_property_set_value(protection_token, env, security_context_token,
+ RP_PROPERTY_SECURITY_CONTEXT_TOKEN);
}
else
return AXIS2_FAILURE;
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c?rev=805352&r1=805351&r2=805352&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c Tue Aug 18 10:45:16 2009
@@ -19,7 +19,8 @@
/*private functions*/
-axis2_status_t AXIS2_CALL rp_rampart_config_builder_populate(
+axis2_status_t AXIS2_CALL
+rp_rampart_config_builder_populate(
const axutil_env_t *env,
rp_rampart_config_t *rampart_config,
axiom_node_t *node,
@@ -38,38 +39,33 @@
neethi_assertion_t *assertion = NULL;
rampart_config = rp_rampart_config_create(env);
- if (!rampart_config)
+ if(!rampart_config)
{
return NULL;
}
children_iter = axiom_element_get_children(config_ele, env, config);
- if (children_iter)
+ if(children_iter)
{
- while (axiom_children_iterator_has_next(children_iter, env))
+ while(axiom_children_iterator_has_next(children_iter, env))
{
axiom_node_t *node = NULL;
axiom_element_t *ele = NULL;
axis2_char_t *local_name = NULL;
node = axiom_children_iterator_next(children_iter, env);
- if (node)
+ if(node)
{
- if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+ if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
{
- ele =
- (axiom_element_t *) axiom_node_get_data_element(node,
- env);
- if (ele)
+ ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
+ if(ele)
{
local_name = axiom_element_get_localname(ele, env);
- if (local_name)
+ if(local_name)
{
- status =
- rp_rampart_config_builder_populate(env,
- rampart_config,
- node, ele,
- local_name);
- if (status != AXIS2_SUCCESS)
+ status = rp_rampart_config_builder_populate(env, rampart_config, node,
+ ele, local_name);
+ if(status != AXIS2_SUCCESS)
{
return NULL;
}
@@ -79,10 +75,8 @@
}
}
}
- assertion =
- neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_rampart_config_free,
- rampart_config,
- ASSERTION_TYPE_RAMPART_CONFIG);
+ assertion = neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_rampart_config_free,
+ rampart_config, ASSERTION_TYPE_RAMPART_CONFIG);
return assertion;
}
@@ -100,16 +94,16 @@
node_qname = axiom_element_get_qname(element, env, node);
if(!node_qname)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Cannot get qname from element %s.", local_name);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] Cannot get qname from element %s.",
+ local_name);
return AXIS2_FAILURE;
}
ns = axutil_qname_get_uri(node_qname, env);
if(!ns)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Cannot get namespace from element %s.", local_name);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] Cannot get namespace from element %s.",
+ local_name);
return AXIS2_FAILURE;
}
@@ -125,21 +119,21 @@
{
axis2_char_t *encryption_user = NULL;
encryption_user = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_encryption_user(rampart_config, env,encryption_user);
+ return rp_rampart_config_set_encryption_user(rampart_config, env, encryption_user);
}
else if(!axutil_strcmp(local_name, RP_PASSWORD_CALLBACK_CLASS))
{
axis2_char_t *password_callback_class = NULL;
password_callback_class = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_password_callback_class(
- rampart_config, env, password_callback_class);
+ return rp_rampart_config_set_password_callback_class(rampart_config, env,
+ password_callback_class);
}
else if(!axutil_strcmp(local_name, RP_AUTHN_MODULE_NAME))
{
axis2_char_t *authenticate_module = NULL;
authenticate_module = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_authenticate_module(
- rampart_config, env, authenticate_module);
+ return rp_rampart_config_set_authenticate_module(rampart_config, env,
+ authenticate_module);
}
else if(!axutil_strcmp(local_name, RP_RD_MODULE))
{
@@ -169,8 +163,8 @@
{
axis2_char_t *receiver_certificate_file = NULL;
receiver_certificate_file = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_receiver_certificate_file(
- rampart_config, env, receiver_certificate_file);
+ return rp_rampart_config_set_receiver_certificate_file(rampart_config, env,
+ receiver_certificate_file);
}
else if(!axutil_strcmp(local_name, RP_PRIVATE_KEY))
{
@@ -200,8 +194,8 @@
{
axis2_char_t *need_ms_precision = NULL;
need_ms_precision = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_need_millisecond_precision(
- rampart_config, env, need_ms_precision);
+ return rp_rampart_config_set_need_millisecond_precision(rampart_config, env,
+ need_ms_precision);
}
else if(!axutil_strcmp(local_name, RP_RD))
{
@@ -212,9 +206,8 @@
}
/* either the assertion or the namespace is not identified */
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[neethi] Unknown Assertion %s with namespace %s", local_name, ns);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] Unknown Assertion %s with namespace %s",
+ local_name, ns);
return AXIS2_FAILURE;
-
}