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_DetachVolume.h"
13
* implmentation of the DetachVolume|http://eucalyptus.ucsb.edu/ element
18
struct adb_DetachVolume
21
axutil_qname_t* qname;
22
adb_detachVolumeType_t* property_DetachVolume;
25
axis2_bool_t is_valid_DetachVolume;
32
/************************* Private Function prototypes ********************************/
36
/************************* Function Implmentations ********************************/
37
adb_DetachVolume_t* AXIS2_CALL
38
adb_DetachVolume_create(
39
const axutil_env_t *env)
41
adb_DetachVolume_t *_DetachVolume = NULL;
43
axutil_qname_t* qname = NULL;
45
AXIS2_ENV_CHECK(env, NULL);
47
_DetachVolume = (adb_DetachVolume_t *) AXIS2_MALLOC(env->
48
allocator, sizeof(adb_DetachVolume_t));
50
if(NULL == _DetachVolume)
52
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
56
memset(_DetachVolume, 0, sizeof(adb_DetachVolume_t));
58
_DetachVolume->property_DetachVolume = NULL;
59
_DetachVolume->is_valid_DetachVolume = AXIS2_FALSE;
61
qname = axutil_qname_create (env,
63
"http://eucalyptus.ucsb.edu/",
65
_DetachVolume->qname = qname;
71
axis2_status_t AXIS2_CALL
72
adb_DetachVolume_free (
73
adb_DetachVolume_t* _DetachVolume,
74
const axutil_env_t *env)
78
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
79
AXIS2_PARAM_CHECK(env->error, _DetachVolume, AXIS2_FAILURE);
81
adb_DetachVolume_reset_DetachVolume(_DetachVolume, env);
83
if(_DetachVolume->qname)
85
axutil_qname_free (_DetachVolume->qname, env);
86
_DetachVolume->qname = NULL;
92
AXIS2_FREE(env->allocator, _DetachVolume);
101
axis2_status_t AXIS2_CALL
102
adb_DetachVolume_deserialize(
103
adb_DetachVolume_t* _DetachVolume,
104
const axutil_env_t *env,
105
axiom_node_t **dp_parent,
106
axis2_bool_t *dp_is_early_node_valid,
107
axis2_bool_t dont_care_minoccurs)
109
axiom_node_t *parent = *dp_parent;
111
axis2_status_t status = AXIS2_SUCCESS;
113
void *element = NULL;
115
axis2_char_t* text_value = NULL;
116
axutil_qname_t *qname = NULL;
118
axutil_qname_t *element_qname = NULL;
120
axiom_node_t *first_node = NULL;
121
axis2_bool_t is_early_node_valid = AXIS2_TRUE;
122
axiom_node_t *current_node = NULL;
123
axiom_element_t *current_element = NULL;
125
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
126
AXIS2_PARAM_CHECK(env->error, _DetachVolume, AXIS2_FAILURE);
130
while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
132
parent = axiom_node_get_next_sibling(parent, env);
136
/* This should be checked before everything */
137
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
138
"Failed in building adb object for DetachVolume : "
139
"NULL elemenet can not be passed to deserialize");
140
return AXIS2_FAILURE;
144
current_element = (axiom_element_t *)axiom_node_get_data_element(parent, env);
145
qname = axiom_element_get_qname(current_element, env, parent);
146
if (axutil_qname_equals(qname, env, _DetachVolume-> qname))
154
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
155
"Failed in building adb object for DetachVolume : "
156
"Expected %s but returned %s",
157
axutil_qname_to_string(_DetachVolume-> qname, env),
158
axutil_qname_to_string(qname, env));
160
return AXIS2_FAILURE;
166
* building DetachVolume element
171
current_node = first_node;
172
is_early_node_valid = AXIS2_FALSE;
175
while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
177
current_node = axiom_node_get_next_sibling(current_node, env);
179
if(current_node != NULL)
181
current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
182
qname = axiom_element_get_qname(current_element, env, current_node);
185
element_qname = axutil_qname_create(env, "DetachVolume", "http://eucalyptus.ucsb.edu/", NULL);
188
if (adb_detachVolumeType_is_particle() ||
189
(current_node && current_element && (axutil_qname_equals(element_qname, env, qname))))
191
if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))
193
is_early_node_valid = AXIS2_TRUE;
197
element = (void*)adb_detachVolumeType_create(env);
199
status = adb_detachVolumeType_deserialize((adb_detachVolumeType_t*)element,
200
env, ¤t_node, &is_early_node_valid, AXIS2_FALSE);
201
if(AXIS2_FAILURE == status)
203
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in building adb object for element DetachVolume");
207
status = adb_DetachVolume_set_DetachVolume(_DetachVolume, env,
208
(adb_detachVolumeType_t*)element);
211
if(AXIS2_FAILURE == status)
213
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for DetachVolume ");
216
axutil_qname_free(element_qname, env);
218
return AXIS2_FAILURE;
222
else if(!dont_care_minoccurs)
226
axutil_qname_free(element_qname, env);
228
/* this is not a nillable element*/
229
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element DetachVolume missing");
230
return AXIS2_FAILURE;
235
axutil_qname_free(element_qname, env);
236
element_qname = NULL;
242
axis2_bool_t AXIS2_CALL
243
adb_DetachVolume_is_particle()
252
adb_DetachVolume_declare_parent_namespaces(
253
adb_DetachVolume_t* _DetachVolume,
254
const axutil_env_t *env, axiom_element_t *parent_element,
255
axutil_hash_t *namespaces, int *next_ns_index)
258
/* Here this is an empty function, Nothing to declare */
264
axiom_node_t* AXIS2_CALL
265
adb_DetachVolume_serialize(
266
adb_DetachVolume_t* _DetachVolume,
267
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)
272
axiom_node_t *current_node = NULL;
277
axiom_namespace_t *ns1 = NULL;
279
axis2_char_t *qname_uri = NULL;
280
axis2_char_t *qname_prefix = NULL;
281
axis2_char_t *p_prefix = NULL;
282
axis2_bool_t ns_already_defined;
284
axis2_char_t text_value_1[64];
286
axis2_char_t *start_input_str = NULL;
287
axis2_char_t *end_input_str = NULL;
288
unsigned int start_input_str_len = 0;
289
unsigned int end_input_str_len = 0;
292
axiom_data_source_t *data_source = NULL;
293
axutil_stream_t *stream = NULL;
296
int next_ns_index_value = 0;
299
AXIS2_ENV_CHECK(env, NULL);
300
AXIS2_PARAM_CHECK(env->error, _DetachVolume, NULL);
303
namespaces = axutil_hash_make(env);
304
next_ns_index = &next_ns_index_value;
306
ns1 = axiom_namespace_create (env,
307
"http://eucalyptus.ucsb.edu/",
309
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n"));
312
parent_element = axiom_element_create (env, NULL, "DetachVolume", ns1 , &parent);
315
axiom_element_set_namespace(parent_element, env, ns1, parent);
319
data_source = axiom_data_source_create(env, parent, ¤t_node);
320
stream = axiom_data_source_get_stream(data_source, env);
322
if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
324
p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
325
sprintf(p_prefix, "n%d", (*next_ns_index)++);
326
axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
328
axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
329
"http://eucalyptus.ucsb.edu/",
334
if (!_DetachVolume->is_valid_DetachVolume)
338
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
339
(5 + axutil_strlen(p_prefix) +
340
axutil_strlen("DetachVolume") +
341
axutil_strlen(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"1\"")));
344
sprintf(start_input_str, "<%s%sDetachVolume xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"1\"/>",
345
p_prefix?p_prefix:"",
346
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
348
axutil_stream_write(stream, env, start_input_str, axutil_strlen(start_input_str));
349
AXIS2_FREE(env->allocator,start_input_str);
354
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
355
(4 + axutil_strlen(p_prefix) +
356
axutil_strlen("DetachVolume")));
358
/* axutil_strlen("<:>") + 1 = 4 */
359
end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
360
(5 + axutil_strlen(p_prefix) + axutil_strlen("DetachVolume")));
361
/* axutil_strlen("</:>") + 1 = 5 */
369
* parsing DetachVolume element
374
sprintf(start_input_str, "<%s%sDetachVolume",
375
p_prefix?p_prefix:"",
376
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
378
start_input_str_len = axutil_strlen(start_input_str);
379
sprintf(end_input_str, "</%s%sDetachVolume>",
380
p_prefix?p_prefix:"",
381
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
382
end_input_str_len = axutil_strlen(end_input_str);
384
adb_detachVolumeType_serialize(_DetachVolume->property_DetachVolume,
385
env, current_node, parent_element,
386
adb_detachVolumeType_is_particle() || AXIS2_TRUE, namespaces, next_ns_index);
389
AXIS2_FREE(env->allocator,start_input_str);
390
AXIS2_FREE(env->allocator,end_input_str);
396
axutil_hash_index_t *hi;
398
for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi))
400
axutil_hash_this(hi, NULL, NULL, &val);
401
AXIS2_FREE(env->allocator, val);
403
axutil_hash_free(namespaces, env);
414
* getter for DetachVolume.
416
adb_detachVolumeType_t* AXIS2_CALL
417
adb_DetachVolume_get_DetachVolume(
418
adb_DetachVolume_t* _DetachVolume,
419
const axutil_env_t *env)
422
AXIS2_ENV_CHECK(env, NULL);
423
AXIS2_PARAM_CHECK(env->error, _DetachVolume, NULL);
426
return _DetachVolume->property_DetachVolume;
430
* setter for DetachVolume
432
axis2_status_t AXIS2_CALL
433
adb_DetachVolume_set_DetachVolume(
434
adb_DetachVolume_t* _DetachVolume,
435
const axutil_env_t *env,
436
adb_detachVolumeType_t* arg_DetachVolume)
440
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
441
AXIS2_PARAM_CHECK(env->error, _DetachVolume, AXIS2_FAILURE);
443
if(_DetachVolume->is_valid_DetachVolume &&
444
arg_DetachVolume == _DetachVolume->property_DetachVolume)
447
return AXIS2_SUCCESS;
450
adb_DetachVolume_reset_DetachVolume(_DetachVolume, env);
453
if(NULL == arg_DetachVolume)
455
/* We are already done */
456
return AXIS2_SUCCESS;
458
_DetachVolume->property_DetachVolume = arg_DetachVolume;
459
_DetachVolume->is_valid_DetachVolume = AXIS2_TRUE;
461
return AXIS2_SUCCESS;
467
* resetter for DetachVolume
469
axis2_status_t AXIS2_CALL
470
adb_DetachVolume_reset_DetachVolume(
471
adb_DetachVolume_t* _DetachVolume,
472
const axutil_env_t *env)
476
void *element = NULL;
478
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
479
AXIS2_PARAM_CHECK(env->error, _DetachVolume, AXIS2_FAILURE);
485
if(_DetachVolume->property_DetachVolume != NULL)
489
adb_detachVolumeType_free(_DetachVolume->property_DetachVolume, env);
490
_DetachVolume->property_DetachVolume = NULL;
495
_DetachVolume->is_valid_DetachVolume = AXIS2_FALSE;
496
return AXIS2_SUCCESS;
500
* Check whether DetachVolume is nill
502
axis2_bool_t AXIS2_CALL
503
adb_DetachVolume_is_DetachVolume_nil(
504
adb_DetachVolume_t* _DetachVolume,
505
const axutil_env_t *env)
507
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
508
AXIS2_PARAM_CHECK(env->error, _DetachVolume, AXIS2_TRUE);
510
return !_DetachVolume->is_valid_DetachVolume;
514
* Set DetachVolume to nill (currently the same as reset)
516
axis2_status_t AXIS2_CALL
517
adb_DetachVolume_set_DetachVolume_nil(
518
adb_DetachVolume_t* _DetachVolume,
519
const axutil_env_t *env)
521
return adb_DetachVolume_reset_DetachVolume(_DetachVolume, env);