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_networkType.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_networkType
26
axis2_bool_t is_valid_vlan;
29
axis2_char_t* property_netName;
32
axis2_bool_t is_valid_netName;
35
axis2_char_t* property_userName;
38
axis2_bool_t is_valid_userName;
41
axutil_array_list_t* property_activeAddrs;
44
axis2_bool_t is_valid_activeAddrs;
51
/************************* Private Function prototypes ********************************/
54
axis2_status_t AXIS2_CALL
55
adb_networkType_set_vlan_nil(
56
adb_networkType_t* _networkType,
57
const axutil_env_t *env);
60
axis2_status_t AXIS2_CALL
61
adb_networkType_set_netName_nil(
62
adb_networkType_t* _networkType,
63
const axutil_env_t *env);
66
axis2_status_t AXIS2_CALL
67
adb_networkType_set_userName_nil(
68
adb_networkType_t* _networkType,
69
const axutil_env_t *env);
71
axis2_status_t AXIS2_CALL
72
adb_networkType_set_activeAddrs_nil_at(
73
adb_networkType_t* _networkType,
74
const axutil_env_t *env, int i);
77
axis2_status_t AXIS2_CALL
78
adb_networkType_set_activeAddrs_nil(
79
adb_networkType_t* _networkType,
80
const axutil_env_t *env);
84
/************************* Function Implmentations ********************************/
85
adb_networkType_t* AXIS2_CALL
86
adb_networkType_create(
87
const axutil_env_t *env)
89
adb_networkType_t *_networkType = NULL;
91
AXIS2_ENV_CHECK(env, NULL);
93
_networkType = (adb_networkType_t *) AXIS2_MALLOC(env->
94
allocator, sizeof(adb_networkType_t));
96
if(NULL == _networkType)
98
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
102
memset(_networkType, 0, sizeof(adb_networkType_t));
104
_networkType->is_valid_vlan = AXIS2_FALSE;
105
_networkType->property_netName = NULL;
106
_networkType->is_valid_netName = AXIS2_FALSE;
107
_networkType->property_userName = NULL;
108
_networkType->is_valid_userName = AXIS2_FALSE;
109
_networkType->is_valid_activeAddrs = AXIS2_FALSE;
115
axis2_status_t AXIS2_CALL
116
adb_networkType_free (
117
adb_networkType_t* _networkType,
118
const axutil_env_t *env)
123
void *element = NULL;
126
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
127
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
129
adb_networkType_reset_vlan(_networkType, env);
130
adb_networkType_reset_netName(_networkType, env);
131
adb_networkType_reset_userName(_networkType, env);
132
adb_networkType_reset_activeAddrs(_networkType, env);
137
AXIS2_FREE(env->allocator, _networkType);
140
return AXIS2_SUCCESS;
146
axis2_status_t AXIS2_CALL
147
adb_networkType_deserialize(
148
adb_networkType_t* _networkType,
149
const axutil_env_t *env,
150
axiom_node_t **dp_parent,
151
axis2_bool_t *dp_is_early_node_valid,
152
axis2_bool_t dont_care_minoccurs)
154
axiom_node_t *parent = *dp_parent;
156
axis2_status_t status = AXIS2_SUCCESS;
158
void *element = NULL;
160
axis2_char_t* text_value = NULL;
161
axutil_qname_t *qname = NULL;
164
axutil_array_list_t *arr_list = NULL;
166
int sequence_broken = 0;
167
axiom_node_t *tmp_node = NULL;
169
axutil_qname_t *element_qname = NULL;
171
axiom_node_t *first_node = NULL;
172
axis2_bool_t is_early_node_valid = AXIS2_TRUE;
173
axiom_node_t *current_node = NULL;
174
axiom_element_t *current_element = NULL;
176
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
177
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
181
while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
183
parent = axiom_node_get_next_sibling(parent, env);
187
/* This should be checked before everything */
188
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
189
"Failed in building adb object for networkType : "
190
"NULL elemenet can not be passed to deserialize");
191
return AXIS2_FAILURE;
195
first_node = axiom_node_get_first_child(parent, env);
201
* building vlan element
206
current_node = first_node;
207
is_early_node_valid = AXIS2_FALSE;
210
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
212
current_node = axiom_node_get_next_sibling(current_node, env);
214
if(current_node != NULL)
216
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
217
qname = axiom_element_get_qname(current_element, env, current_node);
220
element_qname = axutil_qname_create(env, "vlan", "http://eucalyptus.ucsb.edu/", NULL);
224
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
226
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
228
is_early_node_valid = AXIS2_TRUE;
232
text_value = axiom_element_get_text(current_element, env, current_node);
233
if(text_value != NULL)
235
status = adb_networkType_set_vlan(_networkType, env,
241
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element vlan");
242
status = AXIS2_FAILURE;
245
if(AXIS2_FAILURE == status)
247
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for vlan ");
250
axutil_qname_free(element_qname, env);
252
return AXIS2_FAILURE;
256
else if(!dont_care_minoccurs)
260
axutil_qname_free(element_qname, env);
262
/* this is not a nillable element*/
263
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element vlan missing");
264
return AXIS2_FAILURE;
269
axutil_qname_free(element_qname, env);
270
element_qname = NULL;
276
* building netName element
282
* because elements are ordered this works fine
286
if(current_node != NULL && is_early_node_valid)
288
current_node = axiom_node_get_next_sibling(current_node, env);
291
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
293
current_node = axiom_node_get_next_sibling(current_node, env);
295
if(current_node != NULL)
297
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
298
qname = axiom_element_get_qname(current_element, env, current_node);
302
is_early_node_valid = AXIS2_FALSE;
304
element_qname = axutil_qname_create(env, "netName", "http://eucalyptus.ucsb.edu/", NULL);
308
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
310
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
312
is_early_node_valid = AXIS2_TRUE;
316
text_value = axiom_element_get_text(current_element, env, current_node);
317
if(text_value != NULL)
319
status = adb_networkType_set_netName(_networkType, env,
326
* axis2_qname_t *qname = NULL;
327
* axiom_attribute_t *the_attri = NULL;
329
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
330
* the_attri = axiom_element_get_attribute(current_element, env, qname);
332
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
334
axiom_attribute_t *the_attri = NULL;
335
axis2_char_t *attrib_text = NULL;
336
axutil_hash_t *attribute_hash = NULL;
338
attribute_hash = axiom_element_get_all_attributes(current_element, env);
343
axutil_hash_index_t *hi;
347
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
349
axutil_hash_this(hi, &key, NULL, &val);
351
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
353
the_attri = (axiom_attribute_t*)val;
361
attrib_text = axiom_attribute_get_value(the_attri, env);
365
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
366
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
369
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
371
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element netName");
372
status = AXIS2_FAILURE;
376
/* after all, we found this is a empty string */
377
status = adb_networkType_set_netName(_networkType, env,
382
if(AXIS2_FAILURE == status)
384
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for netName ");
387
axutil_qname_free(element_qname, env);
389
return AXIS2_FAILURE;
393
else if(!dont_care_minoccurs)
397
axutil_qname_free(element_qname, env);
399
/* this is not a nillable element*/
400
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element netName missing");
401
return AXIS2_FAILURE;
406
axutil_qname_free(element_qname, env);
407
element_qname = NULL;
413
* building userName element
419
* because elements are ordered this works fine
423
if(current_node != NULL && is_early_node_valid)
425
current_node = axiom_node_get_next_sibling(current_node, env);
428
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
430
current_node = axiom_node_get_next_sibling(current_node, env);
432
if(current_node != NULL)
434
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
435
qname = axiom_element_get_qname(current_element, env, current_node);
439
is_early_node_valid = AXIS2_FALSE;
441
element_qname = axutil_qname_create(env, "userName", "http://eucalyptus.ucsb.edu/", NULL);
445
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
447
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
449
is_early_node_valid = AXIS2_TRUE;
453
text_value = axiom_element_get_text(current_element, env, current_node);
454
if(text_value != NULL)
456
status = adb_networkType_set_userName(_networkType, env,
463
* axis2_qname_t *qname = NULL;
464
* axiom_attribute_t *the_attri = NULL;
466
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
467
* the_attri = axiom_element_get_attribute(current_element, env, qname);
469
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
471
axiom_attribute_t *the_attri = NULL;
472
axis2_char_t *attrib_text = NULL;
473
axutil_hash_t *attribute_hash = NULL;
475
attribute_hash = axiom_element_get_all_attributes(current_element, env);
480
axutil_hash_index_t *hi;
484
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
486
axutil_hash_this(hi, &key, NULL, &val);
488
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
490
the_attri = (axiom_attribute_t*)val;
498
attrib_text = axiom_attribute_get_value(the_attri, env);
502
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
503
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
506
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
508
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element userName");
509
status = AXIS2_FAILURE;
513
/* after all, we found this is a empty string */
514
status = adb_networkType_set_userName(_networkType, env,
519
if(AXIS2_FAILURE == status)
521
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for userName ");
524
axutil_qname_free(element_qname, env);
526
return AXIS2_FAILURE;
530
else if(!dont_care_minoccurs)
534
axutil_qname_free(element_qname, env);
536
/* this is not a nillable element*/
537
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element userName missing");
538
return AXIS2_FAILURE;
543
axutil_qname_free(element_qname, env);
544
element_qname = NULL;
548
* building activeAddrs array
550
arr_list = axutil_array_list_create(env, 10);
555
* building activeAddrs element
560
element_qname = axutil_qname_create(env, "activeAddrs", "http://eucalyptus.ucsb.edu/", NULL);
563
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;)
566
if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
568
current_node =axiom_node_get_next_sibling(current_node, env);
569
is_early_node_valid = AXIS2_FALSE;
573
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
574
qname = axiom_element_get_qname(current_element, env, current_node);
576
if (axutil_qname_equals(element_qname, env, qname))
579
is_early_node_valid = AXIS2_TRUE;
582
text_value = axiom_element_get_text(current_element, env, current_node);
583
if(text_value != NULL)
585
/* we keeps ints in arrays from their pointers */
586
element = AXIS2_MALLOC(env-> allocator, sizeof(int));
587
(*(int*)element) = atoi(text_value);
588
axutil_array_list_add_at(arr_list, env, i, element);
593
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element activeAddrs");
594
status = AXIS2_FAILURE;
597
if(AXIS2_FAILURE == status)
599
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for activeAddrs ");
602
axutil_qname_free(element_qname, env);
606
axutil_array_list_free(arr_list, env);
608
return AXIS2_FAILURE;
612
current_node = axiom_node_get_next_sibling(current_node, env);
616
is_early_node_valid = AXIS2_FALSE;
625
/* found element out of order */
626
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "activeAddrs (@minOccurs = '0') only have %d elements", i);
629
axutil_qname_free(element_qname, env);
633
axutil_array_list_free(arr_list, env);
635
return AXIS2_FAILURE;
639
if(0 == axutil_array_list_size(arr_list,env))
641
axutil_array_list_free(arr_list, env);
645
status = adb_networkType_set_activeAddrs(_networkType, env,
652
axutil_qname_free(element_qname, env);
653
element_qname = NULL;
659
axis2_bool_t AXIS2_CALL
660
adb_networkType_is_particle()
669
adb_networkType_declare_parent_namespaces(
670
adb_networkType_t* _networkType,
671
const axutil_env_t *env, axiom_element_t *parent_element,
672
axutil_hash_t *namespaces, int *next_ns_index)
675
/* Here this is an empty function, Nothing to declare */
681
axiom_node_t* AXIS2_CALL
682
adb_networkType_serialize(
683
adb_networkType_t* _networkType,
684
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)
688
axis2_char_t *string_to_stream;
691
axiom_node_t *current_node = NULL;
696
axiom_namespace_t *ns1 = NULL;
698
axis2_char_t *qname_uri = NULL;
699
axis2_char_t *qname_prefix = NULL;
700
axis2_char_t *p_prefix = NULL;
701
axis2_bool_t ns_already_defined;
705
void *element = NULL;
707
axis2_char_t text_value_1[64];
709
axis2_char_t *text_value_2;
710
axis2_char_t *text_value_2_temp;
712
axis2_char_t *text_value_3;
713
axis2_char_t *text_value_3_temp;
715
axis2_char_t text_value_4[64];
717
axis2_char_t *start_input_str = NULL;
718
axis2_char_t *end_input_str = NULL;
719
unsigned int start_input_str_len = 0;
720
unsigned int end_input_str_len = 0;
723
axiom_data_source_t *data_source = NULL;
724
axutil_stream_t *stream = NULL;
728
AXIS2_ENV_CHECK(env, NULL);
729
AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
732
current_node = parent;
733
data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
736
stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
740
if(!parent_tag_closed)
743
string_to_stream = ">";
744
axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
749
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
751
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
752
sprintf(p_prefix, "n%d", (*next_ns_index)++);
753
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
755
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
756
"http://eucalyptus.ucsb.edu/",
761
if (!_networkType->is_valid_vlan)
765
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property vlan");
771
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
772
(4 + axutil_strlen(p_prefix) +
773
axutil_strlen("vlan")));
775
/* axutil_strlen("<:>") + 1 = 4 */
776
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
777
(5 + axutil_strlen(p_prefix) + axutil_strlen("vlan")));
778
/* axutil_strlen("</:>") + 1 = 5 */
786
* parsing vlan element
791
sprintf(start_input_str, "<%s%svlan>",
792
p_prefix?p_prefix:"",
793
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
795
start_input_str_len = axutil_strlen(start_input_str);
796
sprintf(end_input_str, "</%s%svlan>",
797
p_prefix?p_prefix:"",
798
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
799
end_input_str_len = axutil_strlen(end_input_str);
801
sprintf (text_value_1, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _networkType->property_vlan);
803
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
805
axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
807
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
810
AXIS2_FREE(env->allocator,start_input_str);
811
AXIS2_FREE(env->allocator,end_input_str);
815
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
817
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
818
sprintf(p_prefix, "n%d", (*next_ns_index)++);
819
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
821
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
822
"http://eucalyptus.ucsb.edu/",
827
if (!_networkType->is_valid_netName)
831
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property netName");
837
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
838
(4 + axutil_strlen(p_prefix) +
839
axutil_strlen("netName")));
841
/* axutil_strlen("<:>") + 1 = 4 */
842
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
843
(5 + axutil_strlen(p_prefix) + axutil_strlen("netName")));
844
/* axutil_strlen("</:>") + 1 = 5 */
852
* parsing netName element
857
sprintf(start_input_str, "<%s%snetName>",
858
p_prefix?p_prefix:"",
859
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
861
start_input_str_len = axutil_strlen(start_input_str);
862
sprintf(end_input_str, "</%s%snetName>",
863
p_prefix?p_prefix:"",
864
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
865
end_input_str_len = axutil_strlen(end_input_str);
867
text_value_2 = _networkType->property_netName;
869
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
872
text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
873
if (text_value_2_temp)
875
axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp));
876
AXIS2_FREE(env->allocator, text_value_2_temp);
880
axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
883
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
886
AXIS2_FREE(env->allocator,start_input_str);
887
AXIS2_FREE(env->allocator,end_input_str);
891
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
893
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
894
sprintf(p_prefix, "n%d", (*next_ns_index)++);
895
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
897
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
898
"http://eucalyptus.ucsb.edu/",
903
if (!_networkType->is_valid_userName)
907
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property userName");
913
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
914
(4 + axutil_strlen(p_prefix) +
915
axutil_strlen("userName")));
917
/* axutil_strlen("<:>") + 1 = 4 */
918
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
919
(5 + axutil_strlen(p_prefix) + axutil_strlen("userName")));
920
/* axutil_strlen("</:>") + 1 = 5 */
928
* parsing userName element
933
sprintf(start_input_str, "<%s%suserName>",
934
p_prefix?p_prefix:"",
935
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
937
start_input_str_len = axutil_strlen(start_input_str);
938
sprintf(end_input_str, "</%s%suserName>",
939
p_prefix?p_prefix:"",
940
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
941
end_input_str_len = axutil_strlen(end_input_str);
943
text_value_3 = _networkType->property_userName;
945
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
948
text_value_3_temp = axutil_xml_quote_string(env, text_value_3, AXIS2_TRUE);
949
if (text_value_3_temp)
951
axutil_stream_write(stream, env, text_value_3_temp, axutil_strlen(text_value_3_temp));
952
AXIS2_FREE(env->allocator, text_value_3_temp);
956
axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
959
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
962
AXIS2_FREE(env->allocator,start_input_str);
963
AXIS2_FREE(env->allocator,end_input_str);
967
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
969
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
970
sprintf(p_prefix, "n%d", (*next_ns_index)++);
971
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
973
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
974
"http://eucalyptus.ucsb.edu/",
979
if (!_networkType->is_valid_activeAddrs)
982
/* no need to complain for minoccurs=0 element */
988
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
989
(4 + axutil_strlen(p_prefix) +
990
axutil_strlen("activeAddrs")));
992
/* axutil_strlen("<:>") + 1 = 4 */
993
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
994
(5 + axutil_strlen(p_prefix) + axutil_strlen("activeAddrs")));
995
/* axutil_strlen("</:>") + 1 = 5 */
1002
* Parsing activeAddrs array
1004
if (_networkType->property_activeAddrs != NULL)
1007
sprintf(start_input_str, "<%s%sactiveAddrs>",
1008
p_prefix?p_prefix:"",
1009
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1011
start_input_str_len = axutil_strlen(start_input_str);
1013
sprintf(end_input_str, "</%s%sactiveAddrs>",
1014
p_prefix?p_prefix:"",
1015
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1016
end_input_str_len = axutil_strlen(end_input_str);
1018
count = axutil_array_list_size(_networkType->property_activeAddrs, env);
1019
for(i = 0; i < count; i ++)
1021
element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
1030
* parsing activeAddrs element
1035
sprintf (text_value_4, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, *((int*)element));
1037
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1039
axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
1041
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1047
AXIS2_FREE(env->allocator,start_input_str);
1048
AXIS2_FREE(env->allocator,end_input_str);
1063
adb_networkType_get_vlan(
1064
adb_networkType_t* _networkType,
1065
const axutil_env_t *env)
1068
AXIS2_ENV_CHECK(env, (int)0);
1069
AXIS2_PARAM_CHECK(env->error, _networkType, (int)0);
1072
return _networkType->property_vlan;
1078
axis2_status_t AXIS2_CALL
1079
adb_networkType_set_vlan(
1080
adb_networkType_t* _networkType,
1081
const axutil_env_t *env,
1086
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1087
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1089
if(_networkType->is_valid_vlan &&
1090
arg_vlan == _networkType->property_vlan)
1093
return AXIS2_SUCCESS;
1096
adb_networkType_reset_vlan(_networkType, env);
1098
_networkType->property_vlan = arg_vlan;
1099
_networkType->is_valid_vlan = AXIS2_TRUE;
1101
return AXIS2_SUCCESS;
1109
axis2_status_t AXIS2_CALL
1110
adb_networkType_reset_vlan(
1111
adb_networkType_t* _networkType,
1112
const axutil_env_t *env)
1116
void *element = NULL;
1118
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1119
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1122
_networkType->is_valid_vlan = AXIS2_FALSE;
1123
return AXIS2_SUCCESS;
1127
* Check whether vlan is nill
1129
axis2_bool_t AXIS2_CALL
1130
adb_networkType_is_vlan_nil(
1131
adb_networkType_t* _networkType,
1132
const axutil_env_t *env)
1134
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1135
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
1137
return !_networkType->is_valid_vlan;
1141
* Set vlan to nill (currently the same as reset)
1143
axis2_status_t AXIS2_CALL
1144
adb_networkType_set_vlan_nil(
1145
adb_networkType_t* _networkType,
1146
const axutil_env_t *env)
1148
return adb_networkType_reset_vlan(_networkType, env);
1154
* getter for netName.
1156
axis2_char_t* AXIS2_CALL
1157
adb_networkType_get_netName(
1158
adb_networkType_t* _networkType,
1159
const axutil_env_t *env)
1162
AXIS2_ENV_CHECK(env, NULL);
1163
AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
1166
return _networkType->property_netName;
1170
* setter for netName
1172
axis2_status_t AXIS2_CALL
1173
adb_networkType_set_netName(
1174
adb_networkType_t* _networkType,
1175
const axutil_env_t *env,
1176
const axis2_char_t* arg_netName)
1180
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1181
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1183
if(_networkType->is_valid_netName &&
1184
arg_netName == _networkType->property_netName)
1187
return AXIS2_SUCCESS;
1191
if(NULL == arg_netName)
1193
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "netName is being set to NULL, but it is not a nullable element");
1194
return AXIS2_FAILURE;
1196
adb_networkType_reset_netName(_networkType, env);
1199
if(NULL == arg_netName)
1201
/* We are already done */
1202
return AXIS2_SUCCESS;
1204
_networkType->property_netName = (axis2_char_t *)axutil_strdup(env, arg_netName);
1205
if(NULL == _networkType->property_netName)
1207
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for netName");
1208
return AXIS2_FAILURE;
1210
_networkType->is_valid_netName = AXIS2_TRUE;
1212
return AXIS2_SUCCESS;
1218
* resetter for netName
1220
axis2_status_t AXIS2_CALL
1221
adb_networkType_reset_netName(
1222
adb_networkType_t* _networkType,
1223
const axutil_env_t *env)
1227
void *element = NULL;
1229
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1230
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1236
if(_networkType->property_netName != NULL)
1240
AXIS2_FREE(env-> allocator, _networkType->property_netName);
1241
_networkType->property_netName = NULL;
1246
_networkType->is_valid_netName = AXIS2_FALSE;
1247
return AXIS2_SUCCESS;
1251
* Check whether netName is nill
1253
axis2_bool_t AXIS2_CALL
1254
adb_networkType_is_netName_nil(
1255
adb_networkType_t* _networkType,
1256
const axutil_env_t *env)
1258
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1259
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
1261
return !_networkType->is_valid_netName;
1265
* Set netName to nill (currently the same as reset)
1267
axis2_status_t AXIS2_CALL
1268
adb_networkType_set_netName_nil(
1269
adb_networkType_t* _networkType,
1270
const axutil_env_t *env)
1272
return adb_networkType_reset_netName(_networkType, env);
1278
* getter for userName.
1280
axis2_char_t* AXIS2_CALL
1281
adb_networkType_get_userName(
1282
adb_networkType_t* _networkType,
1283
const axutil_env_t *env)
1286
AXIS2_ENV_CHECK(env, NULL);
1287
AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
1290
return _networkType->property_userName;
1294
* setter for userName
1296
axis2_status_t AXIS2_CALL
1297
adb_networkType_set_userName(
1298
adb_networkType_t* _networkType,
1299
const axutil_env_t *env,
1300
const axis2_char_t* arg_userName)
1304
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1305
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1307
if(_networkType->is_valid_userName &&
1308
arg_userName == _networkType->property_userName)
1311
return AXIS2_SUCCESS;
1315
if(NULL == arg_userName)
1317
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "userName is being set to NULL, but it is not a nullable element");
1318
return AXIS2_FAILURE;
1320
adb_networkType_reset_userName(_networkType, env);
1323
if(NULL == arg_userName)
1325
/* We are already done */
1326
return AXIS2_SUCCESS;
1328
_networkType->property_userName = (axis2_char_t *)axutil_strdup(env, arg_userName);
1329
if(NULL == _networkType->property_userName)
1331
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for userName");
1332
return AXIS2_FAILURE;
1334
_networkType->is_valid_userName = AXIS2_TRUE;
1336
return AXIS2_SUCCESS;
1342
* resetter for userName
1344
axis2_status_t AXIS2_CALL
1345
adb_networkType_reset_userName(
1346
adb_networkType_t* _networkType,
1347
const axutil_env_t *env)
1351
void *element = NULL;
1353
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1354
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1360
if(_networkType->property_userName != NULL)
1364
AXIS2_FREE(env-> allocator, _networkType->property_userName);
1365
_networkType->property_userName = NULL;
1370
_networkType->is_valid_userName = AXIS2_FALSE;
1371
return AXIS2_SUCCESS;
1375
* Check whether userName is nill
1377
axis2_bool_t AXIS2_CALL
1378
adb_networkType_is_userName_nil(
1379
adb_networkType_t* _networkType,
1380
const axutil_env_t *env)
1382
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1383
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
1385
return !_networkType->is_valid_userName;
1389
* Set userName to nill (currently the same as reset)
1391
axis2_status_t AXIS2_CALL
1392
adb_networkType_set_userName_nil(
1393
adb_networkType_t* _networkType,
1394
const axutil_env_t *env)
1396
return adb_networkType_reset_userName(_networkType, env);
1402
* getter for activeAddrs.
1404
axutil_array_list_t* AXIS2_CALL
1405
adb_networkType_get_activeAddrs(
1406
adb_networkType_t* _networkType,
1407
const axutil_env_t *env)
1410
AXIS2_ENV_CHECK(env, NULL);
1411
AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
1414
return _networkType->property_activeAddrs;
1418
* setter for activeAddrs
1420
axis2_status_t AXIS2_CALL
1421
adb_networkType_set_activeAddrs(
1422
adb_networkType_t* _networkType,
1423
const axutil_env_t *env,
1424
axutil_array_list_t* arg_activeAddrs)
1429
axis2_bool_t non_nil_exists = AXIS2_FALSE;
1432
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1433
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1435
if(_networkType->is_valid_activeAddrs &&
1436
arg_activeAddrs == _networkType->property_activeAddrs)
1439
return AXIS2_SUCCESS;
1443
size = axutil_array_list_size(arg_activeAddrs, env);
1447
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "activeAddrs has less than minOccurs(0)");
1448
return AXIS2_FAILURE;
1450
for(i = 0; i < size; i ++ )
1452
if(NULL != axutil_array_list_get(arg_activeAddrs, env, i))
1454
non_nil_exists = AXIS2_TRUE;
1459
adb_networkType_reset_activeAddrs(_networkType, env);
1462
if(NULL == arg_activeAddrs)
1464
/* We are already done */
1465
return AXIS2_SUCCESS;
1467
_networkType->property_activeAddrs = arg_activeAddrs;
1470
_networkType->is_valid_activeAddrs = AXIS2_TRUE;
1474
return AXIS2_SUCCESS;
1479
* Get ith element of activeAddrs.
1482
adb_networkType_get_activeAddrs_at(
1483
adb_networkType_t* _networkType,
1484
const axutil_env_t *env, int i)
1489
AXIS2_ENV_CHECK(env, (int)0);
1490
AXIS2_PARAM_CHECK(env->error, _networkType, (int)0);
1493
if(_networkType->property_activeAddrs == NULL)
1497
ret_val = (int*)axutil_array_list_get(_networkType->property_activeAddrs, env, i);
1508
* Set the ith element of activeAddrs.
1510
axis2_status_t AXIS2_CALL
1511
adb_networkType_set_activeAddrs_at(
1512
adb_networkType_t* _networkType,
1513
const axutil_env_t *env, int i,
1514
const int arg_activeAddrs)
1516
void *element = NULL;
1520
axis2_bool_t non_nil_exists = AXIS2_FALSE;
1522
int* ptr_param_activeAddrs;
1525
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1526
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1528
if( _networkType->is_valid_activeAddrs &&
1529
_networkType->property_activeAddrs &&
1531
arg_activeAddrs == *((int*)axutil_array_list_get(_networkType->property_activeAddrs, env, i)))
1535
return AXIS2_SUCCESS;
1539
non_nil_exists = AXIS2_TRUE; /* no way to check for nill for each elements for primitive types */
1543
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of activeAddrs is beinng set to be smaller than the specificed number of minOccurs(0)");
1544
return AXIS2_FAILURE;
1547
if(_networkType->property_activeAddrs == NULL)
1549
_networkType->property_activeAddrs = axutil_array_list_create(env, 10);
1552
/* check whether there already exist an element */
1553
element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
1560
/* we keep primtives as pointers in arrasy, so need to free them */
1561
AXIS2_FREE(env-> allocator, element);
1569
_networkType->is_valid_activeAddrs = AXIS2_FALSE;
1570
axutil_array_list_set(_networkType->property_activeAddrs , env, i, NULL);
1572
return AXIS2_SUCCESS;
1574
ptr_param_activeAddrs = (int*)
1575
AXIS2_MALLOC(env->allocator, sizeof(int));
1576
if(_networkType->property_activeAddrs == NULL)
1578
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for new value of activeAddrs");
1579
return AXIS2_FAILURE;
1582
*ptr_param_activeAddrs = arg_activeAddrs;
1583
axutil_array_list_set(_networkType->property_activeAddrs , env, i, ptr_param_activeAddrs);
1584
_networkType->is_valid_activeAddrs = AXIS2_TRUE;
1586
return AXIS2_SUCCESS;
1590
* Add to activeAddrs.
1592
axis2_status_t AXIS2_CALL
1593
adb_networkType_add_activeAddrs(
1594
adb_networkType_t* _networkType,
1595
const axutil_env_t *env,
1596
const int arg_activeAddrs)
1598
int* ptr_param_activeAddrs;
1601
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1602
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1606
if(_networkType->property_activeAddrs == NULL)
1608
_networkType->property_activeAddrs = axutil_array_list_create(env, 10);
1610
if(_networkType->property_activeAddrs == NULL)
1612
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for activeAddrs");
1613
return AXIS2_FAILURE;
1616
ptr_param_activeAddrs = (int*)
1617
AXIS2_MALLOC(env->allocator, sizeof(int));
1618
if(_networkType->property_activeAddrs == NULL)
1620
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for new value of activeAddrs");
1621
return AXIS2_FAILURE;
1624
*ptr_param_activeAddrs = arg_activeAddrs;
1625
axutil_array_list_add(_networkType->property_activeAddrs , env, ptr_param_activeAddrs);
1626
_networkType->is_valid_activeAddrs = AXIS2_TRUE;
1627
return AXIS2_SUCCESS;
1631
* Get the size of the activeAddrs array.
1634
adb_networkType_sizeof_activeAddrs(
1635
adb_networkType_t* _networkType,
1636
const axutil_env_t *env)
1638
AXIS2_ENV_CHECK(env, -1);
1639
AXIS2_PARAM_CHECK(env->error, _networkType, -1);
1640
if(_networkType->property_activeAddrs == NULL)
1644
return axutil_array_list_size(_networkType->property_activeAddrs, env);
1648
* remove the ith element, same as set_nil_at.
1650
axis2_status_t AXIS2_CALL
1651
adb_networkType_remove_activeAddrs_at(
1652
adb_networkType_t* _networkType,
1653
const axutil_env_t *env, int i)
1655
return adb_networkType_set_activeAddrs_nil_at(_networkType, env, i);
1661
* resetter for activeAddrs
1663
axis2_status_t AXIS2_CALL
1664
adb_networkType_reset_activeAddrs(
1665
adb_networkType_t* _networkType,
1666
const axutil_env_t *env)
1670
void *element = NULL;
1672
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1673
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1677
if (_networkType->property_activeAddrs != NULL)
1679
count = axutil_array_list_size(_networkType->property_activeAddrs, env);
1680
for(i = 0; i < count; i ++)
1682
element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
1691
/* we keep primtives as pointers in arrasy, so need to free them */
1692
AXIS2_FREE(env-> allocator, element);
1700
axutil_array_list_free(_networkType->property_activeAddrs, env);
1702
_networkType->is_valid_activeAddrs = AXIS2_FALSE;
1703
return AXIS2_SUCCESS;
1707
* Check whether activeAddrs is nill
1709
axis2_bool_t AXIS2_CALL
1710
adb_networkType_is_activeAddrs_nil(
1711
adb_networkType_t* _networkType,
1712
const axutil_env_t *env)
1714
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1715
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
1717
return !_networkType->is_valid_activeAddrs;
1721
* Set activeAddrs to nill (currently the same as reset)
1723
axis2_status_t AXIS2_CALL
1724
adb_networkType_set_activeAddrs_nil(
1725
adb_networkType_t* _networkType,
1726
const axutil_env_t *env)
1728
return adb_networkType_reset_activeAddrs(_networkType, env);
1733
* Check whether activeAddrs is nill at i
1735
axis2_bool_t AXIS2_CALL
1736
adb_networkType_is_activeAddrs_nil_at(
1737
adb_networkType_t* _networkType,
1738
const axutil_env_t *env, int i)
1740
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1741
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
1743
return (_networkType->is_valid_activeAddrs == AXIS2_FALSE ||
1744
NULL == _networkType->property_activeAddrs ||
1745
NULL == axutil_array_list_get(_networkType->property_activeAddrs, env, i));
1749
* Set activeAddrs to nill at i
1751
axis2_status_t AXIS2_CALL
1752
adb_networkType_set_activeAddrs_nil_at(
1753
adb_networkType_t* _networkType,
1754
const axutil_env_t *env, int i)
1756
void *element = NULL;
1759
axis2_bool_t non_nil_exists = AXIS2_FALSE;
1763
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1764
AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
1766
if(_networkType->property_activeAddrs == NULL ||
1767
_networkType->is_valid_activeAddrs == AXIS2_FALSE)
1770
non_nil_exists = AXIS2_FALSE;
1774
size = axutil_array_list_size(_networkType->property_activeAddrs, env);
1775
for(j = 0, k = 0; j < size; j ++ )
1777
if(i == j) continue;
1778
if(NULL != axutil_array_list_get(_networkType->property_activeAddrs, env, i))
1781
non_nil_exists = AXIS2_TRUE;
1793
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of activeAddrs is beinng set to be smaller than the specificed number of minOccurs(0)");
1794
return AXIS2_FAILURE;
1797
if(_networkType->property_activeAddrs == NULL)
1799
_networkType->is_valid_activeAddrs = AXIS2_FALSE;
1801
return AXIS2_SUCCESS;
1804
/* check whether there already exist an element */
1805
element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
1812
/* we keep primtives as pointers in arrasy, so need to free them */
1813
AXIS2_FREE(env-> allocator, element);
1821
_networkType->is_valid_activeAddrs = AXIS2_FALSE;
1822
axutil_array_list_set(_networkType->property_activeAddrs , env, i, NULL);
1823
return AXIS2_SUCCESS;
1828
axutil_array_list_set(_networkType->property_activeAddrs , env, i, NULL);
1830
return AXIS2_SUCCESS;