4
* adb_describeResourcesType.c
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_describeResourcesType.h"
13
* This type was generated from the piece of schema that had
14
* name = describeResourcesType
15
* Namespace URI = http://eucalyptus.ucsb.edu/
16
* Namespace Prefix = ns1
21
struct adb_describeResourcesType
23
axis2_char_t* property_correlationId;
26
axis2_bool_t is_valid_correlationId;
29
axis2_char_t* property_userId;
32
axis2_bool_t is_valid_userId;
35
axis2_char_t* property_statusMessage;
38
axis2_bool_t is_valid_statusMessage;
41
axis2_bool_t property_return;
44
axis2_bool_t is_valid_return;
47
axutil_array_list_t* property_instanceTypes;
50
axis2_bool_t is_valid_instanceTypes;
57
/************************* Private Function prototypes ********************************/
60
axis2_status_t AXIS2_CALL
61
adb_describeResourcesType_set_correlationId_nil(
62
adb_describeResourcesType_t* _describeResourcesType,
63
const axutil_env_t *env);
66
axis2_status_t AXIS2_CALL
67
adb_describeResourcesType_set_userId_nil(
68
adb_describeResourcesType_t* _describeResourcesType,
69
const axutil_env_t *env);
72
axis2_status_t AXIS2_CALL
73
adb_describeResourcesType_set_return_nil(
74
adb_describeResourcesType_t* _describeResourcesType,
75
const axutil_env_t *env);
77
axis2_status_t AXIS2_CALL
78
adb_describeResourcesType_set_instanceTypes_nil_at(
79
adb_describeResourcesType_t* _describeResourcesType,
80
const axutil_env_t *env, int i);
83
axis2_status_t AXIS2_CALL
84
adb_describeResourcesType_set_instanceTypes_nil(
85
adb_describeResourcesType_t* _describeResourcesType,
86
const axutil_env_t *env);
90
/************************* Function Implmentations ********************************/
91
adb_describeResourcesType_t* AXIS2_CALL
92
adb_describeResourcesType_create(
93
const axutil_env_t *env)
95
adb_describeResourcesType_t *_describeResourcesType = NULL;
97
AXIS2_ENV_CHECK(env, NULL);
99
_describeResourcesType = (adb_describeResourcesType_t *) AXIS2_MALLOC(env->
100
allocator, sizeof(adb_describeResourcesType_t));
102
if(NULL == _describeResourcesType)
104
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
108
memset(_describeResourcesType, 0, sizeof(adb_describeResourcesType_t));
110
_describeResourcesType->property_correlationId = NULL;
111
_describeResourcesType->is_valid_correlationId = AXIS2_FALSE;
112
_describeResourcesType->property_userId = NULL;
113
_describeResourcesType->is_valid_userId = AXIS2_FALSE;
114
_describeResourcesType->property_statusMessage = NULL;
115
_describeResourcesType->is_valid_statusMessage = AXIS2_FALSE;
116
_describeResourcesType->is_valid_return = AXIS2_FALSE;
117
_describeResourcesType->property_instanceTypes = NULL;
118
_describeResourcesType->is_valid_instanceTypes = AXIS2_FALSE;
121
return _describeResourcesType;
124
axis2_status_t AXIS2_CALL
125
adb_describeResourcesType_free (
126
adb_describeResourcesType_t* _describeResourcesType,
127
const axutil_env_t *env)
132
void *element = NULL;
135
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
136
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
138
adb_describeResourcesType_reset_correlationId(_describeResourcesType, env);
139
adb_describeResourcesType_reset_userId(_describeResourcesType, env);
140
adb_describeResourcesType_reset_statusMessage(_describeResourcesType, env);
141
adb_describeResourcesType_reset_return(_describeResourcesType, env);
142
adb_describeResourcesType_reset_instanceTypes(_describeResourcesType, env);
145
if(_describeResourcesType)
147
AXIS2_FREE(env->allocator, _describeResourcesType);
148
_describeResourcesType = NULL;
150
return AXIS2_SUCCESS;
156
axis2_status_t AXIS2_CALL
157
adb_describeResourcesType_deserialize(
158
adb_describeResourcesType_t* _describeResourcesType,
159
const axutil_env_t *env,
160
axiom_node_t **dp_parent,
161
axis2_bool_t *dp_is_early_node_valid,
162
axis2_bool_t dont_care_minoccurs)
164
axiom_node_t *parent = *dp_parent;
166
axis2_status_t status = AXIS2_SUCCESS;
168
void *element = NULL;
170
axis2_char_t* text_value = NULL;
171
axutil_qname_t *qname = NULL;
174
axutil_array_list_t *arr_list = NULL;
176
int sequence_broken = 0;
177
axiom_node_t *tmp_node = NULL;
179
axutil_qname_t *element_qname = NULL;
181
axiom_node_t *first_node = NULL;
182
axis2_bool_t is_early_node_valid = AXIS2_TRUE;
183
axiom_node_t *current_node = NULL;
184
axiom_element_t *current_element = NULL;
186
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
187
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
191
while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
193
parent = axiom_node_get_next_sibling(parent, env);
197
/* This should be checked before everything */
198
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
199
"Failed in building adb object for describeResourcesType : "
200
"NULL elemenet can not be passed to deserialize");
201
return AXIS2_FAILURE;
205
first_node = axiom_node_get_first_child(parent, env);
211
* building correlationId element
216
current_node = first_node;
217
is_early_node_valid = AXIS2_FALSE;
220
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
222
current_node = axiom_node_get_next_sibling(current_node, env);
224
if(current_node != NULL)
226
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
227
qname = axiom_element_get_qname(current_element, env, current_node);
230
element_qname = axutil_qname_create(env, "correlationId", "http://eucalyptus.ucsb.edu/", NULL);
234
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
236
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
238
is_early_node_valid = AXIS2_TRUE;
242
text_value = axiom_element_get_text(current_element, env, current_node);
243
if(text_value != NULL)
245
status = adb_describeResourcesType_set_correlationId(_describeResourcesType, env,
252
* axis2_qname_t *qname = NULL;
253
* axiom_attribute_t *the_attri = NULL;
255
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
256
* the_attri = axiom_element_get_attribute(current_element, env, qname);
258
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
260
axiom_attribute_t *the_attri = NULL;
261
axis2_char_t *attrib_text = NULL;
262
axutil_hash_t *attribute_hash = NULL;
264
attribute_hash = axiom_element_get_all_attributes(current_element, env);
269
axutil_hash_index_t *hi;
273
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
275
axutil_hash_this(hi, &key, NULL, &val);
277
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
279
the_attri = (axiom_attribute_t*)val;
287
attrib_text = axiom_attribute_get_value(the_attri, env);
291
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
292
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
295
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
297
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element correlationId");
298
status = AXIS2_FAILURE;
302
/* after all, we found this is a empty string */
303
status = adb_describeResourcesType_set_correlationId(_describeResourcesType, env,
308
if(AXIS2_FAILURE == status)
310
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for correlationId ");
313
axutil_qname_free(element_qname, env);
315
return AXIS2_FAILURE;
321
axutil_qname_free(element_qname, env);
322
element_qname = NULL;
328
* building userId element
334
* because elements are ordered this works fine
338
if(current_node != NULL && is_early_node_valid)
340
current_node = axiom_node_get_next_sibling(current_node, env);
343
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
345
current_node = axiom_node_get_next_sibling(current_node, env);
347
if(current_node != NULL)
349
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
350
qname = axiom_element_get_qname(current_element, env, current_node);
354
is_early_node_valid = AXIS2_FALSE;
356
element_qname = axutil_qname_create(env, "userId", "http://eucalyptus.ucsb.edu/", NULL);
360
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
362
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
364
is_early_node_valid = AXIS2_TRUE;
368
text_value = axiom_element_get_text(current_element, env, current_node);
369
if(text_value != NULL)
371
status = adb_describeResourcesType_set_userId(_describeResourcesType, env,
378
* axis2_qname_t *qname = NULL;
379
* axiom_attribute_t *the_attri = NULL;
381
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
382
* the_attri = axiom_element_get_attribute(current_element, env, qname);
384
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
386
axiom_attribute_t *the_attri = NULL;
387
axis2_char_t *attrib_text = NULL;
388
axutil_hash_t *attribute_hash = NULL;
390
attribute_hash = axiom_element_get_all_attributes(current_element, env);
395
axutil_hash_index_t *hi;
399
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
401
axutil_hash_this(hi, &key, NULL, &val);
403
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
405
the_attri = (axiom_attribute_t*)val;
413
attrib_text = axiom_attribute_get_value(the_attri, env);
417
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
418
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
421
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
423
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element userId");
424
status = AXIS2_FAILURE;
428
/* after all, we found this is a empty string */
429
status = adb_describeResourcesType_set_userId(_describeResourcesType, env,
434
if(AXIS2_FAILURE == status)
436
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for userId ");
439
axutil_qname_free(element_qname, env);
441
return AXIS2_FAILURE;
447
axutil_qname_free(element_qname, env);
448
element_qname = NULL;
454
* building statusMessage element
460
* because elements are ordered this works fine
464
if(current_node != NULL && is_early_node_valid)
466
current_node = axiom_node_get_next_sibling(current_node, env);
469
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
471
current_node = axiom_node_get_next_sibling(current_node, env);
473
if(current_node != NULL)
475
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
476
qname = axiom_element_get_qname(current_element, env, current_node);
480
is_early_node_valid = AXIS2_FALSE;
482
element_qname = axutil_qname_create(env, "statusMessage", "http://eucalyptus.ucsb.edu/", NULL);
486
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
488
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
490
is_early_node_valid = AXIS2_TRUE;
494
text_value = axiom_element_get_text(current_element, env, current_node);
495
if(text_value != NULL)
497
status = adb_describeResourcesType_set_statusMessage(_describeResourcesType, env,
501
if(AXIS2_FAILURE == status)
503
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for statusMessage ");
506
axutil_qname_free(element_qname, env);
508
return AXIS2_FAILURE;
514
axutil_qname_free(element_qname, env);
515
element_qname = NULL;
521
* building return element
527
* because elements are ordered this works fine
531
if(current_node != NULL && is_early_node_valid)
533
current_node = axiom_node_get_next_sibling(current_node, env);
536
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
538
current_node = axiom_node_get_next_sibling(current_node, env);
540
if(current_node != NULL)
542
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
543
qname = axiom_element_get_qname(current_element, env, current_node);
547
is_early_node_valid = AXIS2_FALSE;
549
element_qname = axutil_qname_create(env, "return", "http://eucalyptus.ucsb.edu/", NULL);
553
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
555
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
557
is_early_node_valid = AXIS2_TRUE;
561
text_value = axiom_element_get_text(current_element, env, current_node);
562
if(text_value != NULL)
564
if (!axutil_strcasecmp(text_value , "true"))
566
status = adb_describeResourcesType_set_return(_describeResourcesType, env,
571
status = adb_describeResourcesType_set_return(_describeResourcesType, env,
578
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element return");
579
status = AXIS2_FAILURE;
582
if(AXIS2_FAILURE == status)
584
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for return ");
587
axutil_qname_free(element_qname, env);
589
return AXIS2_FAILURE;
595
axutil_qname_free(element_qname, env);
596
element_qname = NULL;
600
* building instanceTypes array
602
arr_list = axutil_array_list_create(env, 10);
607
* building instanceTypes element
612
element_qname = axutil_qname_create(env, "instanceTypes", "http://eucalyptus.ucsb.edu/", NULL);
615
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;)
618
if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
620
current_node =axiom_node_get_next_sibling(current_node, env);
621
is_early_node_valid = AXIS2_FALSE;
625
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
626
qname = axiom_element_get_qname(current_element, env, current_node);
628
if (axutil_qname_equals(element_qname, env, qname))
631
is_early_node_valid = AXIS2_TRUE;
634
element = (void*)adb_virtualMachineType_create(env);
636
status = adb_virtualMachineType_deserialize((adb_virtualMachineType_t*)element, env,
637
¤t_node, &is_early_node_valid, AXIS2_FALSE);
639
if(AXIS2_FAILURE == status)
641
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in building element instanceTypes ");
645
axutil_array_list_add_at(arr_list, env, i, element);
648
if(AXIS2_FAILURE == status)
650
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for instanceTypes ");
653
axutil_qname_free(element_qname, env);
657
axutil_array_list_free(arr_list, env);
659
return AXIS2_FAILURE;
663
current_node = axiom_node_get_next_sibling(current_node, env);
667
is_early_node_valid = AXIS2_FALSE;
676
/* found element out of order */
677
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "instanceTypes (@minOccurs = '1') only have %d elements", i);
680
axutil_qname_free(element_qname, env);
684
axutil_array_list_free(arr_list, env);
686
return AXIS2_FAILURE;
690
if(0 == axutil_array_list_size(arr_list,env))
692
axutil_array_list_free(arr_list, env);
696
status = adb_describeResourcesType_set_instanceTypes(_describeResourcesType, env,
703
axutil_qname_free(element_qname, env);
704
element_qname = NULL;
710
axis2_bool_t AXIS2_CALL
711
adb_describeResourcesType_is_particle()
720
adb_describeResourcesType_declare_parent_namespaces(
721
adb_describeResourcesType_t* _describeResourcesType,
722
const axutil_env_t *env, axiom_element_t *parent_element,
723
axutil_hash_t *namespaces, int *next_ns_index)
726
/* Here this is an empty function, Nothing to declare */
732
axiom_node_t* AXIS2_CALL
733
adb_describeResourcesType_serialize(
734
adb_describeResourcesType_t* _describeResourcesType,
735
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)
739
axis2_char_t *string_to_stream;
742
axiom_node_t *current_node = NULL;
747
axiom_namespace_t *ns1 = NULL;
749
axis2_char_t *qname_uri = NULL;
750
axis2_char_t *qname_prefix = NULL;
751
axis2_char_t *p_prefix = NULL;
752
axis2_bool_t ns_already_defined;
756
void *element = NULL;
758
axis2_char_t *text_value_1;
759
axis2_char_t *text_value_1_temp;
761
axis2_char_t *text_value_2;
762
axis2_char_t *text_value_2_temp;
764
axis2_char_t *text_value_3;
765
axis2_char_t *text_value_3_temp;
767
axis2_char_t text_value_4[64];
769
axis2_char_t text_value_5[64];
771
axis2_char_t *start_input_str = NULL;
772
axis2_char_t *end_input_str = NULL;
773
unsigned int start_input_str_len = 0;
774
unsigned int end_input_str_len = 0;
777
axiom_data_source_t *data_source = NULL;
778
axutil_stream_t *stream = NULL;
782
AXIS2_ENV_CHECK(env, NULL);
783
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, NULL);
786
current_node = parent;
787
data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
790
stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
794
if(!parent_tag_closed)
797
string_to_stream = ">";
798
axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
803
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
805
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
806
sprintf(p_prefix, "n%d", (*next_ns_index)++);
807
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
809
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
810
"http://eucalyptus.ucsb.edu/",
815
if (!_describeResourcesType->is_valid_correlationId)
818
/* no need to complain for minoccurs=0 element */
824
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
825
(4 + axutil_strlen(p_prefix) +
826
axutil_strlen("correlationId")));
828
/* axutil_strlen("<:>") + 1 = 4 */
829
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
830
(5 + axutil_strlen(p_prefix) + axutil_strlen("correlationId")));
831
/* axutil_strlen("</:>") + 1 = 5 */
839
* parsing correlationId element
844
sprintf(start_input_str, "<%s%scorrelationId>",
845
p_prefix?p_prefix:"",
846
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
848
start_input_str_len = axutil_strlen(start_input_str);
849
sprintf(end_input_str, "</%s%scorrelationId>",
850
p_prefix?p_prefix:"",
851
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
852
end_input_str_len = axutil_strlen(end_input_str);
854
text_value_1 = _describeResourcesType->property_correlationId;
856
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
859
text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE);
860
if (text_value_1_temp)
862
axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp));
863
AXIS2_FREE(env->allocator, text_value_1_temp);
867
axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
870
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
873
AXIS2_FREE(env->allocator,start_input_str);
874
AXIS2_FREE(env->allocator,end_input_str);
878
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
880
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
881
sprintf(p_prefix, "n%d", (*next_ns_index)++);
882
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
884
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
885
"http://eucalyptus.ucsb.edu/",
890
if (!_describeResourcesType->is_valid_userId)
893
/* no need to complain for minoccurs=0 element */
899
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
900
(4 + axutil_strlen(p_prefix) +
901
axutil_strlen("userId")));
903
/* axutil_strlen("<:>") + 1 = 4 */
904
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
905
(5 + axutil_strlen(p_prefix) + axutil_strlen("userId")));
906
/* axutil_strlen("</:>") + 1 = 5 */
914
* parsing userId element
919
sprintf(start_input_str, "<%s%suserId>",
920
p_prefix?p_prefix:"",
921
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
923
start_input_str_len = axutil_strlen(start_input_str);
924
sprintf(end_input_str, "</%s%suserId>",
925
p_prefix?p_prefix:"",
926
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
927
end_input_str_len = axutil_strlen(end_input_str);
929
text_value_2 = _describeResourcesType->property_userId;
931
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
934
text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
935
if (text_value_2_temp)
937
axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp));
938
AXIS2_FREE(env->allocator, text_value_2_temp);
942
axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
945
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
948
AXIS2_FREE(env->allocator,start_input_str);
949
AXIS2_FREE(env->allocator,end_input_str);
953
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
955
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
956
sprintf(p_prefix, "n%d", (*next_ns_index)++);
957
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
959
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
960
"http://eucalyptus.ucsb.edu/",
965
if (!_describeResourcesType->is_valid_statusMessage)
968
/* no need to complain for minoccurs=0 element */
974
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
975
(4 + axutil_strlen(p_prefix) +
976
axutil_strlen("statusMessage")));
978
/* axutil_strlen("<:>") + 1 = 4 */
979
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
980
(5 + axutil_strlen(p_prefix) + axutil_strlen("statusMessage")));
981
/* axutil_strlen("</:>") + 1 = 5 */
989
* parsing statusMessage element
994
sprintf(start_input_str, "<%s%sstatusMessage>",
995
p_prefix?p_prefix:"",
996
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
998
start_input_str_len = axutil_strlen(start_input_str);
999
sprintf(end_input_str, "</%s%sstatusMessage>",
1000
p_prefix?p_prefix:"",
1001
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1002
end_input_str_len = axutil_strlen(end_input_str);
1004
text_value_3 = _describeResourcesType->property_statusMessage;
1006
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1009
text_value_3_temp = axutil_xml_quote_string(env, text_value_3, AXIS2_TRUE);
1010
if (text_value_3_temp)
1012
axutil_stream_write(stream, env, text_value_3_temp, axutil_strlen(text_value_3_temp));
1013
AXIS2_FREE(env->allocator, text_value_3_temp);
1017
axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
1020
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1023
AXIS2_FREE(env->allocator,start_input_str);
1024
AXIS2_FREE(env->allocator,end_input_str);
1028
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1030
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1031
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1032
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1034
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1035
"http://eucalyptus.ucsb.edu/",
1040
if (!_describeResourcesType->is_valid_return)
1043
/* no need to complain for minoccurs=0 element */
1049
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1050
(4 + axutil_strlen(p_prefix) +
1051
axutil_strlen("return")));
1053
/* axutil_strlen("<:>") + 1 = 4 */
1054
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1055
(5 + axutil_strlen(p_prefix) + axutil_strlen("return")));
1056
/* axutil_strlen("</:>") + 1 = 5 */
1064
* parsing return element
1069
sprintf(start_input_str, "<%s%sreturn>",
1070
p_prefix?p_prefix:"",
1071
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1073
start_input_str_len = axutil_strlen(start_input_str);
1074
sprintf(end_input_str, "</%s%sreturn>",
1075
p_prefix?p_prefix:"",
1076
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1077
end_input_str_len = axutil_strlen(end_input_str);
1079
strcpy(text_value_4, (_describeResourcesType->property_return)?"true":"false");
1081
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1083
axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
1085
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1088
AXIS2_FREE(env->allocator,start_input_str);
1089
AXIS2_FREE(env->allocator,end_input_str);
1093
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
1095
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
1096
sprintf(p_prefix, "n%d", (*next_ns_index)++);
1097
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
1099
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
1100
"http://eucalyptus.ucsb.edu/",
1105
if (!_describeResourcesType->is_valid_instanceTypes)
1109
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property instanceTypes");
1115
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1116
(4 + axutil_strlen(p_prefix) +
1117
axutil_strlen("instanceTypes")));
1119
/* axutil_strlen("<:>") + 1 = 4 */
1120
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
1121
(5 + axutil_strlen(p_prefix) + axutil_strlen("instanceTypes")));
1122
/* axutil_strlen("</:>") + 1 = 5 */
1129
* Parsing instanceTypes array
1131
if (_describeResourcesType->property_instanceTypes != NULL)
1135
sprintf(start_input_str, "<%s%sinstanceTypes",
1136
p_prefix?p_prefix:"",
1137
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1139
start_input_str_len = axutil_strlen(start_input_str);
1141
sprintf(end_input_str, "</%s%sinstanceTypes>",
1142
p_prefix?p_prefix:"",
1143
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
1144
end_input_str_len = axutil_strlen(end_input_str);
1146
count = axutil_array_list_size(_describeResourcesType->property_instanceTypes, env);
1147
for(i = 0; i < count; i ++)
1149
element = axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i);
1158
* parsing instanceTypes element
1163
if(!adb_virtualMachineType_is_particle())
1165
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
1168
adb_virtualMachineType_serialize((adb_virtualMachineType_t*)element,
1169
env, current_node, parent_element,
1170
adb_virtualMachineType_is_particle() || AXIS2_FALSE, namespaces, next_ns_index);
1172
if(!adb_virtualMachineType_is_particle())
1174
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
1181
AXIS2_FREE(env->allocator,start_input_str);
1182
AXIS2_FREE(env->allocator,end_input_str);
1194
* getter for correlationId.
1196
axis2_char_t* AXIS2_CALL
1197
adb_describeResourcesType_get_correlationId(
1198
adb_describeResourcesType_t* _describeResourcesType,
1199
const axutil_env_t *env)
1202
AXIS2_ENV_CHECK(env, NULL);
1203
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, NULL);
1206
return _describeResourcesType->property_correlationId;
1210
* setter for correlationId
1212
axis2_status_t AXIS2_CALL
1213
adb_describeResourcesType_set_correlationId(
1214
adb_describeResourcesType_t* _describeResourcesType,
1215
const axutil_env_t *env,
1216
const axis2_char_t* arg_correlationId)
1220
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1221
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1223
if(_describeResourcesType->is_valid_correlationId &&
1224
arg_correlationId == _describeResourcesType->property_correlationId)
1227
return AXIS2_SUCCESS;
1230
adb_describeResourcesType_reset_correlationId(_describeResourcesType, env);
1233
if(NULL == arg_correlationId)
1235
/* We are already done */
1236
return AXIS2_SUCCESS;
1238
_describeResourcesType->property_correlationId = (axis2_char_t *)axutil_strdup(env, arg_correlationId);
1239
if(NULL == _describeResourcesType->property_correlationId)
1241
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for correlationId");
1242
return AXIS2_FAILURE;
1244
_describeResourcesType->is_valid_correlationId = AXIS2_TRUE;
1246
return AXIS2_SUCCESS;
1252
* resetter for correlationId
1254
axis2_status_t AXIS2_CALL
1255
adb_describeResourcesType_reset_correlationId(
1256
adb_describeResourcesType_t* _describeResourcesType,
1257
const axutil_env_t *env)
1261
void *element = NULL;
1263
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1264
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1270
if(_describeResourcesType->property_correlationId != NULL)
1274
AXIS2_FREE(env-> allocator, _describeResourcesType->property_correlationId);
1275
_describeResourcesType->property_correlationId = NULL;
1280
_describeResourcesType->is_valid_correlationId = AXIS2_FALSE;
1281
return AXIS2_SUCCESS;
1285
* Check whether correlationId is nill
1287
axis2_bool_t AXIS2_CALL
1288
adb_describeResourcesType_is_correlationId_nil(
1289
adb_describeResourcesType_t* _describeResourcesType,
1290
const axutil_env_t *env)
1292
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1293
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_TRUE);
1295
return !_describeResourcesType->is_valid_correlationId;
1299
* Set correlationId to nill (currently the same as reset)
1301
axis2_status_t AXIS2_CALL
1302
adb_describeResourcesType_set_correlationId_nil(
1303
adb_describeResourcesType_t* _describeResourcesType,
1304
const axutil_env_t *env)
1306
return adb_describeResourcesType_reset_correlationId(_describeResourcesType, env);
1312
* getter for userId.
1314
axis2_char_t* AXIS2_CALL
1315
adb_describeResourcesType_get_userId(
1316
adb_describeResourcesType_t* _describeResourcesType,
1317
const axutil_env_t *env)
1320
AXIS2_ENV_CHECK(env, NULL);
1321
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, NULL);
1324
return _describeResourcesType->property_userId;
1330
axis2_status_t AXIS2_CALL
1331
adb_describeResourcesType_set_userId(
1332
adb_describeResourcesType_t* _describeResourcesType,
1333
const axutil_env_t *env,
1334
const axis2_char_t* arg_userId)
1338
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1339
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1341
if(_describeResourcesType->is_valid_userId &&
1342
arg_userId == _describeResourcesType->property_userId)
1345
return AXIS2_SUCCESS;
1348
adb_describeResourcesType_reset_userId(_describeResourcesType, env);
1351
if(NULL == arg_userId)
1353
/* We are already done */
1354
return AXIS2_SUCCESS;
1356
_describeResourcesType->property_userId = (axis2_char_t *)axutil_strdup(env, arg_userId);
1357
if(NULL == _describeResourcesType->property_userId)
1359
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for userId");
1360
return AXIS2_FAILURE;
1362
_describeResourcesType->is_valid_userId = AXIS2_TRUE;
1364
return AXIS2_SUCCESS;
1370
* resetter for userId
1372
axis2_status_t AXIS2_CALL
1373
adb_describeResourcesType_reset_userId(
1374
adb_describeResourcesType_t* _describeResourcesType,
1375
const axutil_env_t *env)
1379
void *element = NULL;
1381
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1382
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1388
if(_describeResourcesType->property_userId != NULL)
1392
AXIS2_FREE(env-> allocator, _describeResourcesType->property_userId);
1393
_describeResourcesType->property_userId = NULL;
1398
_describeResourcesType->is_valid_userId = AXIS2_FALSE;
1399
return AXIS2_SUCCESS;
1403
* Check whether userId is nill
1405
axis2_bool_t AXIS2_CALL
1406
adb_describeResourcesType_is_userId_nil(
1407
adb_describeResourcesType_t* _describeResourcesType,
1408
const axutil_env_t *env)
1410
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1411
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_TRUE);
1413
return !_describeResourcesType->is_valid_userId;
1417
* Set userId to nill (currently the same as reset)
1419
axis2_status_t AXIS2_CALL
1420
adb_describeResourcesType_set_userId_nil(
1421
adb_describeResourcesType_t* _describeResourcesType,
1422
const axutil_env_t *env)
1424
return adb_describeResourcesType_reset_userId(_describeResourcesType, env);
1430
* getter for statusMessage.
1432
axis2_char_t* AXIS2_CALL
1433
adb_describeResourcesType_get_statusMessage(
1434
adb_describeResourcesType_t* _describeResourcesType,
1435
const axutil_env_t *env)
1438
AXIS2_ENV_CHECK(env, NULL);
1439
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, NULL);
1442
return _describeResourcesType->property_statusMessage;
1446
* setter for statusMessage
1448
axis2_status_t AXIS2_CALL
1449
adb_describeResourcesType_set_statusMessage(
1450
adb_describeResourcesType_t* _describeResourcesType,
1451
const axutil_env_t *env,
1452
const axis2_char_t* arg_statusMessage)
1456
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1457
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1459
if(_describeResourcesType->is_valid_statusMessage &&
1460
arg_statusMessage == _describeResourcesType->property_statusMessage)
1463
return AXIS2_SUCCESS;
1466
adb_describeResourcesType_reset_statusMessage(_describeResourcesType, env);
1469
if(NULL == arg_statusMessage)
1471
/* We are already done */
1472
return AXIS2_SUCCESS;
1474
_describeResourcesType->property_statusMessage = (axis2_char_t *)axutil_strdup(env, arg_statusMessage);
1475
if(NULL == _describeResourcesType->property_statusMessage)
1477
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for statusMessage");
1478
return AXIS2_FAILURE;
1480
_describeResourcesType->is_valid_statusMessage = AXIS2_TRUE;
1482
return AXIS2_SUCCESS;
1488
* resetter for statusMessage
1490
axis2_status_t AXIS2_CALL
1491
adb_describeResourcesType_reset_statusMessage(
1492
adb_describeResourcesType_t* _describeResourcesType,
1493
const axutil_env_t *env)
1497
void *element = NULL;
1499
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1500
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1506
if(_describeResourcesType->property_statusMessage != NULL)
1510
AXIS2_FREE(env-> allocator, _describeResourcesType->property_statusMessage);
1511
_describeResourcesType->property_statusMessage = NULL;
1516
_describeResourcesType->is_valid_statusMessage = AXIS2_FALSE;
1517
return AXIS2_SUCCESS;
1521
* Check whether statusMessage is nill
1523
axis2_bool_t AXIS2_CALL
1524
adb_describeResourcesType_is_statusMessage_nil(
1525
adb_describeResourcesType_t* _describeResourcesType,
1526
const axutil_env_t *env)
1528
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1529
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_TRUE);
1531
return !_describeResourcesType->is_valid_statusMessage;
1535
* Set statusMessage to nill (currently the same as reset)
1537
axis2_status_t AXIS2_CALL
1538
adb_describeResourcesType_set_statusMessage_nil(
1539
adb_describeResourcesType_t* _describeResourcesType,
1540
const axutil_env_t *env)
1542
return adb_describeResourcesType_reset_statusMessage(_describeResourcesType, env);
1548
* getter for return.
1550
axis2_bool_t AXIS2_CALL
1551
adb_describeResourcesType_get_return(
1552
adb_describeResourcesType_t* _describeResourcesType,
1553
const axutil_env_t *env)
1556
AXIS2_ENV_CHECK(env, (axis2_bool_t)0);
1557
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, (axis2_bool_t)0);
1560
return _describeResourcesType->property_return;
1566
axis2_status_t AXIS2_CALL
1567
adb_describeResourcesType_set_return(
1568
adb_describeResourcesType_t* _describeResourcesType,
1569
const axutil_env_t *env,
1570
axis2_bool_t arg_return)
1574
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1575
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1577
if(_describeResourcesType->is_valid_return &&
1578
arg_return == _describeResourcesType->property_return)
1581
return AXIS2_SUCCESS;
1584
adb_describeResourcesType_reset_return(_describeResourcesType, env);
1586
_describeResourcesType->property_return = arg_return;
1587
_describeResourcesType->is_valid_return = AXIS2_TRUE;
1589
return AXIS2_SUCCESS;
1595
* resetter for return
1597
axis2_status_t AXIS2_CALL
1598
adb_describeResourcesType_reset_return(
1599
adb_describeResourcesType_t* _describeResourcesType,
1600
const axutil_env_t *env)
1604
void *element = NULL;
1606
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1607
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1610
_describeResourcesType->is_valid_return = AXIS2_FALSE;
1611
return AXIS2_SUCCESS;
1615
* Check whether return is nill
1617
axis2_bool_t AXIS2_CALL
1618
adb_describeResourcesType_is_return_nil(
1619
adb_describeResourcesType_t* _describeResourcesType,
1620
const axutil_env_t *env)
1622
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1623
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_TRUE);
1625
return !_describeResourcesType->is_valid_return;
1629
* Set return to nill (currently the same as reset)
1631
axis2_status_t AXIS2_CALL
1632
adb_describeResourcesType_set_return_nil(
1633
adb_describeResourcesType_t* _describeResourcesType,
1634
const axutil_env_t *env)
1636
return adb_describeResourcesType_reset_return(_describeResourcesType, env);
1642
* getter for instanceTypes.
1644
axutil_array_list_t* AXIS2_CALL
1645
adb_describeResourcesType_get_instanceTypes(
1646
adb_describeResourcesType_t* _describeResourcesType,
1647
const axutil_env_t *env)
1650
AXIS2_ENV_CHECK(env, NULL);
1651
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, NULL);
1654
return _describeResourcesType->property_instanceTypes;
1658
* setter for instanceTypes
1660
axis2_status_t AXIS2_CALL
1661
adb_describeResourcesType_set_instanceTypes(
1662
adb_describeResourcesType_t* _describeResourcesType,
1663
const axutil_env_t *env,
1664
axutil_array_list_t* arg_instanceTypes)
1669
axis2_bool_t non_nil_exists = AXIS2_FALSE;
1672
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1673
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1675
if(_describeResourcesType->is_valid_instanceTypes &&
1676
arg_instanceTypes == _describeResourcesType->property_instanceTypes)
1679
return AXIS2_SUCCESS;
1683
size = axutil_array_list_size(arg_instanceTypes, env);
1687
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "instanceTypes has less than minOccurs(1)");
1688
return AXIS2_FAILURE;
1690
for(i = 0; i < size; i ++ )
1692
if(NULL != axutil_array_list_get(arg_instanceTypes, env, i))
1694
non_nil_exists = AXIS2_TRUE;
1702
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "All the elements in the array of instanceTypes is being set to NULL, but it is not a nullable or minOccurs=0 element");
1703
return AXIS2_FAILURE;
1706
if(NULL == arg_instanceTypes)
1708
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "instanceTypes is being set to NULL, but it is not a nullable element");
1709
return AXIS2_FAILURE;
1711
adb_describeResourcesType_reset_instanceTypes(_describeResourcesType, env);
1714
if(NULL == arg_instanceTypes)
1716
/* We are already done */
1717
return AXIS2_SUCCESS;
1719
_describeResourcesType->property_instanceTypes = arg_instanceTypes;
1722
_describeResourcesType->is_valid_instanceTypes = AXIS2_TRUE;
1726
return AXIS2_SUCCESS;
1731
* Get ith element of instanceTypes.
1733
adb_virtualMachineType_t* AXIS2_CALL
1734
adb_describeResourcesType_get_instanceTypes_at(
1735
adb_describeResourcesType_t* _describeResourcesType,
1736
const axutil_env_t *env, int i)
1738
adb_virtualMachineType_t* ret_val;
1741
AXIS2_ENV_CHECK(env, NULL);
1742
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, NULL);
1745
if(_describeResourcesType->property_instanceTypes == NULL)
1747
return (adb_virtualMachineType_t*)0;
1749
ret_val = (adb_virtualMachineType_t*)axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i);
1756
* Set the ith element of instanceTypes.
1758
axis2_status_t AXIS2_CALL
1759
adb_describeResourcesType_set_instanceTypes_at(
1760
adb_describeResourcesType_t* _describeResourcesType,
1761
const axutil_env_t *env, int i,
1762
adb_virtualMachineType_t* arg_instanceTypes)
1764
void *element = NULL;
1768
axis2_bool_t non_nil_exists = AXIS2_FALSE;
1772
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1773
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1775
if( _describeResourcesType->is_valid_instanceTypes &&
1776
_describeResourcesType->property_instanceTypes &&
1778
arg_instanceTypes == (adb_virtualMachineType_t*)axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i))
1782
return AXIS2_SUCCESS;
1786
if(NULL == arg_instanceTypes)
1788
if(_describeResourcesType->property_instanceTypes != NULL)
1790
size = axutil_array_list_size(_describeResourcesType->property_instanceTypes, env);
1791
for(j = 0, k = 0; j < size; j ++ )
1793
if(i == j) continue;
1794
if(NULL != axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i))
1797
non_nil_exists = AXIS2_TRUE;
1808
non_nil_exists = AXIS2_TRUE;
1813
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "All the elements in the array of instanceTypes is being set to NULL, but it is not a nullable or minOccurs=0 element");
1814
return AXIS2_FAILURE;
1819
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of instanceTypes is beinng set to be smaller than the specificed number of minOccurs(1)");
1820
return AXIS2_FAILURE;
1823
if(_describeResourcesType->property_instanceTypes == NULL)
1825
_describeResourcesType->property_instanceTypes = axutil_array_list_create(env, 10);
1828
/* check whether there already exist an element */
1829
element = axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i);
1835
adb_virtualMachineType_free((adb_virtualMachineType_t*)element, env);
1840
axutil_array_list_set(_describeResourcesType->property_instanceTypes , env, i, arg_instanceTypes);
1841
_describeResourcesType->is_valid_instanceTypes = AXIS2_TRUE;
1843
return AXIS2_SUCCESS;
1847
* Add to instanceTypes.
1849
axis2_status_t AXIS2_CALL
1850
adb_describeResourcesType_add_instanceTypes(
1851
adb_describeResourcesType_t* _describeResourcesType,
1852
const axutil_env_t *env,
1853
adb_virtualMachineType_t* arg_instanceTypes)
1857
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1858
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1861
if(NULL == arg_instanceTypes)
1864
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "All the elements in the array of instanceTypes is being set to NULL, but it is not a nullable or minOccurs=0 element");
1865
return AXIS2_FAILURE;
1870
if(_describeResourcesType->property_instanceTypes == NULL)
1872
_describeResourcesType->property_instanceTypes = axutil_array_list_create(env, 10);
1874
if(_describeResourcesType->property_instanceTypes == NULL)
1876
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for instanceTypes");
1877
return AXIS2_FAILURE;
1881
axutil_array_list_add(_describeResourcesType->property_instanceTypes , env, arg_instanceTypes);
1882
_describeResourcesType->is_valid_instanceTypes = AXIS2_TRUE;
1883
return AXIS2_SUCCESS;
1887
* Get the size of the instanceTypes array.
1890
adb_describeResourcesType_sizeof_instanceTypes(
1891
adb_describeResourcesType_t* _describeResourcesType,
1892
const axutil_env_t *env)
1894
AXIS2_ENV_CHECK(env, -1);
1895
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, -1);
1896
if(_describeResourcesType->property_instanceTypes == NULL)
1900
return axutil_array_list_size(_describeResourcesType->property_instanceTypes, env);
1904
* remove the ith element, same as set_nil_at.
1906
axis2_status_t AXIS2_CALL
1907
adb_describeResourcesType_remove_instanceTypes_at(
1908
adb_describeResourcesType_t* _describeResourcesType,
1909
const axutil_env_t *env, int i)
1911
return adb_describeResourcesType_set_instanceTypes_nil_at(_describeResourcesType, env, i);
1917
* resetter for instanceTypes
1919
axis2_status_t AXIS2_CALL
1920
adb_describeResourcesType_reset_instanceTypes(
1921
adb_describeResourcesType_t* _describeResourcesType,
1922
const axutil_env_t *env)
1926
void *element = NULL;
1928
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1929
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
1933
if (_describeResourcesType->property_instanceTypes != NULL)
1935
count = axutil_array_list_size(_describeResourcesType->property_instanceTypes, env);
1936
for(i = 0; i < count; i ++)
1938
element = axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i);
1946
adb_virtualMachineType_free((adb_virtualMachineType_t*)element, env);
1954
axutil_array_list_free(_describeResourcesType->property_instanceTypes, env);
1956
_describeResourcesType->is_valid_instanceTypes = AXIS2_FALSE;
1957
return AXIS2_SUCCESS;
1961
* Check whether instanceTypes is nill
1963
axis2_bool_t AXIS2_CALL
1964
adb_describeResourcesType_is_instanceTypes_nil(
1965
adb_describeResourcesType_t* _describeResourcesType,
1966
const axutil_env_t *env)
1968
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1969
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_TRUE);
1971
return !_describeResourcesType->is_valid_instanceTypes;
1975
* Set instanceTypes to nill (currently the same as reset)
1977
axis2_status_t AXIS2_CALL
1978
adb_describeResourcesType_set_instanceTypes_nil(
1979
adb_describeResourcesType_t* _describeResourcesType,
1980
const axutil_env_t *env)
1982
return adb_describeResourcesType_reset_instanceTypes(_describeResourcesType, env);
1987
* Check whether instanceTypes is nill at i
1989
axis2_bool_t AXIS2_CALL
1990
adb_describeResourcesType_is_instanceTypes_nil_at(
1991
adb_describeResourcesType_t* _describeResourcesType,
1992
const axutil_env_t *env, int i)
1994
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1995
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_TRUE);
1997
return (_describeResourcesType->is_valid_instanceTypes == AXIS2_FALSE ||
1998
NULL == _describeResourcesType->property_instanceTypes ||
1999
NULL == axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i));
2003
* Set instanceTypes to nill at i
2005
axis2_status_t AXIS2_CALL
2006
adb_describeResourcesType_set_instanceTypes_nil_at(
2007
adb_describeResourcesType_t* _describeResourcesType,
2008
const axutil_env_t *env, int i)
2010
void *element = NULL;
2013
axis2_bool_t non_nil_exists = AXIS2_FALSE;
2017
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
2018
AXIS2_PARAM_CHECK(env->error, _describeResourcesType, AXIS2_FAILURE);
2020
if(_describeResourcesType->property_instanceTypes == NULL ||
2021
_describeResourcesType->is_valid_instanceTypes == AXIS2_FALSE)
2024
non_nil_exists = AXIS2_FALSE;
2028
size = axutil_array_list_size(_describeResourcesType->property_instanceTypes, env);
2029
for(j = 0, k = 0; j < size; j ++ )
2031
if(i == j) continue;
2032
if(NULL != axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i))
2035
non_nil_exists = AXIS2_TRUE;
2046
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "All the elements in the array of instanceTypes is being set to NULL, but it is not a nullable or minOccurs=0 element");
2047
return AXIS2_FAILURE;
2053
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of instanceTypes is beinng set to be smaller than the specificed number of minOccurs(1)");
2054
return AXIS2_FAILURE;
2057
if(_describeResourcesType->property_instanceTypes == NULL)
2059
_describeResourcesType->is_valid_instanceTypes = AXIS2_FALSE;
2061
return AXIS2_SUCCESS;
2064
/* check whether there already exist an element */
2065
element = axutil_array_list_get(_describeResourcesType->property_instanceTypes, env, i);
2071
adb_virtualMachineType_free((adb_virtualMachineType_t*)element, env);
2078
axutil_array_list_set(_describeResourcesType->property_instanceTypes , env, i, NULL);
2080
return AXIS2_SUCCESS;