4
* adb_virtualMachineType.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_virtualMachineType.h"
13
* This type was generated from the piece of schema that had
14
* name = virtualMachineType
15
* Namespace URI = http://eucalyptus.ucsb.edu/
16
* Namespace Prefix = ns1
21
struct adb_virtualMachineType
23
axis2_char_t* property_name;
26
axis2_bool_t is_valid_name;
32
axis2_bool_t is_valid_memory;
38
axis2_bool_t is_valid_cores;
44
axis2_bool_t is_valid_disk;
51
/************************* Private Function prototypes ********************************/
54
axis2_status_t AXIS2_CALL
55
adb_virtualMachineType_set_name_nil(
56
adb_virtualMachineType_t* _virtualMachineType,
57
const axutil_env_t *env);
60
axis2_status_t AXIS2_CALL
61
adb_virtualMachineType_set_memory_nil(
62
adb_virtualMachineType_t* _virtualMachineType,
63
const axutil_env_t *env);
66
axis2_status_t AXIS2_CALL
67
adb_virtualMachineType_set_cores_nil(
68
adb_virtualMachineType_t* _virtualMachineType,
69
const axutil_env_t *env);
72
axis2_status_t AXIS2_CALL
73
adb_virtualMachineType_set_disk_nil(
74
adb_virtualMachineType_t* _virtualMachineType,
75
const axutil_env_t *env);
79
/************************* Function Implmentations ********************************/
80
adb_virtualMachineType_t* AXIS2_CALL
81
adb_virtualMachineType_create(
82
const axutil_env_t *env)
84
adb_virtualMachineType_t *_virtualMachineType = NULL;
86
AXIS2_ENV_CHECK(env, NULL);
88
_virtualMachineType = (adb_virtualMachineType_t *) AXIS2_MALLOC(env->
89
allocator, sizeof(adb_virtualMachineType_t));
91
if(NULL == _virtualMachineType)
93
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
97
memset(_virtualMachineType, 0, sizeof(adb_virtualMachineType_t));
99
_virtualMachineType->property_name = NULL;
100
_virtualMachineType->is_valid_name = AXIS2_FALSE;
101
_virtualMachineType->is_valid_memory = AXIS2_FALSE;
102
_virtualMachineType->is_valid_cores = AXIS2_FALSE;
103
_virtualMachineType->is_valid_disk = AXIS2_FALSE;
106
return _virtualMachineType;
109
axis2_status_t AXIS2_CALL
110
adb_virtualMachineType_free (
111
adb_virtualMachineType_t* _virtualMachineType,
112
const axutil_env_t *env)
116
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
117
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
119
adb_virtualMachineType_reset_name(_virtualMachineType, env);
120
adb_virtualMachineType_reset_memory(_virtualMachineType, env);
121
adb_virtualMachineType_reset_cores(_virtualMachineType, env);
122
adb_virtualMachineType_reset_disk(_virtualMachineType, env);
125
if(_virtualMachineType)
127
AXIS2_FREE(env->allocator, _virtualMachineType);
128
_virtualMachineType = NULL;
130
return AXIS2_SUCCESS;
136
axis2_status_t AXIS2_CALL
137
adb_virtualMachineType_deserialize(
138
adb_virtualMachineType_t* _virtualMachineType,
139
const axutil_env_t *env,
140
axiom_node_t **dp_parent,
141
axis2_bool_t *dp_is_early_node_valid,
142
axis2_bool_t dont_care_minoccurs)
144
axiom_node_t *parent = *dp_parent;
146
axis2_status_t status = AXIS2_SUCCESS;
148
axis2_char_t* text_value = NULL;
149
axutil_qname_t *qname = NULL;
151
axutil_qname_t *element_qname = NULL;
153
axiom_node_t *first_node = NULL;
154
axis2_bool_t is_early_node_valid = AXIS2_TRUE;
155
axiom_node_t *current_node = NULL;
156
axiom_element_t *current_element = NULL;
158
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
159
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
163
while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
165
parent = axiom_node_get_next_sibling(parent, env);
169
/* This should be checked before everything */
170
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
171
"Failed in building adb object for virtualMachineType : "
172
"NULL elemenet can not be passed to deserialize");
173
return AXIS2_FAILURE;
177
first_node = axiom_node_get_first_child(parent, env);
183
* building name element
188
current_node = first_node;
189
is_early_node_valid = AXIS2_FALSE;
192
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
194
current_node = axiom_node_get_next_sibling(current_node, env);
196
if(current_node != NULL)
198
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
199
qname = axiom_element_get_qname(current_element, env, current_node);
202
element_qname = axutil_qname_create(env, "name", "http://eucalyptus.ucsb.edu/", NULL);
206
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
208
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
210
is_early_node_valid = AXIS2_TRUE;
214
text_value = axiom_element_get_text(current_element, env, current_node);
215
if(text_value != NULL)
217
status = adb_virtualMachineType_set_name(_virtualMachineType, env,
224
* axis2_qname_t *qname = NULL;
225
* axiom_attribute_t *the_attri = NULL;
227
* qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
228
* the_attri = axiom_element_get_attribute(current_element, env, qname);
230
/* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
232
axiom_attribute_t *the_attri = NULL;
233
axis2_char_t *attrib_text = NULL;
234
axutil_hash_t *attribute_hash = NULL;
236
attribute_hash = axiom_element_get_all_attributes(current_element, env);
241
axutil_hash_index_t *hi;
245
for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
247
axutil_hash_this(hi, &key, NULL, &val);
249
if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
251
the_attri = (axiom_attribute_t*)val;
259
attrib_text = axiom_attribute_get_value(the_attri, env);
263
/* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
264
attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
267
if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
269
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element name");
270
status = AXIS2_FAILURE;
274
/* after all, we found this is a empty string */
275
status = adb_virtualMachineType_set_name(_virtualMachineType, env,
280
if(AXIS2_FAILURE == status)
282
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for name ");
285
axutil_qname_free(element_qname, env);
287
return AXIS2_FAILURE;
293
axutil_qname_free(element_qname, env);
294
element_qname = NULL;
300
* building memory element
306
* because elements are ordered this works fine
310
if(current_node != NULL && is_early_node_valid)
312
current_node = axiom_node_get_next_sibling(current_node, env);
315
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
317
current_node = axiom_node_get_next_sibling(current_node, env);
319
if(current_node != NULL)
321
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
322
qname = axiom_element_get_qname(current_element, env, current_node);
326
is_early_node_valid = AXIS2_FALSE;
328
element_qname = axutil_qname_create(env, "memory", "http://eucalyptus.ucsb.edu/", NULL);
332
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
334
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
336
is_early_node_valid = AXIS2_TRUE;
340
text_value = axiom_element_get_text(current_element, env, current_node);
341
if(text_value != NULL)
343
status = adb_virtualMachineType_set_memory(_virtualMachineType, env,
349
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element memory");
350
status = AXIS2_FAILURE;
353
if(AXIS2_FAILURE == status)
355
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for memory ");
358
axutil_qname_free(element_qname, env);
360
return AXIS2_FAILURE;
366
axutil_qname_free(element_qname, env);
367
element_qname = NULL;
373
* building cores element
379
* because elements are ordered this works fine
383
if(current_node != NULL && is_early_node_valid)
385
current_node = axiom_node_get_next_sibling(current_node, env);
388
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
390
current_node = axiom_node_get_next_sibling(current_node, env);
392
if(current_node != NULL)
394
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
395
qname = axiom_element_get_qname(current_element, env, current_node);
399
is_early_node_valid = AXIS2_FALSE;
401
element_qname = axutil_qname_create(env, "cores", "http://eucalyptus.ucsb.edu/", NULL);
405
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
407
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
409
is_early_node_valid = AXIS2_TRUE;
413
text_value = axiom_element_get_text(current_element, env, current_node);
414
if(text_value != NULL)
416
status = adb_virtualMachineType_set_cores(_virtualMachineType, env,
422
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element cores");
423
status = AXIS2_FAILURE;
426
if(AXIS2_FAILURE == status)
428
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for cores ");
431
axutil_qname_free(element_qname, env);
433
return AXIS2_FAILURE;
439
axutil_qname_free(element_qname, env);
440
element_qname = NULL;
446
* building disk element
452
* because elements are ordered this works fine
456
if(current_node != NULL && is_early_node_valid)
458
current_node = axiom_node_get_next_sibling(current_node, env);
461
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
463
current_node = axiom_node_get_next_sibling(current_node, env);
465
if(current_node != NULL)
467
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
468
qname = axiom_element_get_qname(current_element, env, current_node);
472
is_early_node_valid = AXIS2_FALSE;
474
element_qname = axutil_qname_create(env, "disk", "http://eucalyptus.ucsb.edu/", NULL);
478
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
480
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
482
is_early_node_valid = AXIS2_TRUE;
486
text_value = axiom_element_get_text(current_element, env, current_node);
487
if(text_value != NULL)
489
status = adb_virtualMachineType_set_disk(_virtualMachineType, env,
495
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element disk");
496
status = AXIS2_FAILURE;
499
if(AXIS2_FAILURE == status)
501
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for disk ");
504
axutil_qname_free(element_qname, env);
506
return AXIS2_FAILURE;
512
axutil_qname_free(element_qname, env);
513
element_qname = NULL;
519
axis2_bool_t AXIS2_CALL
520
adb_virtualMachineType_is_particle()
529
adb_virtualMachineType_declare_parent_namespaces(
530
adb_virtualMachineType_t* _virtualMachineType,
531
const axutil_env_t *env, axiom_element_t *parent_element,
532
axutil_hash_t *namespaces, int *next_ns_index)
535
/* Here this is an empty function, Nothing to declare */
541
axiom_node_t* AXIS2_CALL
542
adb_virtualMachineType_serialize(
543
adb_virtualMachineType_t* _virtualMachineType,
544
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)
548
axis2_char_t *string_to_stream;
551
axiom_node_t *current_node = NULL;
556
axiom_namespace_t *ns1 = NULL;
558
axis2_char_t *qname_uri = NULL;
559
axis2_char_t *qname_prefix = NULL;
560
axis2_char_t *p_prefix = NULL;
561
axis2_bool_t ns_already_defined;
563
axis2_char_t *text_value_1;
564
axis2_char_t *text_value_1_temp;
566
axis2_char_t text_value_2[64];
568
axis2_char_t text_value_3[64];
570
axis2_char_t text_value_4[64];
572
axis2_char_t *start_input_str = NULL;
573
axis2_char_t *end_input_str = NULL;
574
unsigned int start_input_str_len = 0;
575
unsigned int end_input_str_len = 0;
578
axiom_data_source_t *data_source = NULL;
579
axutil_stream_t *stream = NULL;
583
AXIS2_ENV_CHECK(env, NULL);
584
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, NULL);
587
current_node = parent;
588
data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
591
stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
595
if(!parent_tag_closed)
598
string_to_stream = ">";
599
axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
604
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
606
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
607
sprintf(p_prefix, "n%d", (*next_ns_index)++);
608
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
610
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
611
"http://eucalyptus.ucsb.edu/",
616
if (!_virtualMachineType->is_valid_name)
619
/* no need to complain for minoccurs=0 element */
625
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
626
(4 + axutil_strlen(p_prefix) +
627
axutil_strlen("name")));
629
/* axutil_strlen("<:>") + 1 = 4 */
630
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
631
(5 + axutil_strlen(p_prefix) + axutil_strlen("name")));
632
/* axutil_strlen("</:>") + 1 = 5 */
640
* parsing name element
645
sprintf(start_input_str, "<%s%sname>",
646
p_prefix?p_prefix:"",
647
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
649
start_input_str_len = axutil_strlen(start_input_str);
650
sprintf(end_input_str, "</%s%sname>",
651
p_prefix?p_prefix:"",
652
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
653
end_input_str_len = axutil_strlen(end_input_str);
655
text_value_1 = _virtualMachineType->property_name;
657
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
660
text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE);
661
if (text_value_1_temp)
663
axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp));
664
AXIS2_FREE(env->allocator, text_value_1_temp);
668
axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
671
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
674
AXIS2_FREE(env->allocator,start_input_str);
675
AXIS2_FREE(env->allocator,end_input_str);
679
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
681
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
682
sprintf(p_prefix, "n%d", (*next_ns_index)++);
683
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
685
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
686
"http://eucalyptus.ucsb.edu/",
691
if (!_virtualMachineType->is_valid_memory)
694
/* no need to complain for minoccurs=0 element */
700
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
701
(4 + axutil_strlen(p_prefix) +
702
axutil_strlen("memory")));
704
/* axutil_strlen("<:>") + 1 = 4 */
705
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
706
(5 + axutil_strlen(p_prefix) + axutil_strlen("memory")));
707
/* axutil_strlen("</:>") + 1 = 5 */
715
* parsing memory element
720
sprintf(start_input_str, "<%s%smemory>",
721
p_prefix?p_prefix:"",
722
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
724
start_input_str_len = axutil_strlen(start_input_str);
725
sprintf(end_input_str, "</%s%smemory>",
726
p_prefix?p_prefix:"",
727
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
728
end_input_str_len = axutil_strlen(end_input_str);
730
sprintf (text_value_2, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _virtualMachineType->property_memory);
732
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
734
axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
736
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
739
AXIS2_FREE(env->allocator,start_input_str);
740
AXIS2_FREE(env->allocator,end_input_str);
744
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
746
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
747
sprintf(p_prefix, "n%d", (*next_ns_index)++);
748
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
750
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
751
"http://eucalyptus.ucsb.edu/",
756
if (!_virtualMachineType->is_valid_cores)
759
/* no need to complain for minoccurs=0 element */
765
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
766
(4 + axutil_strlen(p_prefix) +
767
axutil_strlen("cores")));
769
/* axutil_strlen("<:>") + 1 = 4 */
770
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
771
(5 + axutil_strlen(p_prefix) + axutil_strlen("cores")));
772
/* axutil_strlen("</:>") + 1 = 5 */
780
* parsing cores element
785
sprintf(start_input_str, "<%s%scores>",
786
p_prefix?p_prefix:"",
787
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
789
start_input_str_len = axutil_strlen(start_input_str);
790
sprintf(end_input_str, "</%s%scores>",
791
p_prefix?p_prefix:"",
792
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
793
end_input_str_len = axutil_strlen(end_input_str);
795
sprintf (text_value_3, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _virtualMachineType->property_cores);
797
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
799
axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
801
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
804
AXIS2_FREE(env->allocator,start_input_str);
805
AXIS2_FREE(env->allocator,end_input_str);
809
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
811
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
812
sprintf(p_prefix, "n%d", (*next_ns_index)++);
813
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
815
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
816
"http://eucalyptus.ucsb.edu/",
821
if (!_virtualMachineType->is_valid_disk)
824
/* no need to complain for minoccurs=0 element */
830
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
831
(4 + axutil_strlen(p_prefix) +
832
axutil_strlen("disk")));
834
/* axutil_strlen("<:>") + 1 = 4 */
835
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
836
(5 + axutil_strlen(p_prefix) + axutil_strlen("disk")));
837
/* axutil_strlen("</:>") + 1 = 5 */
845
* parsing disk element
850
sprintf(start_input_str, "<%s%sdisk>",
851
p_prefix?p_prefix:"",
852
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
854
start_input_str_len = axutil_strlen(start_input_str);
855
sprintf(end_input_str, "</%s%sdisk>",
856
p_prefix?p_prefix:"",
857
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
858
end_input_str_len = axutil_strlen(end_input_str);
860
sprintf (text_value_4, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _virtualMachineType->property_disk);
862
axutil_stream_write(stream, env, start_input_str, start_input_str_len);
864
axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
866
axutil_stream_write(stream, env, end_input_str, end_input_str_len);
869
AXIS2_FREE(env->allocator,start_input_str);
870
AXIS2_FREE(env->allocator,end_input_str);
884
axis2_char_t* AXIS2_CALL
885
adb_virtualMachineType_get_name(
886
adb_virtualMachineType_t* _virtualMachineType,
887
const axutil_env_t *env)
890
AXIS2_ENV_CHECK(env, NULL);
891
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, NULL);
894
return _virtualMachineType->property_name;
900
axis2_status_t AXIS2_CALL
901
adb_virtualMachineType_set_name(
902
adb_virtualMachineType_t* _virtualMachineType,
903
const axutil_env_t *env,
904
const axis2_char_t* arg_name)
908
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
909
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
911
if(_virtualMachineType->is_valid_name &&
912
arg_name == _virtualMachineType->property_name)
915
return AXIS2_SUCCESS;
918
adb_virtualMachineType_reset_name(_virtualMachineType, env);
923
/* We are already done */
924
return AXIS2_SUCCESS;
926
_virtualMachineType->property_name = (axis2_char_t *)axutil_strdup(env, arg_name);
927
if(NULL == _virtualMachineType->property_name)
929
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for name");
930
return AXIS2_FAILURE;
932
_virtualMachineType->is_valid_name = AXIS2_TRUE;
934
return AXIS2_SUCCESS;
942
axis2_status_t AXIS2_CALL
943
adb_virtualMachineType_reset_name(
944
adb_virtualMachineType_t* _virtualMachineType,
945
const axutil_env_t *env)
949
void *element = NULL;
951
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
952
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
958
if(_virtualMachineType->property_name != NULL)
962
AXIS2_FREE(env-> allocator, _virtualMachineType->property_name);
963
_virtualMachineType->property_name = NULL;
968
_virtualMachineType->is_valid_name = AXIS2_FALSE;
969
return AXIS2_SUCCESS;
973
* Check whether name is nill
975
axis2_bool_t AXIS2_CALL
976
adb_virtualMachineType_is_name_nil(
977
adb_virtualMachineType_t* _virtualMachineType,
978
const axutil_env_t *env)
980
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
981
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_TRUE);
983
return !_virtualMachineType->is_valid_name;
987
* Set name to nill (currently the same as reset)
989
axis2_status_t AXIS2_CALL
990
adb_virtualMachineType_set_name_nil(
991
adb_virtualMachineType_t* _virtualMachineType,
992
const axutil_env_t *env)
994
return adb_virtualMachineType_reset_name(_virtualMachineType, env);
1000
* getter for memory.
1003
adb_virtualMachineType_get_memory(
1004
adb_virtualMachineType_t* _virtualMachineType,
1005
const axutil_env_t *env)
1008
AXIS2_ENV_CHECK(env, (int)0);
1009
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, (int)0);
1012
return _virtualMachineType->property_memory;
1018
axis2_status_t AXIS2_CALL
1019
adb_virtualMachineType_set_memory(
1020
adb_virtualMachineType_t* _virtualMachineType,
1021
const axutil_env_t *env,
1022
const int arg_memory)
1026
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1027
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
1029
if(_virtualMachineType->is_valid_memory &&
1030
arg_memory == _virtualMachineType->property_memory)
1033
return AXIS2_SUCCESS;
1036
adb_virtualMachineType_reset_memory(_virtualMachineType, env);
1038
_virtualMachineType->property_memory = arg_memory;
1039
_virtualMachineType->is_valid_memory = AXIS2_TRUE;
1041
return AXIS2_SUCCESS;
1047
* resetter for memory
1049
axis2_status_t AXIS2_CALL
1050
adb_virtualMachineType_reset_memory(
1051
adb_virtualMachineType_t* _virtualMachineType,
1052
const axutil_env_t *env)
1056
void *element = NULL;
1058
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1059
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
1062
_virtualMachineType->is_valid_memory = AXIS2_FALSE;
1063
return AXIS2_SUCCESS;
1067
* Check whether memory is nill
1069
axis2_bool_t AXIS2_CALL
1070
adb_virtualMachineType_is_memory_nil(
1071
adb_virtualMachineType_t* _virtualMachineType,
1072
const axutil_env_t *env)
1074
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1075
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_TRUE);
1077
return !_virtualMachineType->is_valid_memory;
1081
* Set memory to nill (currently the same as reset)
1083
axis2_status_t AXIS2_CALL
1084
adb_virtualMachineType_set_memory_nil(
1085
adb_virtualMachineType_t* _virtualMachineType,
1086
const axutil_env_t *env)
1088
return adb_virtualMachineType_reset_memory(_virtualMachineType, env);
1097
adb_virtualMachineType_get_cores(
1098
adb_virtualMachineType_t* _virtualMachineType,
1099
const axutil_env_t *env)
1102
AXIS2_ENV_CHECK(env, (int)0);
1103
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, (int)0);
1106
return _virtualMachineType->property_cores;
1112
axis2_status_t AXIS2_CALL
1113
adb_virtualMachineType_set_cores(
1114
adb_virtualMachineType_t* _virtualMachineType,
1115
const axutil_env_t *env,
1116
const int arg_cores)
1120
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1121
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
1123
if(_virtualMachineType->is_valid_cores &&
1124
arg_cores == _virtualMachineType->property_cores)
1127
return AXIS2_SUCCESS;
1130
adb_virtualMachineType_reset_cores(_virtualMachineType, env);
1132
_virtualMachineType->property_cores = arg_cores;
1133
_virtualMachineType->is_valid_cores = AXIS2_TRUE;
1135
return AXIS2_SUCCESS;
1141
* resetter for cores
1143
axis2_status_t AXIS2_CALL
1144
adb_virtualMachineType_reset_cores(
1145
adb_virtualMachineType_t* _virtualMachineType,
1146
const axutil_env_t *env)
1150
void *element = NULL;
1152
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1153
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
1156
_virtualMachineType->is_valid_cores = AXIS2_FALSE;
1157
return AXIS2_SUCCESS;
1161
* Check whether cores is nill
1163
axis2_bool_t AXIS2_CALL
1164
adb_virtualMachineType_is_cores_nil(
1165
adb_virtualMachineType_t* _virtualMachineType,
1166
const axutil_env_t *env)
1168
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1169
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_TRUE);
1171
return !_virtualMachineType->is_valid_cores;
1175
* Set cores to nill (currently the same as reset)
1177
axis2_status_t AXIS2_CALL
1178
adb_virtualMachineType_set_cores_nil(
1179
adb_virtualMachineType_t* _virtualMachineType,
1180
const axutil_env_t *env)
1182
return adb_virtualMachineType_reset_cores(_virtualMachineType, env);
1191
adb_virtualMachineType_get_disk(
1192
adb_virtualMachineType_t* _virtualMachineType,
1193
const axutil_env_t *env)
1196
AXIS2_ENV_CHECK(env, (int)0);
1197
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, (int)0);
1200
return _virtualMachineType->property_disk;
1206
axis2_status_t AXIS2_CALL
1207
adb_virtualMachineType_set_disk(
1208
adb_virtualMachineType_t* _virtualMachineType,
1209
const axutil_env_t *env,
1214
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1215
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
1217
if(_virtualMachineType->is_valid_disk &&
1218
arg_disk == _virtualMachineType->property_disk)
1221
return AXIS2_SUCCESS;
1224
adb_virtualMachineType_reset_disk(_virtualMachineType, env);
1226
_virtualMachineType->property_disk = arg_disk;
1227
_virtualMachineType->is_valid_disk = AXIS2_TRUE;
1229
return AXIS2_SUCCESS;
1237
axis2_status_t AXIS2_CALL
1238
adb_virtualMachineType_reset_disk(
1239
adb_virtualMachineType_t* _virtualMachineType,
1240
const axutil_env_t *env)
1244
void *element = NULL;
1246
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
1247
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_FAILURE);
1250
_virtualMachineType->is_valid_disk = AXIS2_FALSE;
1251
return AXIS2_SUCCESS;
1255
* Check whether disk is nill
1257
axis2_bool_t AXIS2_CALL
1258
adb_virtualMachineType_is_disk_nil(
1259
adb_virtualMachineType_t* _virtualMachineType,
1260
const axutil_env_t *env)
1262
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
1263
AXIS2_PARAM_CHECK(env->error, _virtualMachineType, AXIS2_TRUE);
1265
return !_virtualMachineType->is_valid_disk;
1269
* Set disk to nill (currently the same as reset)
1271
axis2_status_t AXIS2_CALL
1272
adb_virtualMachineType_set_disk_nil(
1273
adb_virtualMachineType_t* _virtualMachineType,
1274
const axutil_env_t *env)
1276
return adb_virtualMachineType_reset_disk(_virtualMachineType, env);