6
* This file was auto-generated from WSDL
7
* by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00)
10
#include "adb_networkRule.h"
13
* This type was generated from the piece of schema that had
15
* Namespace URI = http://eucalyptus.ucsb.edu/
16
* Namespace Prefix = ns1
21
struct adb_networkRule
23
axis2_char_t* property_type;
26
axis2_bool_t is_valid_type;
29
axutil_array_list_t* property_sourceNames;
32
axis2_bool_t is_valid_sourceNames;
35
axutil_array_list_t* property_userNames;
38
axis2_bool_t is_valid_userNames;
41
axutil_array_list_t* property_sourceNets;
44
axis2_bool_t is_valid_sourceNets;
47
axis2_char_t* property_destUserName;
50
axis2_bool_t is_valid_destUserName;
53
axis2_char_t* property_destName;
56
axis2_bool_t is_valid_destName;
59
axis2_char_t* property_protocol;
62
axis2_bool_t is_valid_protocol;
65
int property_portRangeMin;
68
axis2_bool_t is_valid_portRangeMin;
71
int property_portRangeMax;
74
axis2_bool_t is_valid_portRangeMax;
81
/************************* Private Function prototypes ********************************/
84
axis2_status_t AXIS2_CALL
85
adb_networkRule_set_type_nil(
86
adb_networkRule_t* _networkRule,
87
const axutil_env_t *env);
89
axis2_status_t AXIS2_CALL
90
adb_networkRule_set_sourceNames_nil_at(
91
adb_networkRule_t* _networkRule,
92
const axutil_env_t *env, int i);
95
axis2_status_t AXIS2_CALL
96
adb_networkRule_set_sourceNames_nil(
97
adb_networkRule_t* _networkRule,
98
const axutil_env_t *env);
100
axis2_status_t AXIS2_CALL
101
adb_networkRule_set_userNames_nil_at(
102
adb_networkRule_t* _networkRule,
103
const axutil_env_t *env, int i);
106
axis2_status_t AXIS2_CALL
107
adb_networkRule_set_userNames_nil(
108
adb_networkRule_t* _networkRule,
109
const axutil_env_t *env);
111
axis2_status_t AXIS2_CALL
112
adb_networkRule_set_sourceNets_nil_at(
113
adb_networkRule_t* _networkRule,
114
const axutil_env_t *env, int i);
117
axis2_status_t AXIS2_CALL
118
adb_networkRule_set_sourceNets_nil(
119
adb_networkRule_t* _networkRule,
120
const axutil_env_t *env);
123
axis2_status_t AXIS2_CALL
124
adb_networkRule_set_destUserName_nil(
125
adb_networkRule_t* _networkRule,
126
const axutil_env_t *env);
129
axis2_status_t AXIS2_CALL
130
adb_networkRule_set_destName_nil(
131
adb_networkRule_t* _networkRule,
132
const axutil_env_t *env);
135
axis2_status_t AXIS2_CALL
136
adb_networkRule_set_protocol_nil(
137
adb_networkRule_t* _networkRule,
138
const axutil_env_t *env);
141
axis2_status_t AXIS2_CALL
142
adb_networkRule_set_portRangeMin_nil(
143
adb_networkRule_t* _networkRule,
144
const axutil_env_t *env);
147
axis2_status_t AXIS2_CALL
148
adb_networkRule_set_portRangeMax_nil(
149
adb_networkRule_t* _networkRule,
150
const axutil_env_t *env);
154
/************************* Function Implmentations ********************************/
155
adb_networkRule_t* AXIS2_CALL
156
adb_networkRule_create(
157
const axutil_env_t *env)
159
adb_networkRule_t *_networkRule = NULL;
161
AXIS2_ENV_CHECK(env, NULL);
163
_networkRule = (adb_networkRule_t *) AXIS2_MALLOC(env->
164
allocator, sizeof(adb_networkRule_t));
166
if(NULL == _networkRule)
168
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
172
memset(_networkRule, 0, sizeof(adb_networkRule_t));
174
_networkRule->property_type = NULL;
175
_networkRule->is_valid_type = AXIS2_FALSE;
176
_networkRule->property_sourceNames = NULL;
177
_networkRule->is_valid_sourceNames = AXIS2_FALSE;
178
_networkRule->property_userNames = NULL;
179
_networkRule->is_valid_userNames = AXIS2_FALSE;
180
_networkRule->property_sourceNets = NULL;
181
_networkRule->is_valid_sourceNets = AXIS2_FALSE;
182
_networkRule->property_destUserName = NULL;
183
_networkRule->is_valid_destUserName = AXIS2_FALSE;
184
_networkRule->property_destName = NULL;
185
_networkRule->is_valid_destName = AXIS2_FALSE;
186
_networkRule->property_protocol = NULL;
187
_networkRule->is_valid_protocol = AXIS2_FALSE;
188
_networkRule->is_valid_portRangeMin = AXIS2_FALSE;
189
_networkRule->is_valid_portRangeMax = AXIS2_FALSE;
195
axis2_status_t AXIS2_CALL
196
adb_networkRule_free (
197
adb_networkRule_t* _networkRule,
198
const axutil_env_t *env)
203
void *element = NULL;
206
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
207
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
209
adb_networkRule_reset_type(_networkRule, env);
210
adb_networkRule_reset_sourceNames(_networkRule, env);
211
adb_networkRule_reset_userNames(_networkRule, env);
212
adb_networkRule_reset_sourceNets(_networkRule, env);
213
adb_networkRule_reset_destUserName(_networkRule, env);
214
adb_networkRule_reset_destName(_networkRule, env);
215
adb_networkRule_reset_protocol(_networkRule, env);
216
adb_networkRule_reset_portRangeMin(_networkRule, env);
217
adb_networkRule_reset_portRangeMax(_networkRule, env);
222
AXIS2_FREE(env->allocator, _networkRule);
225
return AXIS2_SUCCESS;
231
axis2_status_t AXIS2_CALL
232
adb_networkRule_deserialize(
233
adb_networkRule_t* _networkRule,
234
const axutil_env_t *env,
235
axiom_node_t **dp_parent,
236
axis2_bool_t *dp_is_early_node_valid,
237
axis2_bool_t dont_care_minoccurs)
239
axiom_node_t *parent = *dp_parent;
241
axis2_status_t status = AXIS2_SUCCESS;
243
void *element = NULL;
245
axis2_char_t* text_value = NULL;
246
axutil_qname_t *qname = NULL;
249
axutil_array_list_t *arr_list = NULL;
251
int sequence_broken = 0;
252
axiom_node_t *tmp_node = NULL;
254
axutil_qname_t *element_qname = NULL;
256
axiom_node_t *first_node = NULL;
257
axis2_bool_t is_early_node_valid = AXIS2_TRUE;
258
axiom_node_t *current_node = NULL;
259
axiom_element_t *current_element = NULL;
261
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
262
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
266
while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
268
parent = axiom_node_get_next_sibling(parent, env);
272
/* This should be checked before everything */
273
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
274
"Failed in building adb object for networkRule : "
275
"NULL elemenet can not be passed to deserialize");
276
return AXIS2_FAILURE;
280
first_node = axiom_node_get_first_child(parent, env);
286
* building type element
291
current_node = first_node;
292
is_early_node_valid = AXIS2_FALSE;
295
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
297
current_node = axiom_node_get_next_sibling(current_node, env);
299
if(current_node != NULL)
301
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
302
qname = axiom_element_get_qname(current_element, env, current_node);
305
element_qname = axutil_qname_create(env, "type", "http://eucalyptus.ucsb.edu/", NULL);
309
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
311
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
313
is_early_node_valid = AXIS2_TRUE;
317
text_value = axiom_element_get_text(current_element, env, current_node);
318
if(text_value != NULL)
320
status = adb_networkRule_set_type(_networkRule, env,
327
* axis2_qname_t *qname = NULL;
328
* axiom_attribute_t *the_attri = NULL;
330
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
331
* the_attri = axiom_element_get_attribute(current_element, env, qname);
333
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
335
axiom_attribute_t *the_attri = NULL;
336
axis2_char_t *attrib_text = NULL;
337
axutil_hash_t *attribute_hash = NULL;
339
attribute_hash = axiom_element_get_all_attributes(current_element, env);
344
axutil_hash_index_t *hi;
348
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
350
axutil_hash_this(hi, &key, NULL, &val);
352
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
354
the_attri = (axiom_attribute_t*)val;
362
attrib_text = axiom_attribute_get_value(the_attri, env);
366
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
367
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
370
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
372
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element type");
373
status = AXIS2_FAILURE;
377
/* after all, we found this is a empty string */
378
status = adb_networkRule_set_type(_networkRule, env,
383
if(AXIS2_FAILURE == status)
385
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for type ");
388
axutil_qname_free(element_qname, env);
390
return AXIS2_FAILURE;
394
else if(!dont_care_minoccurs)
398
axutil_qname_free(element_qname, env);
400
/* this is not a nillable element*/
401
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element type missing");
402
return AXIS2_FAILURE;
407
axutil_qname_free(element_qname, env);
408
element_qname = NULL;
412
* building sourceNames array
414
arr_list = axutil_array_list_create(env, 10);
419
* building sourceNames element
424
element_qname = axutil_qname_create(env, "sourceNames", "http://eucalyptus.ucsb.edu/", NULL);
427
for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, env):current_node); !sequence_broken && current_node != NULL;)
430
if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
432
current_node =axiom_node_get_next_sibling(current_node, env);
433
is_early_node_valid = AXIS2_FALSE;
437
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
438
qname = axiom_element_get_qname(current_element, env, current_node);
440
if (axutil_qname_equals(element_qname, env, qname))
443
is_early_node_valid = AXIS2_TRUE;
446
text_value = axiom_element_get_text(current_element, env, current_node);
447
if(text_value != NULL)
449
axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, text_value));
455
* axis2_qname_t *qname = NULL;
456
* axiom_attribute_t *the_attri = NULL;
458
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
459
* the_attri = axiom_element_get_attribute(current_element, env, qname);
462
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
464
axiom_attribute_t *the_attri = NULL;
465
axis2_char_t *attrib_text = NULL;
466
axutil_hash_t *attribute_hash = NULL;
468
attribute_hash = axiom_element_get_all_attributes(current_element, env);
473
axutil_hash_index_t *hi;
477
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
479
axutil_hash_this(hi, &key, NULL, &val);
481
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
483
the_attri = (axiom_attribute_t*)val;
491
attrib_text = axiom_attribute_get_value(the_attri, env);
495
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
496
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
499
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
501
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element sourceNames");
502
status = AXIS2_FAILURE;
506
/* after all, we found this is a empty string */
507
axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, ""));
511
if(AXIS2_FAILURE == status)
513
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for sourceNames ");
516
axutil_qname_free(element_qname, env);
520
axutil_array_list_free(arr_list, env);
522
return AXIS2_FAILURE;
526
current_node = axiom_node_get_next_sibling(current_node, env);
530
is_early_node_valid = AXIS2_FALSE;
539
/* found element out of order */
540
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNames (@minOccurs = '0') only have %d elements", i);
543
axutil_qname_free(element_qname, env);
547
axutil_array_list_free(arr_list, env);
549
return AXIS2_FAILURE;
553
if(0 == axutil_array_list_size(arr_list,env))
555
axutil_array_list_free(arr_list, env);
559
status = adb_networkRule_set_sourceNames(_networkRule, env,
566
axutil_qname_free(element_qname, env);
567
element_qname = NULL;
571
* building userNames array
573
arr_list = axutil_array_list_create(env, 10);
578
* building userNames element
583
element_qname = axutil_qname_create(env, "userNames", "http://eucalyptus.ucsb.edu/", NULL);
586
for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, env):current_node); !sequence_broken && current_node != NULL;)
589
if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
591
current_node =axiom_node_get_next_sibling(current_node, env);
592
is_early_node_valid = AXIS2_FALSE;
596
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
597
qname = axiom_element_get_qname(current_element, env, current_node);
599
if (axutil_qname_equals(element_qname, env, qname))
602
is_early_node_valid = AXIS2_TRUE;
605
text_value = axiom_element_get_text(current_element, env, current_node);
606
if(text_value != NULL)
608
axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, text_value));
614
* axis2_qname_t *qname = NULL;
615
* axiom_attribute_t *the_attri = NULL;
617
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
618
* the_attri = axiom_element_get_attribute(current_element, env, qname);
621
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
623
axiom_attribute_t *the_attri = NULL;
624
axis2_char_t *attrib_text = NULL;
625
axutil_hash_t *attribute_hash = NULL;
627
attribute_hash = axiom_element_get_all_attributes(current_element, env);
632
axutil_hash_index_t *hi;
636
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
638
axutil_hash_this(hi, &key, NULL, &val);
640
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
642
the_attri = (axiom_attribute_t*)val;
650
attrib_text = axiom_attribute_get_value(the_attri, env);
654
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
655
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
658
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
660
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element userNames");
661
status = AXIS2_FAILURE;
665
/* after all, we found this is a empty string */
666
axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, ""));
670
if(AXIS2_FAILURE == status)
672
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for userNames ");
675
axutil_qname_free(element_qname, env);
679
axutil_array_list_free(arr_list, env);
681
return AXIS2_FAILURE;
685
current_node = axiom_node_get_next_sibling(current_node, env);
689
is_early_node_valid = AXIS2_FALSE;
698
/* found element out of order */
699
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "userNames (@minOccurs = '0') only have %d elements", i);
702
axutil_qname_free(element_qname, env);
706
axutil_array_list_free(arr_list, env);
708
return AXIS2_FAILURE;
712
if(0 == axutil_array_list_size(arr_list,env))
714
axutil_array_list_free(arr_list, env);
718
status = adb_networkRule_set_userNames(_networkRule, env,
725
axutil_qname_free(element_qname, env);
726
element_qname = NULL;
730
* building sourceNets array
732
arr_list = axutil_array_list_create(env, 10);
737
* building sourceNets element
742
element_qname = axutil_qname_create(env, "sourceNets", "http://eucalyptus.ucsb.edu/", NULL);
745
for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, env):current_node); !sequence_broken && current_node != NULL;)
748
if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
750
current_node =axiom_node_get_next_sibling(current_node, env);
751
is_early_node_valid = AXIS2_FALSE;
755
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
756
qname = axiom_element_get_qname(current_element, env, current_node);
758
if (axutil_qname_equals(element_qname, env, qname))
761
is_early_node_valid = AXIS2_TRUE;
764
text_value = axiom_element_get_text(current_element, env, current_node);
765
if(text_value != NULL)
767
axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, text_value));
773
* axis2_qname_t *qname = NULL;
774
* axiom_attribute_t *the_attri = NULL;
776
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
777
* the_attri = axiom_element_get_attribute(current_element, env, qname);
780
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
782
axiom_attribute_t *the_attri = NULL;
783
axis2_char_t *attrib_text = NULL;
784
axutil_hash_t *attribute_hash = NULL;
786
attribute_hash = axiom_element_get_all_attributes(current_element, env);
791
axutil_hash_index_t *hi;
795
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
797
axutil_hash_this(hi, &key, NULL, &val);
799
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
801
the_attri = (axiom_attribute_t*)val;
809
attrib_text = axiom_attribute_get_value(the_attri, env);
813
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
814
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
817
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
819
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element sourceNets");
820
status = AXIS2_FAILURE;
824
/* after all, we found this is a empty string */
825
axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, ""));
829
if(AXIS2_FAILURE == status)
831
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for sourceNets ");
834
axutil_qname_free(element_qname, env);
838
axutil_array_list_free(arr_list, env);
840
return AXIS2_FAILURE;
844
current_node = axiom_node_get_next_sibling(current_node, env);
848
is_early_node_valid = AXIS2_FALSE;
857
/* found element out of order */
858
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNets (@minOccurs = '0') only have %d elements", i);
861
axutil_qname_free(element_qname, env);
865
axutil_array_list_free(arr_list, env);
867
return AXIS2_FAILURE;
871
if(0 == axutil_array_list_size(arr_list,env))
873
axutil_array_list_free(arr_list, env);
877
status = adb_networkRule_set_sourceNets(_networkRule, env,
884
axutil_qname_free(element_qname, env);
885
element_qname = NULL;
891
* building destUserName element
897
* because elements are ordered this works fine
901
if(current_node != NULL && is_early_node_valid)
903
current_node = axiom_node_get_next_sibling(current_node, env);
906
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
908
current_node = axiom_node_get_next_sibling(current_node, env);
910
if(current_node != NULL)
912
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
913
qname = axiom_element_get_qname(current_element, env, current_node);
917
is_early_node_valid = AXIS2_FALSE;
919
element_qname = axutil_qname_create(env, "destUserName", "http://eucalyptus.ucsb.edu/", NULL);
923
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
925
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
927
is_early_node_valid = AXIS2_TRUE;
931
text_value = axiom_element_get_text(current_element, env, current_node);
932
if(text_value != NULL)
934
status = adb_networkRule_set_destUserName(_networkRule, env,
941
* axis2_qname_t *qname = NULL;
942
* axiom_attribute_t *the_attri = NULL;
944
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
945
* the_attri = axiom_element_get_attribute(current_element, env, qname);
947
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
949
axiom_attribute_t *the_attri = NULL;
950
axis2_char_t *attrib_text = NULL;
951
axutil_hash_t *attribute_hash = NULL;
953
attribute_hash = axiom_element_get_all_attributes(current_element, env);
958
axutil_hash_index_t *hi;
962
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
964
axutil_hash_this(hi, &key, NULL, &val);
966
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
968
the_attri = (axiom_attribute_t*)val;
976
attrib_text = axiom_attribute_get_value(the_attri, env);
980
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
981
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
984
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
986
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element destUserName");
987
status = AXIS2_FAILURE;
991
/* after all, we found this is a empty string */
992
status = adb_networkRule_set_destUserName(_networkRule, env,
997
if(AXIS2_FAILURE == status)
999
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for destUserName ");
1002
axutil_qname_free(element_qname, env);
1004
return AXIS2_FAILURE;
1010
axutil_qname_free(element_qname, env);
1011
element_qname = NULL;
1017
* building destName element
1023
* because elements are ordered this works fine
1027
if(current_node != NULL && is_early_node_valid)
1029
current_node = axiom_node_get_next_sibling(current_node, env);
1032
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
1034
current_node = axiom_node_get_next_sibling(current_node, env);
1036
if(current_node != NULL)
1038
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
1039
qname = axiom_element_get_qname(current_element, env, current_node);
1043
is_early_node_valid = AXIS2_FALSE;
1045
element_qname = axutil_qname_create(env, "destName", "http://eucalyptus.ucsb.edu/", NULL);
1049
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
1051
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
1053
is_early_node_valid = AXIS2_TRUE;
1057
text_value = axiom_element_get_text(current_element, env, current_node);
1058
if(text_value != NULL)
1060
status = adb_networkRule_set_destName(_networkRule, env,
1067
* axis2_qname_t *qname = NULL;
1068
* axiom_attribute_t *the_attri = NULL;
1070
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
1071
* the_attri = axiom_element_get_attribute(current_element, env, qname);
1073
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
1075
axiom_attribute_t *the_attri = NULL;
1076
axis2_char_t *attrib_text = NULL;
1077
axutil_hash_t *attribute_hash = NULL;
1079
attribute_hash = axiom_element_get_all_attributes(current_element, env);
1084
axutil_hash_index_t *hi;
1088
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
1090
axutil_hash_this(hi, &key, NULL, &val);
1092
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
1094
the_attri = (axiom_attribute_t*)val;
1102
attrib_text = axiom_attribute_get_value(the_attri, env);
1106
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
1107
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
1110
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
1112
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element destName");
1113
status = AXIS2_FAILURE;
1117
/* after all, we found this is a empty string */
1118
status = adb_networkRule_set_destName(_networkRule, env,
1123
if(AXIS2_FAILURE == status)
1125
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for destName ");
1128
axutil_qname_free(element_qname, env);
1130
return AXIS2_FAILURE;
1134
else if(!dont_care_minoccurs)
1138
axutil_qname_free(element_qname, env);
1140
/* this is not a nillable element*/
1141
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element destName missing");
1142
return AXIS2_FAILURE;
1147
axutil_qname_free(element_qname, env);
1148
element_qname = NULL;
1154
* building protocol element
1160
* because elements are ordered this works fine
1164
if(current_node != NULL && is_early_node_valid)
1166
current_node = axiom_node_get_next_sibling(current_node, env);
1169
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
1171
current_node = axiom_node_get_next_sibling(current_node, env);
1173
if(current_node != NULL)
1175
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
1176
qname = axiom_element_get_qname(current_element, env, current_node);
1180
is_early_node_valid = AXIS2_FALSE;
1182
element_qname = axutil_qname_create(env, "protocol", "http://eucalyptus.ucsb.edu/", NULL);
1186
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
1188
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
1190
is_early_node_valid = AXIS2_TRUE;
1194
text_value = axiom_element_get_text(current_element, env, current_node);
1195
if(text_value != NULL)
1197
status = adb_networkRule_set_protocol(_networkRule, env,
1204
* axis2_qname_t *qname = NULL;
1205
* axiom_attribute_t *the_attri = NULL;
1207
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
1208
* the_attri = axiom_element_get_attribute(current_element, env, qname);
1210
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
1212
axiom_attribute_t *the_attri = NULL;
1213
axis2_char_t *attrib_text = NULL;
1214
axutil_hash_t *attribute_hash = NULL;
1216
attribute_hash = axiom_element_get_all_attributes(current_element, env);
1221
axutil_hash_index_t *hi;
1225
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
1227
axutil_hash_this(hi, &key, NULL, &val);
1229
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
1231
the_attri = (axiom_attribute_t*)val;
1239
attrib_text = axiom_attribute_get_value(the_attri, env);
1243
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
1244
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
1247
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
1249
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element protocol");
1250
status = AXIS2_FAILURE;
1254
/* after all, we found this is a empty string */
1255
status = adb_networkRule_set_protocol(_networkRule, env,
1260
if(AXIS2_FAILURE == status)
1262
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for protocol ");
1265
axutil_qname_free(element_qname, env);
1267
return AXIS2_FAILURE;
1271
else if(!dont_care_minoccurs)
1275
axutil_qname_free(element_qname, env);
1277
/* this is not a nillable element*/
1278
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element protocol missing");
1279
return AXIS2_FAILURE;
1284
axutil_qname_free(element_qname, env);
1285
element_qname = NULL;
1291
* building portRangeMin element
1297
* because elements are ordered this works fine
1301
if(current_node != NULL && is_early_node_valid)
1303
current_node = axiom_node_get_next_sibling(current_node, env);
1306
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
1308
current_node = axiom_node_get_next_sibling(current_node, env);
1310
if(current_node != NULL)
1312
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
1313
qname = axiom_element_get_qname(current_element, env, current_node);
1317
is_early_node_valid = AXIS2_FALSE;
1319
element_qname = axutil_qname_create(env, "portRangeMin", "http://eucalyptus.ucsb.edu/", NULL);
1323
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
1325
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
1327
is_early_node_valid = AXIS2_TRUE;
1331
text_value = axiom_element_get_text(current_element, env, current_node);
1332
if(text_value != NULL)
1334
status = adb_networkRule_set_portRangeMin(_networkRule, env,
1340
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element portRangeMin");
1341
status = AXIS2_FAILURE;
1344
if(AXIS2_FAILURE == status)
1346
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for portRangeMin ");
1349
axutil_qname_free(element_qname, env);
1351
return AXIS2_FAILURE;
1355
else if(!dont_care_minoccurs)
1359
axutil_qname_free(element_qname, env);
1361
/* this is not a nillable element*/
1362
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element portRangeMin missing");
1363
return AXIS2_FAILURE;
1368
axutil_qname_free(element_qname, env);
1369
element_qname = NULL;
1375
* building portRangeMax element
1381
* because elements are ordered this works fine
1385
if(current_node != NULL && is_early_node_valid)
1387
current_node = axiom_node_get_next_sibling(current_node, env);
1390
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
1392
current_node = axiom_node_get_next_sibling(current_node, env);
1394
if(current_node != NULL)
1396
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
1397
qname = axiom_element_get_qname(current_element, env, current_node);
1401
is_early_node_valid = AXIS2_FALSE;
1403
element_qname = axutil_qname_create(env, "portRangeMax", "http://eucalyptus.ucsb.edu/", NULL);
1407
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
1409
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
1411
is_early_node_valid = AXIS2_TRUE;
1415
text_value = axiom_element_get_text(current_element, env, current_node);
1416
if(text_value != NULL)
1418
status = adb_networkRule_set_portRangeMax(_networkRule, env,
1424
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element portRangeMax");
1425
status = AXIS2_FAILURE;
1428
if(AXIS2_FAILURE == status)
1430
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for portRangeMax ");
1433
axutil_qname_free(element_qname, env);
1435
return AXIS2_FAILURE;
1439
else if(!dont_care_minoccurs)
1443
axutil_qname_free(element_qname, env);
1445
/* this is not a nillable element*/
1446
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element portRangeMax missing");
1447
return AXIS2_FAILURE;
1452
axutil_qname_free(element_qname, env);
1453
element_qname = NULL;
1459
axis2_bool_t AXIS2_CALL
1460
adb_networkRule_is_particle()
1469
adb_networkRule_declare_parent_namespaces(
1470
adb_networkRule_t* _networkRule,
1471
const axutil_env_t *env, axiom_element_t *parent_element,
1472
axutil_hash_t *namespaces, int *next_ns_index)
1475
/* Here this is an empty function, Nothing to declare */
1481
axiom_node_t* AXIS2_CALL
1482
adb_networkRule_serialize(
1483
adb_networkRule_t* _networkRule,
1484
const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index)
1488
axis2_char_t *string_to_stream;
1491
axiom_node_t *current_node = NULL;
1496
axiom_namespace_t *ns1 = NULL;
1498
axis2_char_t *qname_uri = NULL;
1499
axis2_char_t *qname_prefix = NULL;
1500
axis2_char_t *p_prefix = NULL;
1501
axis2_bool_t ns_already_defined;
1505
void *element = NULL;
1507
axis2_char_t *text_value_1;
1508
axis2_char_t *text_value_1_temp;
1510
axis2_char_t *text_value_2;
1511
axis2_char_t *text_value_2_temp;
1513
axis2_char_t *text_value_3;
1514
axis2_char_t *text_value_3_temp;
1516
axis2_char_t *text_value_4;
1517
axis2_char_t *text_value_4_temp;
1519
axis2_char_t *text_value_5;
1520
axis2_char_t *text_value_5_temp;
1522
axis2_char_t *text_value_6;
1523
axis2_char_t *text_value_6_temp;
1525
axis2_char_t *text_value_7;
1526
axis2_char_t *text_value_7_temp;
1528
axis2_char_t text_value_8[64];
1530
axis2_char_t text_value_9[64];
1532
axis2_char_t *start_input_str = NULL;
1533
axis2_char_t *end_input_str = NULL;
1534
unsigned int start_input_str_len = 0;
1535
unsigned int end_input_str_len = 0;
1538
axiom_data_source_t *data_source = NULL;
1539
axutil_stream_t *stream = NULL;
1543
AXIS2_ENV_CHECK(env, NULL);
1544
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
1547
current_node = parent;
1548
data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
1551
stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
1555
if(!parent_tag_closed)
1558
string_to_stream = ">";
1559
axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
1564
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1566
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1567
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1568
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1570
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1571
"http://eucalyptus.ucsb.edu/",
1576
if (!_networkRule->is_valid_type)
1580
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property type");
1586
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1587
(4 + axutil_strlen(p_prefix) +
1588
axutil_strlen("type")));
1590
/* axutil_strlen("<:>") + 1 = 4 */
1591
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1592
(5 + axutil_strlen(p_prefix) + axutil_strlen("type")));
1593
/* axutil_strlen("</:>") + 1 = 5 */
1601
* parsing type element
1606
sprintf(start_input_str, "<%s%stype>",
1607
p_prefix?p_prefix:"",
1608
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1610
start_input_str_len = axutil_strlen(start_input_str);
1611
sprintf(end_input_str, "</%s%stype>",
1612
p_prefix?p_prefix:"",
1613
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1614
end_input_str_len = axutil_strlen(end_input_str);
1616
text_value_1 = _networkRule->property_type;
1618
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1621
text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE);
1622
if (text_value_1_temp)
1624
axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp));
1625
AXIS2_FREE(env->allocator, text_value_1_temp);
1629
axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
1632
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1635
AXIS2_FREE(env->allocator,start_input_str);
1636
AXIS2_FREE(env->allocator,end_input_str);
1640
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1642
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1643
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1644
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1646
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1647
"http://eucalyptus.ucsb.edu/",
1652
if (!_networkRule->is_valid_sourceNames)
1655
/* no need to complain for minoccurs=0 element */
1661
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1662
(4 + axutil_strlen(p_prefix) +
1663
axutil_strlen("sourceNames")));
1665
/* axutil_strlen("<:>") + 1 = 4 */
1666
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1667
(5 + axutil_strlen(p_prefix) + axutil_strlen("sourceNames")));
1668
/* axutil_strlen("</:>") + 1 = 5 */
1675
* Parsing sourceNames array
1677
if (_networkRule->property_sourceNames != NULL)
1680
sprintf(start_input_str, "<%s%ssourceNames>",
1681
p_prefix?p_prefix:"",
1682
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1684
start_input_str_len = axutil_strlen(start_input_str);
1686
sprintf(end_input_str, "</%s%ssourceNames>",
1687
p_prefix?p_prefix:"",
1688
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1689
end_input_str_len = axutil_strlen(end_input_str);
1691
count = axutil_array_list_size(_networkRule->property_sourceNames, env);
1692
for(i = 0; i < count; i ++)
1694
element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
1703
* parsing sourceNames element
1708
text_value_2 = (axis2_char_t*)element;
1710
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1713
text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
1714
if (text_value_2_temp)
1716
axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp));
1717
AXIS2_FREE(env->allocator, text_value_2_temp);
1721
axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
1724
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1730
AXIS2_FREE(env->allocator,start_input_str);
1731
AXIS2_FREE(env->allocator,end_input_str);
1735
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1737
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1738
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1739
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1741
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1742
"http://eucalyptus.ucsb.edu/",
1747
if (!_networkRule->is_valid_userNames)
1750
/* no need to complain for minoccurs=0 element */
1756
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1757
(4 + axutil_strlen(p_prefix) +
1758
axutil_strlen("userNames")));
1760
/* axutil_strlen("<:>") + 1 = 4 */
1761
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1762
(5 + axutil_strlen(p_prefix) + axutil_strlen("userNames")));
1763
/* axutil_strlen("</:>") + 1 = 5 */
1770
* Parsing userNames array
1772
if (_networkRule->property_userNames != NULL)
1775
sprintf(start_input_str, "<%s%suserNames>",
1776
p_prefix?p_prefix:"",
1777
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1779
start_input_str_len = axutil_strlen(start_input_str);
1781
sprintf(end_input_str, "</%s%suserNames>",
1782
p_prefix?p_prefix:"",
1783
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1784
end_input_str_len = axutil_strlen(end_input_str);
1786
count = axutil_array_list_size(_networkRule->property_userNames, env);
1787
for(i = 0; i < count; i ++)
1789
element = axutil_array_list_get(_networkRule->property_userNames, env, i);
1798
* parsing userNames element
1803
text_value_3 = (axis2_char_t*)element;
1805
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1808
text_value_3_temp = axutil_xml_quote_string(env, text_value_3, AXIS2_TRUE);
1809
if (text_value_3_temp)
1811
axutil_stream_write(stream, env, text_value_3_temp, axutil_strlen(text_value_3_temp));
1812
AXIS2_FREE(env->allocator, text_value_3_temp);
1816
axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
1819
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1825
AXIS2_FREE(env->allocator,start_input_str);
1826
AXIS2_FREE(env->allocator,end_input_str);
1830
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1832
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1833
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1834
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1836
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1837
"http://eucalyptus.ucsb.edu/",
1842
if (!_networkRule->is_valid_sourceNets)
1845
/* no need to complain for minoccurs=0 element */
1851
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1852
(4 + axutil_strlen(p_prefix) +
1853
axutil_strlen("sourceNets")));
1855
/* axutil_strlen("<:>") + 1 = 4 */
1856
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1857
(5 + axutil_strlen(p_prefix) + axutil_strlen("sourceNets")));
1858
/* axutil_strlen("</:>") + 1 = 5 */
1865
* Parsing sourceNets array
1867
if (_networkRule->property_sourceNets != NULL)
1870
sprintf(start_input_str, "<%s%ssourceNets>",
1871
p_prefix?p_prefix:"",
1872
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1874
start_input_str_len = axutil_strlen(start_input_str);
1876
sprintf(end_input_str, "</%s%ssourceNets>",
1877
p_prefix?p_prefix:"",
1878
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1879
end_input_str_len = axutil_strlen(end_input_str);
1881
count = axutil_array_list_size(_networkRule->property_sourceNets, env);
1882
for(i = 0; i < count; i ++)
1884
element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
1893
* parsing sourceNets element
1898
text_value_4 = (axis2_char_t*)element;
1900
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1903
text_value_4_temp = axutil_xml_quote_string(env, text_value_4, AXIS2_TRUE);
1904
if (text_value_4_temp)
1906
axutil_stream_write(stream, env, text_value_4_temp, axutil_strlen(text_value_4_temp));
1907
AXIS2_FREE(env->allocator, text_value_4_temp);
1911
axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
1914
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1920
AXIS2_FREE(env->allocator,start_input_str);
1921
AXIS2_FREE(env->allocator,end_input_str);
1925
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1927
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1928
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1929
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1931
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1932
"http://eucalyptus.ucsb.edu/",
1937
if (!_networkRule->is_valid_destUserName)
1940
/* no need to complain for minoccurs=0 element */
1946
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1947
(4 + axutil_strlen(p_prefix) +
1948
axutil_strlen("destUserName")));
1950
/* axutil_strlen("<:>") + 1 = 4 */
1951
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1952
(5 + axutil_strlen(p_prefix) + axutil_strlen("destUserName")));
1953
/* axutil_strlen("</:>") + 1 = 5 */
1961
* parsing destUserName element
1966
sprintf(start_input_str, "<%s%sdestUserName>",
1967
p_prefix?p_prefix:"",
1968
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1970
start_input_str_len = axutil_strlen(start_input_str);
1971
sprintf(end_input_str, "</%s%sdestUserName>",
1972
p_prefix?p_prefix:"",
1973
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1974
end_input_str_len = axutil_strlen(end_input_str);
1976
text_value_5 = _networkRule->property_destUserName;
1978
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1981
text_value_5_temp = axutil_xml_quote_string(env, text_value_5, AXIS2_TRUE);
1982
if (text_value_5_temp)
1984
axutil_stream_write(stream, env, text_value_5_temp, axutil_strlen(text_value_5_temp));
1985
AXIS2_FREE(env->allocator, text_value_5_temp);
1989
axutil_stream_write(stream, env, text_value_5, axutil_strlen(text_value_5));
1992
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1995
AXIS2_FREE(env->allocator,start_input_str);
1996
AXIS2_FREE(env->allocator,end_input_str);
2000
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
2002
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
2003
sprintf(p_prefix, "n%d", (*next_ns_index)++);
2004
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
2006
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
2007
"http://eucalyptus.ucsb.edu/",
2012
if (!_networkRule->is_valid_destName)
2016
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property destName");
2022
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2023
(4 + axutil_strlen(p_prefix) +
2024
axutil_strlen("destName")));
2026
/* axutil_strlen("<:>") + 1 = 4 */
2027
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2028
(5 + axutil_strlen(p_prefix) + axutil_strlen("destName")));
2029
/* axutil_strlen("</:>") + 1 = 5 */
2037
* parsing destName element
2042
sprintf(start_input_str, "<%s%sdestName>",
2043
p_prefix?p_prefix:"",
2044
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2046
start_input_str_len = axutil_strlen(start_input_str);
2047
sprintf(end_input_str, "</%s%sdestName>",
2048
p_prefix?p_prefix:"",
2049
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2050
end_input_str_len = axutil_strlen(end_input_str);
2052
text_value_6 = _networkRule->property_destName;
2054
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
2057
text_value_6_temp = axutil_xml_quote_string(env, text_value_6, AXIS2_TRUE);
2058
if (text_value_6_temp)
2060
axutil_stream_write(stream, env, text_value_6_temp, axutil_strlen(text_value_6_temp));
2061
AXIS2_FREE(env->allocator, text_value_6_temp);
2065
axutil_stream_write(stream, env, text_value_6, axutil_strlen(text_value_6));
2068
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
2071
AXIS2_FREE(env->allocator,start_input_str);
2072
AXIS2_FREE(env->allocator,end_input_str);
2076
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
2078
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
2079
sprintf(p_prefix, "n%d", (*next_ns_index)++);
2080
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
2082
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
2083
"http://eucalyptus.ucsb.edu/",
2088
if (!_networkRule->is_valid_protocol)
2092
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property protocol");
2098
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2099
(4 + axutil_strlen(p_prefix) +
2100
axutil_strlen("protocol")));
2102
/* axutil_strlen("<:>") + 1 = 4 */
2103
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2104
(5 + axutil_strlen(p_prefix) + axutil_strlen("protocol")));
2105
/* axutil_strlen("</:>") + 1 = 5 */
2113
* parsing protocol element
2118
sprintf(start_input_str, "<%s%sprotocol>",
2119
p_prefix?p_prefix:"",
2120
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2122
start_input_str_len = axutil_strlen(start_input_str);
2123
sprintf(end_input_str, "</%s%sprotocol>",
2124
p_prefix?p_prefix:"",
2125
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2126
end_input_str_len = axutil_strlen(end_input_str);
2128
text_value_7 = _networkRule->property_protocol;
2130
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
2133
text_value_7_temp = axutil_xml_quote_string(env, text_value_7, AXIS2_TRUE);
2134
if (text_value_7_temp)
2136
axutil_stream_write(stream, env, text_value_7_temp, axutil_strlen(text_value_7_temp));
2137
AXIS2_FREE(env->allocator, text_value_7_temp);
2141
axutil_stream_write(stream, env, text_value_7, axutil_strlen(text_value_7));
2144
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
2147
AXIS2_FREE(env->allocator,start_input_str);
2148
AXIS2_FREE(env->allocator,end_input_str);
2152
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
2154
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
2155
sprintf(p_prefix, "n%d", (*next_ns_index)++);
2156
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
2158
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
2159
"http://eucalyptus.ucsb.edu/",
2164
if (!_networkRule->is_valid_portRangeMin)
2168
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property portRangeMin");
2174
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2175
(4 + axutil_strlen(p_prefix) +
2176
axutil_strlen("portRangeMin")));
2178
/* axutil_strlen("<:>") + 1 = 4 */
2179
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2180
(5 + axutil_strlen(p_prefix) + axutil_strlen("portRangeMin")));
2181
/* axutil_strlen("</:>") + 1 = 5 */
2189
* parsing portRangeMin element
2194
sprintf(start_input_str, "<%s%sportRangeMin>",
2195
p_prefix?p_prefix:"",
2196
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2198
start_input_str_len = axutil_strlen(start_input_str);
2199
sprintf(end_input_str, "</%s%sportRangeMin>",
2200
p_prefix?p_prefix:"",
2201
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2202
end_input_str_len = axutil_strlen(end_input_str);
2204
sprintf (text_value_8, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _networkRule->property_portRangeMin);
2206
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
2208
axutil_stream_write(stream, env, text_value_8, axutil_strlen(text_value_8));
2210
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
2213
AXIS2_FREE(env->allocator,start_input_str);
2214
AXIS2_FREE(env->allocator,end_input_str);
2218
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
2220
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
2221
sprintf(p_prefix, "n%d", (*next_ns_index)++);
2222
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
2224
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
2225
"http://eucalyptus.ucsb.edu/",
2230
if (!_networkRule->is_valid_portRangeMax)
2234
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property portRangeMax");
2240
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2241
(4 + axutil_strlen(p_prefix) +
2242
axutil_strlen("portRangeMax")));
2244
/* axutil_strlen("<:>") + 1 = 4 */
2245
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
2246
(5 + axutil_strlen(p_prefix) + axutil_strlen("portRangeMax")));
2247
/* axutil_strlen("</:>") + 1 = 5 */
2255
* parsing portRangeMax element
2260
sprintf(start_input_str, "<%s%sportRangeMax>",
2261
p_prefix?p_prefix:"",
2262
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2264
start_input_str_len = axutil_strlen(start_input_str);
2265
sprintf(end_input_str, "</%s%sportRangeMax>",
2266
p_prefix?p_prefix:"",
2267
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
2268
end_input_str_len = axutil_strlen(end_input_str);
2270
sprintf (text_value_9, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _networkRule->property_portRangeMax);
2272
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
2274
axutil_stream_write(stream, env, text_value_9, axutil_strlen(text_value_9));
2276
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
2279
AXIS2_FREE(env->allocator,start_input_str);
2280
AXIS2_FREE(env->allocator,end_input_str);
2294
axis2_char_t* AXIS2_CALL
2295
adb_networkRule_get_type(
2296
adb_networkRule_t* _networkRule,
2297
const axutil_env_t *env)
2300
AXIS2_ENV_CHECK(env, NULL);
2301
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
2304
return _networkRule->property_type;
2310
axis2_status_t AXIS2_CALL
2311
adb_networkRule_set_type(
2312
adb_networkRule_t* _networkRule,
2313
const axutil_env_t *env,
2314
const axis2_char_t* arg_type)
2318
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2319
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2321
if(_networkRule->is_valid_type &&
2322
arg_type == _networkRule->property_type)
2325
return AXIS2_SUCCESS;
2329
if(NULL == arg_type)
2331
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "type is being set to NULL, but it is not a nullable element");
2332
return AXIS2_FAILURE;
2334
adb_networkRule_reset_type(_networkRule, env);
2337
if(NULL == arg_type)
2339
/* We are already done */
2340
return AXIS2_SUCCESS;
2342
_networkRule->property_type = (axis2_char_t *)axutil_strdup(env, arg_type);
2343
if(NULL == _networkRule->property_type)
2345
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for type");
2346
return AXIS2_FAILURE;
2348
_networkRule->is_valid_type = AXIS2_TRUE;
2350
return AXIS2_SUCCESS;
2358
axis2_status_t AXIS2_CALL
2359
adb_networkRule_reset_type(
2360
adb_networkRule_t* _networkRule,
2361
const axutil_env_t *env)
2365
void *element = NULL;
2367
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2368
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2374
if(_networkRule->property_type != NULL)
2378
AXIS2_FREE(env-> allocator, _networkRule->property_type);
2379
_networkRule->property_type = NULL;
2384
_networkRule->is_valid_type = AXIS2_FALSE;
2385
return AXIS2_SUCCESS;
2389
* Check whether type is nill
2391
axis2_bool_t AXIS2_CALL
2392
adb_networkRule_is_type_nil(
2393
adb_networkRule_t* _networkRule,
2394
const axutil_env_t *env)
2396
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
2397
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
2399
return !_networkRule->is_valid_type;
2403
* Set type to nill (currently the same as reset)
2405
axis2_status_t AXIS2_CALL
2406
adb_networkRule_set_type_nil(
2407
adb_networkRule_t* _networkRule,
2408
const axutil_env_t *env)
2410
return adb_networkRule_reset_type(_networkRule, env);
2416
* getter for sourceNames.
2418
axutil_array_list_t* AXIS2_CALL
2419
adb_networkRule_get_sourceNames(
2420
adb_networkRule_t* _networkRule,
2421
const axutil_env_t *env)
2424
AXIS2_ENV_CHECK(env, NULL);
2425
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
2428
return _networkRule->property_sourceNames;
2432
* setter for sourceNames
2434
axis2_status_t AXIS2_CALL
2435
adb_networkRule_set_sourceNames(
2436
adb_networkRule_t* _networkRule,
2437
const axutil_env_t *env,
2438
axutil_array_list_t* arg_sourceNames)
2443
axis2_bool_t non_nil_exists = AXIS2_FALSE;
2446
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2447
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2449
if(_networkRule->is_valid_sourceNames &&
2450
arg_sourceNames == _networkRule->property_sourceNames)
2453
return AXIS2_SUCCESS;
2457
size = axutil_array_list_size(arg_sourceNames, env);
2461
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNames has less than minOccurs(0)");
2462
return AXIS2_FAILURE;
2464
for(i = 0; i < size; i ++ )
2466
if(NULL != axutil_array_list_get(arg_sourceNames, env, i))
2468
non_nil_exists = AXIS2_TRUE;
2473
adb_networkRule_reset_sourceNames(_networkRule, env);
2476
if(NULL == arg_sourceNames)
2478
/* We are already done */
2479
return AXIS2_SUCCESS;
2481
_networkRule->property_sourceNames = arg_sourceNames;
2484
_networkRule->is_valid_sourceNames = AXIS2_TRUE;
2488
return AXIS2_SUCCESS;
2493
* Get ith element of sourceNames.
2495
axis2_char_t* AXIS2_CALL
2496
adb_networkRule_get_sourceNames_at(
2497
adb_networkRule_t* _networkRule,
2498
const axutil_env_t *env, int i)
2500
axis2_char_t* ret_val;
2503
AXIS2_ENV_CHECK(env, NULL);
2504
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
2507
if(_networkRule->property_sourceNames == NULL)
2509
return (axis2_char_t*)0;
2511
ret_val = (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNames, env, i);
2518
* Set the ith element of sourceNames.
2520
axis2_status_t AXIS2_CALL
2521
adb_networkRule_set_sourceNames_at(
2522
adb_networkRule_t* _networkRule,
2523
const axutil_env_t *env, int i,
2524
const axis2_char_t* arg_sourceNames)
2526
void *element = NULL;
2530
axis2_bool_t non_nil_exists = AXIS2_FALSE;
2534
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2535
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2537
if( _networkRule->is_valid_sourceNames &&
2538
_networkRule->property_sourceNames &&
2540
arg_sourceNames == (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNames, env, i))
2544
return AXIS2_SUCCESS;
2548
if(NULL == arg_sourceNames)
2550
if(_networkRule->property_sourceNames != NULL)
2552
size = axutil_array_list_size(_networkRule->property_sourceNames, env);
2553
for(j = 0, k = 0; j < size; j ++ )
2555
if(i == j) continue;
2556
if(NULL != axutil_array_list_get(_networkRule->property_sourceNames, env, i))
2559
non_nil_exists = AXIS2_TRUE;
2570
non_nil_exists = AXIS2_TRUE;
2575
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNames is beinng set to be smaller than the specificed number of minOccurs(0)");
2576
return AXIS2_FAILURE;
2579
if(_networkRule->property_sourceNames == NULL)
2581
_networkRule->property_sourceNames = axutil_array_list_create(env, 10);
2584
/* check whether there already exist an element */
2585
element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
2591
/* This is an unknown type or a primitive. Please free this manually*/
2599
_networkRule->is_valid_sourceNames = AXIS2_FALSE;
2600
axutil_array_list_set(_networkRule->property_sourceNames , env, i, NULL);
2602
return AXIS2_SUCCESS;
2605
axutil_array_list_set(_networkRule->property_sourceNames , env, i, axutil_strdup(env, arg_sourceNames));
2606
_networkRule->is_valid_sourceNames = AXIS2_TRUE;
2608
return AXIS2_SUCCESS;
2612
* Add to sourceNames.
2614
axis2_status_t AXIS2_CALL
2615
adb_networkRule_add_sourceNames(
2616
adb_networkRule_t* _networkRule,
2617
const axutil_env_t *env,
2618
const axis2_char_t* arg_sourceNames)
2622
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2623
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2626
if(NULL == arg_sourceNames)
2629
return AXIS2_SUCCESS;
2634
if(_networkRule->property_sourceNames == NULL)
2636
_networkRule->property_sourceNames = axutil_array_list_create(env, 10);
2638
if(_networkRule->property_sourceNames == NULL)
2640
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for sourceNames");
2641
return AXIS2_FAILURE;
2645
axutil_array_list_add(_networkRule->property_sourceNames , env, axutil_strdup(env, arg_sourceNames));
2646
_networkRule->is_valid_sourceNames = AXIS2_TRUE;
2647
return AXIS2_SUCCESS;
2651
* Get the size of the sourceNames array.
2654
adb_networkRule_sizeof_sourceNames(
2655
adb_networkRule_t* _networkRule,
2656
const axutil_env_t *env)
2658
AXIS2_ENV_CHECK(env, -1);
2659
AXIS2_PARAM_CHECK(env->error, _networkRule, -1);
2660
if(_networkRule->property_sourceNames == NULL)
2664
return axutil_array_list_size(_networkRule->property_sourceNames, env);
2668
* remove the ith element, same as set_nil_at.
2670
axis2_status_t AXIS2_CALL
2671
adb_networkRule_remove_sourceNames_at(
2672
adb_networkRule_t* _networkRule,
2673
const axutil_env_t *env, int i)
2675
return adb_networkRule_set_sourceNames_nil_at(_networkRule, env, i);
2681
* resetter for sourceNames
2683
axis2_status_t AXIS2_CALL
2684
adb_networkRule_reset_sourceNames(
2685
adb_networkRule_t* _networkRule,
2686
const axutil_env_t *env)
2690
void *element = NULL;
2692
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2693
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2697
if (_networkRule->property_sourceNames != NULL)
2699
count = axutil_array_list_size(_networkRule->property_sourceNames, env);
2700
for(i = 0; i < count; i ++)
2702
element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
2710
AXIS2_FREE(env-> allocator, (axis2_char_t*)element);
2718
axutil_array_list_free(_networkRule->property_sourceNames, env);
2720
_networkRule->is_valid_sourceNames = AXIS2_FALSE;
2721
return AXIS2_SUCCESS;
2725
* Check whether sourceNames is nill
2727
axis2_bool_t AXIS2_CALL
2728
adb_networkRule_is_sourceNames_nil(
2729
adb_networkRule_t* _networkRule,
2730
const axutil_env_t *env)
2732
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
2733
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
2735
return !_networkRule->is_valid_sourceNames;
2739
* Set sourceNames to nill (currently the same as reset)
2741
axis2_status_t AXIS2_CALL
2742
adb_networkRule_set_sourceNames_nil(
2743
adb_networkRule_t* _networkRule,
2744
const axutil_env_t *env)
2746
return adb_networkRule_reset_sourceNames(_networkRule, env);
2751
* Check whether sourceNames is nill at i
2753
axis2_bool_t AXIS2_CALL
2754
adb_networkRule_is_sourceNames_nil_at(
2755
adb_networkRule_t* _networkRule,
2756
const axutil_env_t *env, int i)
2758
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
2759
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
2761
return (_networkRule->is_valid_sourceNames == AXIS2_FALSE ||
2762
NULL == _networkRule->property_sourceNames ||
2763
NULL == axutil_array_list_get(_networkRule->property_sourceNames, env, i));
2767
* Set sourceNames to nill at i
2769
axis2_status_t AXIS2_CALL
2770
adb_networkRule_set_sourceNames_nil_at(
2771
adb_networkRule_t* _networkRule,
2772
const axutil_env_t *env, int i)
2774
void *element = NULL;
2777
axis2_bool_t non_nil_exists = AXIS2_FALSE;
2781
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2782
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2784
if(_networkRule->property_sourceNames == NULL ||
2785
_networkRule->is_valid_sourceNames == AXIS2_FALSE)
2788
non_nil_exists = AXIS2_FALSE;
2792
size = axutil_array_list_size(_networkRule->property_sourceNames, env);
2793
for(j = 0, k = 0; j < size; j ++ )
2795
if(i == j) continue;
2796
if(NULL != axutil_array_list_get(_networkRule->property_sourceNames, env, i))
2799
non_nil_exists = AXIS2_TRUE;
2811
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNames is beinng set to be smaller than the specificed number of minOccurs(0)");
2812
return AXIS2_FAILURE;
2815
if(_networkRule->property_sourceNames == NULL)
2817
_networkRule->is_valid_sourceNames = AXIS2_FALSE;
2819
return AXIS2_SUCCESS;
2822
/* check whether there already exist an element */
2823
element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
2829
/* This is an unknown type or a primitive. Please free this manually*/
2837
_networkRule->is_valid_sourceNames = AXIS2_FALSE;
2838
axutil_array_list_set(_networkRule->property_sourceNames , env, i, NULL);
2839
return AXIS2_SUCCESS;
2844
axutil_array_list_set(_networkRule->property_sourceNames , env, i, NULL);
2846
return AXIS2_SUCCESS;
2853
* getter for userNames.
2855
axutil_array_list_t* AXIS2_CALL
2856
adb_networkRule_get_userNames(
2857
adb_networkRule_t* _networkRule,
2858
const axutil_env_t *env)
2861
AXIS2_ENV_CHECK(env, NULL);
2862
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
2865
return _networkRule->property_userNames;
2869
* setter for userNames
2871
axis2_status_t AXIS2_CALL
2872
adb_networkRule_set_userNames(
2873
adb_networkRule_t* _networkRule,
2874
const axutil_env_t *env,
2875
axutil_array_list_t* arg_userNames)
2880
axis2_bool_t non_nil_exists = AXIS2_FALSE;
2883
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2884
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2886
if(_networkRule->is_valid_userNames &&
2887
arg_userNames == _networkRule->property_userNames)
2890
return AXIS2_SUCCESS;
2894
size = axutil_array_list_size(arg_userNames, env);
2898
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "userNames has less than minOccurs(0)");
2899
return AXIS2_FAILURE;
2901
for(i = 0; i < size; i ++ )
2903
if(NULL != axutil_array_list_get(arg_userNames, env, i))
2905
non_nil_exists = AXIS2_TRUE;
2910
adb_networkRule_reset_userNames(_networkRule, env);
2913
if(NULL == arg_userNames)
2915
/* We are already done */
2916
return AXIS2_SUCCESS;
2918
_networkRule->property_userNames = arg_userNames;
2921
_networkRule->is_valid_userNames = AXIS2_TRUE;
2925
return AXIS2_SUCCESS;
2930
* Get ith element of userNames.
2932
axis2_char_t* AXIS2_CALL
2933
adb_networkRule_get_userNames_at(
2934
adb_networkRule_t* _networkRule,
2935
const axutil_env_t *env, int i)
2937
axis2_char_t* ret_val;
2940
AXIS2_ENV_CHECK(env, NULL);
2941
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
2944
if(_networkRule->property_userNames == NULL)
2946
return (axis2_char_t*)0;
2948
ret_val = (axis2_char_t*)axutil_array_list_get(_networkRule->property_userNames, env, i);
2955
* Set the ith element of userNames.
2957
axis2_status_t AXIS2_CALL
2958
adb_networkRule_set_userNames_at(
2959
adb_networkRule_t* _networkRule,
2960
const axutil_env_t *env, int i,
2961
const axis2_char_t* arg_userNames)
2963
void *element = NULL;
2967
axis2_bool_t non_nil_exists = AXIS2_FALSE;
2971
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2972
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
2974
if( _networkRule->is_valid_userNames &&
2975
_networkRule->property_userNames &&
2977
arg_userNames == (axis2_char_t*)axutil_array_list_get(_networkRule->property_userNames, env, i))
2981
return AXIS2_SUCCESS;
2985
if(NULL == arg_userNames)
2987
if(_networkRule->property_userNames != NULL)
2989
size = axutil_array_list_size(_networkRule->property_userNames, env);
2990
for(j = 0, k = 0; j < size; j ++ )
2992
if(i == j) continue;
2993
if(NULL != axutil_array_list_get(_networkRule->property_userNames, env, i))
2996
non_nil_exists = AXIS2_TRUE;
3007
non_nil_exists = AXIS2_TRUE;
3012
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of userNames is beinng set to be smaller than the specificed number of minOccurs(0)");
3013
return AXIS2_FAILURE;
3016
if(_networkRule->property_userNames == NULL)
3018
_networkRule->property_userNames = axutil_array_list_create(env, 10);
3021
/* check whether there already exist an element */
3022
element = axutil_array_list_get(_networkRule->property_userNames, env, i);
3028
/* This is an unknown type or a primitive. Please free this manually*/
3036
_networkRule->is_valid_userNames = AXIS2_FALSE;
3037
axutil_array_list_set(_networkRule->property_userNames , env, i, NULL);
3039
return AXIS2_SUCCESS;
3042
axutil_array_list_set(_networkRule->property_userNames , env, i, axutil_strdup(env, arg_userNames));
3043
_networkRule->is_valid_userNames = AXIS2_TRUE;
3045
return AXIS2_SUCCESS;
3051
axis2_status_t AXIS2_CALL
3052
adb_networkRule_add_userNames(
3053
adb_networkRule_t* _networkRule,
3054
const axutil_env_t *env,
3055
const axis2_char_t* arg_userNames)
3059
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3060
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3063
if(NULL == arg_userNames)
3066
return AXIS2_SUCCESS;
3071
if(_networkRule->property_userNames == NULL)
3073
_networkRule->property_userNames = axutil_array_list_create(env, 10);
3075
if(_networkRule->property_userNames == NULL)
3077
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for userNames");
3078
return AXIS2_FAILURE;
3082
axutil_array_list_add(_networkRule->property_userNames , env, axutil_strdup(env, arg_userNames));
3083
_networkRule->is_valid_userNames = AXIS2_TRUE;
3084
return AXIS2_SUCCESS;
3088
* Get the size of the userNames array.
3091
adb_networkRule_sizeof_userNames(
3092
adb_networkRule_t* _networkRule,
3093
const axutil_env_t *env)
3095
AXIS2_ENV_CHECK(env, -1);
3096
AXIS2_PARAM_CHECK(env->error, _networkRule, -1);
3097
if(_networkRule->property_userNames == NULL)
3101
return axutil_array_list_size(_networkRule->property_userNames, env);
3105
* remove the ith element, same as set_nil_at.
3107
axis2_status_t AXIS2_CALL
3108
adb_networkRule_remove_userNames_at(
3109
adb_networkRule_t* _networkRule,
3110
const axutil_env_t *env, int i)
3112
return adb_networkRule_set_userNames_nil_at(_networkRule, env, i);
3118
* resetter for userNames
3120
axis2_status_t AXIS2_CALL
3121
adb_networkRule_reset_userNames(
3122
adb_networkRule_t* _networkRule,
3123
const axutil_env_t *env)
3127
void *element = NULL;
3129
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3130
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3134
if (_networkRule->property_userNames != NULL)
3136
count = axutil_array_list_size(_networkRule->property_userNames, env);
3137
for(i = 0; i < count; i ++)
3139
element = axutil_array_list_get(_networkRule->property_userNames, env, i);
3147
AXIS2_FREE(env-> allocator, (axis2_char_t*)element);
3155
axutil_array_list_free(_networkRule->property_userNames, env);
3157
_networkRule->is_valid_userNames = AXIS2_FALSE;
3158
return AXIS2_SUCCESS;
3162
* Check whether userNames is nill
3164
axis2_bool_t AXIS2_CALL
3165
adb_networkRule_is_userNames_nil(
3166
adb_networkRule_t* _networkRule,
3167
const axutil_env_t *env)
3169
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
3170
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
3172
return !_networkRule->is_valid_userNames;
3176
* Set userNames to nill (currently the same as reset)
3178
axis2_status_t AXIS2_CALL
3179
adb_networkRule_set_userNames_nil(
3180
adb_networkRule_t* _networkRule,
3181
const axutil_env_t *env)
3183
return adb_networkRule_reset_userNames(_networkRule, env);
3188
* Check whether userNames is nill at i
3190
axis2_bool_t AXIS2_CALL
3191
adb_networkRule_is_userNames_nil_at(
3192
adb_networkRule_t* _networkRule,
3193
const axutil_env_t *env, int i)
3195
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
3196
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
3198
return (_networkRule->is_valid_userNames == AXIS2_FALSE ||
3199
NULL == _networkRule->property_userNames ||
3200
NULL == axutil_array_list_get(_networkRule->property_userNames, env, i));
3204
* Set userNames to nill at i
3206
axis2_status_t AXIS2_CALL
3207
adb_networkRule_set_userNames_nil_at(
3208
adb_networkRule_t* _networkRule,
3209
const axutil_env_t *env, int i)
3211
void *element = NULL;
3214
axis2_bool_t non_nil_exists = AXIS2_FALSE;
3218
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3219
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3221
if(_networkRule->property_userNames == NULL ||
3222
_networkRule->is_valid_userNames == AXIS2_FALSE)
3225
non_nil_exists = AXIS2_FALSE;
3229
size = axutil_array_list_size(_networkRule->property_userNames, env);
3230
for(j = 0, k = 0; j < size; j ++ )
3232
if(i == j) continue;
3233
if(NULL != axutil_array_list_get(_networkRule->property_userNames, env, i))
3236
non_nil_exists = AXIS2_TRUE;
3248
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of userNames is beinng set to be smaller than the specificed number of minOccurs(0)");
3249
return AXIS2_FAILURE;
3252
if(_networkRule->property_userNames == NULL)
3254
_networkRule->is_valid_userNames = AXIS2_FALSE;
3256
return AXIS2_SUCCESS;
3259
/* check whether there already exist an element */
3260
element = axutil_array_list_get(_networkRule->property_userNames, env, i);
3266
/* This is an unknown type or a primitive. Please free this manually*/
3274
_networkRule->is_valid_userNames = AXIS2_FALSE;
3275
axutil_array_list_set(_networkRule->property_userNames , env, i, NULL);
3276
return AXIS2_SUCCESS;
3281
axutil_array_list_set(_networkRule->property_userNames , env, i, NULL);
3283
return AXIS2_SUCCESS;
3290
* getter for sourceNets.
3292
axutil_array_list_t* AXIS2_CALL
3293
adb_networkRule_get_sourceNets(
3294
adb_networkRule_t* _networkRule,
3295
const axutil_env_t *env)
3298
AXIS2_ENV_CHECK(env, NULL);
3299
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
3302
return _networkRule->property_sourceNets;
3306
* setter for sourceNets
3308
axis2_status_t AXIS2_CALL
3309
adb_networkRule_set_sourceNets(
3310
adb_networkRule_t* _networkRule,
3311
const axutil_env_t *env,
3312
axutil_array_list_t* arg_sourceNets)
3317
axis2_bool_t non_nil_exists = AXIS2_FALSE;
3320
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3321
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3323
if(_networkRule->is_valid_sourceNets &&
3324
arg_sourceNets == _networkRule->property_sourceNets)
3327
return AXIS2_SUCCESS;
3331
size = axutil_array_list_size(arg_sourceNets, env);
3335
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNets has less than minOccurs(0)");
3336
return AXIS2_FAILURE;
3338
for(i = 0; i < size; i ++ )
3340
if(NULL != axutil_array_list_get(arg_sourceNets, env, i))
3342
non_nil_exists = AXIS2_TRUE;
3347
adb_networkRule_reset_sourceNets(_networkRule, env);
3350
if(NULL == arg_sourceNets)
3352
/* We are already done */
3353
return AXIS2_SUCCESS;
3355
_networkRule->property_sourceNets = arg_sourceNets;
3358
_networkRule->is_valid_sourceNets = AXIS2_TRUE;
3362
return AXIS2_SUCCESS;
3367
* Get ith element of sourceNets.
3369
axis2_char_t* AXIS2_CALL
3370
adb_networkRule_get_sourceNets_at(
3371
adb_networkRule_t* _networkRule,
3372
const axutil_env_t *env, int i)
3374
axis2_char_t* ret_val;
3377
AXIS2_ENV_CHECK(env, NULL);
3378
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
3381
if(_networkRule->property_sourceNets == NULL)
3383
return (axis2_char_t*)0;
3385
ret_val = (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNets, env, i);
3392
* Set the ith element of sourceNets.
3394
axis2_status_t AXIS2_CALL
3395
adb_networkRule_set_sourceNets_at(
3396
adb_networkRule_t* _networkRule,
3397
const axutil_env_t *env, int i,
3398
const axis2_char_t* arg_sourceNets)
3400
void *element = NULL;
3404
axis2_bool_t non_nil_exists = AXIS2_FALSE;
3408
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3409
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3411
if( _networkRule->is_valid_sourceNets &&
3412
_networkRule->property_sourceNets &&
3414
arg_sourceNets == (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNets, env, i))
3418
return AXIS2_SUCCESS;
3422
if(NULL == arg_sourceNets)
3424
if(_networkRule->property_sourceNets != NULL)
3426
size = axutil_array_list_size(_networkRule->property_sourceNets, env);
3427
for(j = 0, k = 0; j < size; j ++ )
3429
if(i == j) continue;
3430
if(NULL != axutil_array_list_get(_networkRule->property_sourceNets, env, i))
3433
non_nil_exists = AXIS2_TRUE;
3444
non_nil_exists = AXIS2_TRUE;
3449
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNets is beinng set to be smaller than the specificed number of minOccurs(0)");
3450
return AXIS2_FAILURE;
3453
if(_networkRule->property_sourceNets == NULL)
3455
_networkRule->property_sourceNets = axutil_array_list_create(env, 10);
3458
/* check whether there already exist an element */
3459
element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
3465
/* This is an unknown type or a primitive. Please free this manually*/
3473
_networkRule->is_valid_sourceNets = AXIS2_FALSE;
3474
axutil_array_list_set(_networkRule->property_sourceNets , env, i, NULL);
3476
return AXIS2_SUCCESS;
3479
axutil_array_list_set(_networkRule->property_sourceNets , env, i, axutil_strdup(env, arg_sourceNets));
3480
_networkRule->is_valid_sourceNets = AXIS2_TRUE;
3482
return AXIS2_SUCCESS;
3486
* Add to sourceNets.
3488
axis2_status_t AXIS2_CALL
3489
adb_networkRule_add_sourceNets(
3490
adb_networkRule_t* _networkRule,
3491
const axutil_env_t *env,
3492
const axis2_char_t* arg_sourceNets)
3496
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3497
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3500
if(NULL == arg_sourceNets)
3503
return AXIS2_SUCCESS;
3508
if(_networkRule->property_sourceNets == NULL)
3510
_networkRule->property_sourceNets = axutil_array_list_create(env, 10);
3512
if(_networkRule->property_sourceNets == NULL)
3514
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for sourceNets");
3515
return AXIS2_FAILURE;
3519
axutil_array_list_add(_networkRule->property_sourceNets , env, axutil_strdup(env, arg_sourceNets));
3520
_networkRule->is_valid_sourceNets = AXIS2_TRUE;
3521
return AXIS2_SUCCESS;
3525
* Get the size of the sourceNets array.
3528
adb_networkRule_sizeof_sourceNets(
3529
adb_networkRule_t* _networkRule,
3530
const axutil_env_t *env)
3532
AXIS2_ENV_CHECK(env, -1);
3533
AXIS2_PARAM_CHECK(env->error, _networkRule, -1);
3534
if(_networkRule->property_sourceNets == NULL)
3538
return axutil_array_list_size(_networkRule->property_sourceNets, env);
3542
* remove the ith element, same as set_nil_at.
3544
axis2_status_t AXIS2_CALL
3545
adb_networkRule_remove_sourceNets_at(
3546
adb_networkRule_t* _networkRule,
3547
const axutil_env_t *env, int i)
3549
return adb_networkRule_set_sourceNets_nil_at(_networkRule, env, i);
3555
* resetter for sourceNets
3557
axis2_status_t AXIS2_CALL
3558
adb_networkRule_reset_sourceNets(
3559
adb_networkRule_t* _networkRule,
3560
const axutil_env_t *env)
3564
void *element = NULL;
3566
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3567
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3571
if (_networkRule->property_sourceNets != NULL)
3573
count = axutil_array_list_size(_networkRule->property_sourceNets, env);
3574
for(i = 0; i < count; i ++)
3576
element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
3584
AXIS2_FREE(env-> allocator, (axis2_char_t*)element);
3592
axutil_array_list_free(_networkRule->property_sourceNets, env);
3594
_networkRule->is_valid_sourceNets = AXIS2_FALSE;
3595
return AXIS2_SUCCESS;
3599
* Check whether sourceNets is nill
3601
axis2_bool_t AXIS2_CALL
3602
adb_networkRule_is_sourceNets_nil(
3603
adb_networkRule_t* _networkRule,
3604
const axutil_env_t *env)
3606
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
3607
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
3609
return !_networkRule->is_valid_sourceNets;
3613
* Set sourceNets to nill (currently the same as reset)
3615
axis2_status_t AXIS2_CALL
3616
adb_networkRule_set_sourceNets_nil(
3617
adb_networkRule_t* _networkRule,
3618
const axutil_env_t *env)
3620
return adb_networkRule_reset_sourceNets(_networkRule, env);
3625
* Check whether sourceNets is nill at i
3627
axis2_bool_t AXIS2_CALL
3628
adb_networkRule_is_sourceNets_nil_at(
3629
adb_networkRule_t* _networkRule,
3630
const axutil_env_t *env, int i)
3632
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
3633
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
3635
return (_networkRule->is_valid_sourceNets == AXIS2_FALSE ||
3636
NULL == _networkRule->property_sourceNets ||
3637
NULL == axutil_array_list_get(_networkRule->property_sourceNets, env, i));
3641
* Set sourceNets to nill at i
3643
axis2_status_t AXIS2_CALL
3644
adb_networkRule_set_sourceNets_nil_at(
3645
adb_networkRule_t* _networkRule,
3646
const axutil_env_t *env, int i)
3648
void *element = NULL;
3651
axis2_bool_t non_nil_exists = AXIS2_FALSE;
3655
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3656
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3658
if(_networkRule->property_sourceNets == NULL ||
3659
_networkRule->is_valid_sourceNets == AXIS2_FALSE)
3662
non_nil_exists = AXIS2_FALSE;
3666
size = axutil_array_list_size(_networkRule->property_sourceNets, env);
3667
for(j = 0, k = 0; j < size; j ++ )
3669
if(i == j) continue;
3670
if(NULL != axutil_array_list_get(_networkRule->property_sourceNets, env, i))
3673
non_nil_exists = AXIS2_TRUE;
3685
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNets is beinng set to be smaller than the specificed number of minOccurs(0)");
3686
return AXIS2_FAILURE;
3689
if(_networkRule->property_sourceNets == NULL)
3691
_networkRule->is_valid_sourceNets = AXIS2_FALSE;
3693
return AXIS2_SUCCESS;
3696
/* check whether there already exist an element */
3697
element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
3703
/* This is an unknown type or a primitive. Please free this manually*/
3711
_networkRule->is_valid_sourceNets = AXIS2_FALSE;
3712
axutil_array_list_set(_networkRule->property_sourceNets , env, i, NULL);
3713
return AXIS2_SUCCESS;
3718
axutil_array_list_set(_networkRule->property_sourceNets , env, i, NULL);
3720
return AXIS2_SUCCESS;
3727
* getter for destUserName.
3729
axis2_char_t* AXIS2_CALL
3730
adb_networkRule_get_destUserName(
3731
adb_networkRule_t* _networkRule,
3732
const axutil_env_t *env)
3735
AXIS2_ENV_CHECK(env, NULL);
3736
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
3739
return _networkRule->property_destUserName;
3743
* setter for destUserName
3745
axis2_status_t AXIS2_CALL
3746
adb_networkRule_set_destUserName(
3747
adb_networkRule_t* _networkRule,
3748
const axutil_env_t *env,
3749
const axis2_char_t* arg_destUserName)
3753
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3754
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3756
if(_networkRule->is_valid_destUserName &&
3757
arg_destUserName == _networkRule->property_destUserName)
3760
return AXIS2_SUCCESS;
3763
adb_networkRule_reset_destUserName(_networkRule, env);
3766
if(NULL == arg_destUserName)
3768
/* We are already done */
3769
return AXIS2_SUCCESS;
3771
_networkRule->property_destUserName = (axis2_char_t *)axutil_strdup(env, arg_destUserName);
3772
if(NULL == _networkRule->property_destUserName)
3774
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for destUserName");
3775
return AXIS2_FAILURE;
3777
_networkRule->is_valid_destUserName = AXIS2_TRUE;
3779
return AXIS2_SUCCESS;
3785
* resetter for destUserName
3787
axis2_status_t AXIS2_CALL
3788
adb_networkRule_reset_destUserName(
3789
adb_networkRule_t* _networkRule,
3790
const axutil_env_t *env)
3794
void *element = NULL;
3796
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3797
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3803
if(_networkRule->property_destUserName != NULL)
3807
AXIS2_FREE(env-> allocator, _networkRule->property_destUserName);
3808
_networkRule->property_destUserName = NULL;
3813
_networkRule->is_valid_destUserName = AXIS2_FALSE;
3814
return AXIS2_SUCCESS;
3818
* Check whether destUserName is nill
3820
axis2_bool_t AXIS2_CALL
3821
adb_networkRule_is_destUserName_nil(
3822
adb_networkRule_t* _networkRule,
3823
const axutil_env_t *env)
3825
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
3826
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
3828
return !_networkRule->is_valid_destUserName;
3832
* Set destUserName to nill (currently the same as reset)
3834
axis2_status_t AXIS2_CALL
3835
adb_networkRule_set_destUserName_nil(
3836
adb_networkRule_t* _networkRule,
3837
const axutil_env_t *env)
3839
return adb_networkRule_reset_destUserName(_networkRule, env);
3845
* getter for destName.
3847
axis2_char_t* AXIS2_CALL
3848
adb_networkRule_get_destName(
3849
adb_networkRule_t* _networkRule,
3850
const axutil_env_t *env)
3853
AXIS2_ENV_CHECK(env, NULL);
3854
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
3857
return _networkRule->property_destName;
3861
* setter for destName
3863
axis2_status_t AXIS2_CALL
3864
adb_networkRule_set_destName(
3865
adb_networkRule_t* _networkRule,
3866
const axutil_env_t *env,
3867
const axis2_char_t* arg_destName)
3871
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3872
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3874
if(_networkRule->is_valid_destName &&
3875
arg_destName == _networkRule->property_destName)
3878
return AXIS2_SUCCESS;
3882
if(NULL == arg_destName)
3884
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "destName is being set to NULL, but it is not a nullable element");
3885
return AXIS2_FAILURE;
3887
adb_networkRule_reset_destName(_networkRule, env);
3890
if(NULL == arg_destName)
3892
/* We are already done */
3893
return AXIS2_SUCCESS;
3895
_networkRule->property_destName = (axis2_char_t *)axutil_strdup(env, arg_destName);
3896
if(NULL == _networkRule->property_destName)
3898
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for destName");
3899
return AXIS2_FAILURE;
3901
_networkRule->is_valid_destName = AXIS2_TRUE;
3903
return AXIS2_SUCCESS;
3909
* resetter for destName
3911
axis2_status_t AXIS2_CALL
3912
adb_networkRule_reset_destName(
3913
adb_networkRule_t* _networkRule,
3914
const axutil_env_t *env)
3918
void *element = NULL;
3920
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3921
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3927
if(_networkRule->property_destName != NULL)
3931
AXIS2_FREE(env-> allocator, _networkRule->property_destName);
3932
_networkRule->property_destName = NULL;
3937
_networkRule->is_valid_destName = AXIS2_FALSE;
3938
return AXIS2_SUCCESS;
3942
* Check whether destName is nill
3944
axis2_bool_t AXIS2_CALL
3945
adb_networkRule_is_destName_nil(
3946
adb_networkRule_t* _networkRule,
3947
const axutil_env_t *env)
3949
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
3950
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
3952
return !_networkRule->is_valid_destName;
3956
* Set destName to nill (currently the same as reset)
3958
axis2_status_t AXIS2_CALL
3959
adb_networkRule_set_destName_nil(
3960
adb_networkRule_t* _networkRule,
3961
const axutil_env_t *env)
3963
return adb_networkRule_reset_destName(_networkRule, env);
3969
* getter for protocol.
3971
axis2_char_t* AXIS2_CALL
3972
adb_networkRule_get_protocol(
3973
adb_networkRule_t* _networkRule,
3974
const axutil_env_t *env)
3977
AXIS2_ENV_CHECK(env, NULL);
3978
AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
3981
return _networkRule->property_protocol;
3985
* setter for protocol
3987
axis2_status_t AXIS2_CALL
3988
adb_networkRule_set_protocol(
3989
adb_networkRule_t* _networkRule,
3990
const axutil_env_t *env,
3991
const axis2_char_t* arg_protocol)
3995
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
3996
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
3998
if(_networkRule->is_valid_protocol &&
3999
arg_protocol == _networkRule->property_protocol)
4002
return AXIS2_SUCCESS;
4006
if(NULL == arg_protocol)
4008
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "protocol is being set to NULL, but it is not a nullable element");
4009
return AXIS2_FAILURE;
4011
adb_networkRule_reset_protocol(_networkRule, env);
4014
if(NULL == arg_protocol)
4016
/* We are already done */
4017
return AXIS2_SUCCESS;
4019
_networkRule->property_protocol = (axis2_char_t *)axutil_strdup(env, arg_protocol);
4020
if(NULL == _networkRule->property_protocol)
4022
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for protocol");
4023
return AXIS2_FAILURE;
4025
_networkRule->is_valid_protocol = AXIS2_TRUE;
4027
return AXIS2_SUCCESS;
4033
* resetter for protocol
4035
axis2_status_t AXIS2_CALL
4036
adb_networkRule_reset_protocol(
4037
adb_networkRule_t* _networkRule,
4038
const axutil_env_t *env)
4042
void *element = NULL;
4044
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
4045
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
4051
if(_networkRule->property_protocol != NULL)
4055
AXIS2_FREE(env-> allocator, _networkRule->property_protocol);
4056
_networkRule->property_protocol = NULL;
4061
_networkRule->is_valid_protocol = AXIS2_FALSE;
4062
return AXIS2_SUCCESS;
4066
* Check whether protocol is nill
4068
axis2_bool_t AXIS2_CALL
4069
adb_networkRule_is_protocol_nil(
4070
adb_networkRule_t* _networkRule,
4071
const axutil_env_t *env)
4073
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
4074
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
4076
return !_networkRule->is_valid_protocol;
4080
* Set protocol to nill (currently the same as reset)
4082
axis2_status_t AXIS2_CALL
4083
adb_networkRule_set_protocol_nil(
4084
adb_networkRule_t* _networkRule,
4085
const axutil_env_t *env)
4087
return adb_networkRule_reset_protocol(_networkRule, env);
4093
* getter for portRangeMin.
4096
adb_networkRule_get_portRangeMin(
4097
adb_networkRule_t* _networkRule,
4098
const axutil_env_t *env)
4101
AXIS2_ENV_CHECK(env, (int)0);
4102
AXIS2_PARAM_CHECK(env->error, _networkRule, (int)0);
4105
return _networkRule->property_portRangeMin;
4109
* setter for portRangeMin
4111
axis2_status_t AXIS2_CALL
4112
adb_networkRule_set_portRangeMin(
4113
adb_networkRule_t* _networkRule,
4114
const axutil_env_t *env,
4115
const int arg_portRangeMin)
4119
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
4120
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
4122
if(_networkRule->is_valid_portRangeMin &&
4123
arg_portRangeMin == _networkRule->property_portRangeMin)
4126
return AXIS2_SUCCESS;
4129
adb_networkRule_reset_portRangeMin(_networkRule, env);
4131
_networkRule->property_portRangeMin = arg_portRangeMin;
4132
_networkRule->is_valid_portRangeMin = AXIS2_TRUE;
4134
return AXIS2_SUCCESS;
4140
* resetter for portRangeMin
4142
axis2_status_t AXIS2_CALL
4143
adb_networkRule_reset_portRangeMin(
4144
adb_networkRule_t* _networkRule,
4145
const axutil_env_t *env)
4149
void *element = NULL;
4151
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
4152
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
4155
_networkRule->is_valid_portRangeMin = AXIS2_FALSE;
4156
return AXIS2_SUCCESS;
4160
* Check whether portRangeMin is nill
4162
axis2_bool_t AXIS2_CALL
4163
adb_networkRule_is_portRangeMin_nil(
4164
adb_networkRule_t* _networkRule,
4165
const axutil_env_t *env)
4167
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
4168
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
4170
return !_networkRule->is_valid_portRangeMin;
4174
* Set portRangeMin to nill (currently the same as reset)
4176
axis2_status_t AXIS2_CALL
4177
adb_networkRule_set_portRangeMin_nil(
4178
adb_networkRule_t* _networkRule,
4179
const axutil_env_t *env)
4181
return adb_networkRule_reset_portRangeMin(_networkRule, env);
4187
* getter for portRangeMax.
4190
adb_networkRule_get_portRangeMax(
4191
adb_networkRule_t* _networkRule,
4192
const axutil_env_t *env)
4195
AXIS2_ENV_CHECK(env, (int)0);
4196
AXIS2_PARAM_CHECK(env->error, _networkRule, (int)0);
4199
return _networkRule->property_portRangeMax;
4203
* setter for portRangeMax
4205
axis2_status_t AXIS2_CALL
4206
adb_networkRule_set_portRangeMax(
4207
adb_networkRule_t* _networkRule,
4208
const axutil_env_t *env,
4209
const int arg_portRangeMax)
4213
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
4214
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
4216
if(_networkRule->is_valid_portRangeMax &&
4217
arg_portRangeMax == _networkRule->property_portRangeMax)
4220
return AXIS2_SUCCESS;
4223
adb_networkRule_reset_portRangeMax(_networkRule, env);
4225
_networkRule->property_portRangeMax = arg_portRangeMax;
4226
_networkRule->is_valid_portRangeMax = AXIS2_TRUE;
4228
return AXIS2_SUCCESS;
4234
* resetter for portRangeMax
4236
axis2_status_t AXIS2_CALL
4237
adb_networkRule_reset_portRangeMax(
4238
adb_networkRule_t* _networkRule,
4239
const axutil_env_t *env)
4243
void *element = NULL;
4245
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
4246
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
4249
_networkRule->is_valid_portRangeMax = AXIS2_FALSE;
4250
return AXIS2_SUCCESS;
4254
* Check whether portRangeMax is nill
4256
axis2_bool_t AXIS2_CALL
4257
adb_networkRule_is_portRangeMax_nil(
4258
adb_networkRule_t* _networkRule,
4259
const axutil_env_t *env)
4261
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
4262
AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
4264
return !_networkRule->is_valid_portRangeMax;
4268
* Set portRangeMax to nill (currently the same as reset)
4270
axis2_status_t AXIS2_CALL
4271
adb_networkRule_set_portRangeMax_nil(
4272
adb_networkRule_t* _networkRule,
4273
const axutil_env_t *env)
4275
return adb_networkRule_reset_portRangeMax(_networkRule, env);