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_AttachVolume.h"
13
* implmentation of the AttachVolume|http://eucalyptus.ucsb.edu/ element
18
struct adb_AttachVolume
21
axutil_qname_t* qname;
22
adb_attachVolumeType_t* property_AttachVolume;
25
axis2_bool_t is_valid_AttachVolume;
32
/************************* Private Function prototypes ********************************/
36
/************************* Function Implmentations ********************************/
37
adb_AttachVolume_t* AXIS2_CALL
38
adb_AttachVolume_create(
39
const axutil_env_t *env)
41
adb_AttachVolume_t *_AttachVolume = NULL;
43
axutil_qname_t* qname = NULL;
45
AXIS2_ENV_CHECK(env, NULL);
47
_AttachVolume = (adb_AttachVolume_t *) AXIS2_MALLOC(env->
48
allocator, sizeof(adb_AttachVolume_t));
50
if(NULL == _AttachVolume)
52
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
56
memset(_AttachVolume, 0, sizeof(adb_AttachVolume_t));
58
_AttachVolume->property_AttachVolume = NULL;
59
_AttachVolume->is_valid_AttachVolume = AXIS2_FALSE;
61
qname = axutil_qname_create (env,
63
"http://eucalyptus.ucsb.edu/",
65
_AttachVolume->qname = qname;
71
axis2_status_t AXIS2_CALL
72
adb_AttachVolume_free (
73
adb_AttachVolume_t* _AttachVolume,
74
const axutil_env_t *env)
78
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
79
AXIS2_PARAM_CHECK(env->error, _AttachVolume, AXIS2_FAILURE);
81
adb_AttachVolume_reset_AttachVolume(_AttachVolume, env);
83
if(_AttachVolume->qname)
85
axutil_qname_free (_AttachVolume->qname, env);
86
_AttachVolume->qname = NULL;
92
AXIS2_FREE(env->allocator, _AttachVolume);
101
axis2_status_t AXIS2_CALL
102
adb_AttachVolume_deserialize(
103
adb_AttachVolume_t* _AttachVolume,
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, _AttachVolume, 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 AttachVolume : "
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, _AttachVolume-> qname))
154
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
155
"Failed in building adb object for AttachVolume : "
156
"Expected %s but returned %s",
157
axutil_qname_to_string(_AttachVolume-> qname, env),
158
axutil_qname_to_string(qname, env));
160
return AXIS2_FAILURE;
166
* building AttachVolume 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, "AttachVolume", "http://eucalyptus.ucsb.edu/", NULL);
188
if (adb_attachVolumeType_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_attachVolumeType_create(env);
199
status = adb_attachVolumeType_deserialize((adb_attachVolumeType_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 AttachVolume");
207
status = adb_AttachVolume_set_AttachVolume(_AttachVolume, env,
208
(adb_attachVolumeType_t*)element);
211
if(AXIS2_FAILURE == status)
213
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for AttachVolume ");
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 AttachVolume missing");
230
return AXIS2_FAILURE;
235
axutil_qname_free(element_qname, env);
236
element_qname = NULL;
242
axis2_bool_t AXIS2_CALL
243
adb_AttachVolume_is_particle()
252
adb_AttachVolume_declare_parent_namespaces(
253
adb_AttachVolume_t* _AttachVolume,
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_AttachVolume_serialize(
266
adb_AttachVolume_t* _AttachVolume,
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, _AttachVolume, 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, "AttachVolume", 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 (!_AttachVolume->is_valid_AttachVolume)
338
start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
339
(5 + axutil_strlen(p_prefix) +
340
axutil_strlen("AttachVolume") +
341
axutil_strlen(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"1\"")));
344
sprintf(start_input_str, "<%s%sAttachVolume 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("AttachVolume")));
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("AttachVolume")));
361
/* axutil_strlen("</:>") + 1 = 5 */
369
* parsing AttachVolume element
374
sprintf(start_input_str, "<%s%sAttachVolume",
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%sAttachVolume>",
380
p_prefix?p_prefix:"",
381
(p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
382
end_input_str_len = axutil_strlen(end_input_str);
384
adb_attachVolumeType_serialize(_AttachVolume->property_AttachVolume,
385
env, current_node, parent_element,
386
adb_attachVolumeType_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 AttachVolume.
416
adb_attachVolumeType_t* AXIS2_CALL
417
adb_AttachVolume_get_AttachVolume(
418
adb_AttachVolume_t* _AttachVolume,
419
const axutil_env_t *env)
422
AXIS2_ENV_CHECK(env, NULL);
423
AXIS2_PARAM_CHECK(env->error, _AttachVolume, NULL);
426
return _AttachVolume->property_AttachVolume;
430
* setter for AttachVolume
432
axis2_status_t AXIS2_CALL
433
adb_AttachVolume_set_AttachVolume(
434
adb_AttachVolume_t* _AttachVolume,
435
const axutil_env_t *env,
436
adb_attachVolumeType_t* arg_AttachVolume)
440
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
441
AXIS2_PARAM_CHECK(env->error, _AttachVolume, AXIS2_FAILURE);
443
if(_AttachVolume->is_valid_AttachVolume &&
444
arg_AttachVolume == _AttachVolume->property_AttachVolume)
447
return AXIS2_SUCCESS;
450
adb_AttachVolume_reset_AttachVolume(_AttachVolume, env);
453
if(NULL == arg_AttachVolume)
455
/* We are already done */
456
return AXIS2_SUCCESS;
458
_AttachVolume->property_AttachVolume = arg_AttachVolume;
459
_AttachVolume->is_valid_AttachVolume = AXIS2_TRUE;
461
return AXIS2_SUCCESS;
467
* resetter for AttachVolume
469
axis2_status_t AXIS2_CALL
470
adb_AttachVolume_reset_AttachVolume(
471
adb_AttachVolume_t* _AttachVolume,
472
const axutil_env_t *env)
476
void *element = NULL;
478
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
479
AXIS2_PARAM_CHECK(env->error, _AttachVolume, AXIS2_FAILURE);
485
if(_AttachVolume->property_AttachVolume != NULL)
489
adb_attachVolumeType_free(_AttachVolume->property_AttachVolume, env);
490
_AttachVolume->property_AttachVolume = NULL;
495
_AttachVolume->is_valid_AttachVolume = AXIS2_FALSE;
496
return AXIS2_SUCCESS;
500
* Check whether AttachVolume is nill
502
axis2_bool_t AXIS2_CALL
503
adb_AttachVolume_is_AttachVolume_nil(
504
adb_AttachVolume_t* _AttachVolume,
505
const axutil_env_t *env)
507
AXIS2_ENV_CHECK(env, AXIS2_TRUE);
508
AXIS2_PARAM_CHECK(env->error, _AttachVolume, AXIS2_TRUE);
510
return !_AttachVolume->is_valid_AttachVolume;
514
* Set AttachVolume to nill (currently the same as reset)
516
axis2_status_t AXIS2_CALL
517
adb_AttachVolume_set_AttachVolume_nil(
518
adb_AttachVolume_t* _AttachVolume,
519
const axutil_env_t *env)
521
return adb_AttachVolume_reset_AttachVolume(_AttachVolume, env);