~ubuntu-core-dev/ubuntu/maverick/eucalyptus/devel

« back to all changes in this revision

Viewing changes to cluster/generated/adb_deviceMappingType.c

  • Committer: Dustin Kirkland
  • Date: 2010-07-22 08:41:57 UTC
  • mfrom: (1050.1.19 ubuntu)
  • Revision ID: kirkland@x200-20100722084157-zh2p8dkawznvxxpn
Approving Dave Walker's merge of new upstream Eucalyptus 2.0 release.

Dustin Kirkland <kirkland@canonical.com>

* New major upstream version merge, 2.0 (r1211).
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
        /**
 
4
         * adb_deviceMappingType.c
 
5
         *
 
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)
 
8
         */
 
9
 
 
10
        #include "adb_deviceMappingType.h"
 
11
        
 
12
                /*
 
13
                 * This type was generated from the piece of schema that had
 
14
                 * name = deviceMappingType
 
15
                 * Namespace URI = http://eucalyptus.ucsb.edu/
 
16
                 * Namespace Prefix = ns1
 
17
                 */
 
18
           
 
19
 
 
20
 
 
21
        struct adb_deviceMappingType
 
22
        {
 
23
            axis2_char_t* property_deviceName;
 
24
 
 
25
                
 
26
                axis2_bool_t is_valid_deviceName;
 
27
 
 
28
 
 
29
            axis2_char_t* property_virtualName;
 
30
 
 
31
                
 
32
                axis2_bool_t is_valid_virtualName;
 
33
 
 
34
 
 
35
            int property_size;
 
36
 
 
37
                
 
38
                axis2_bool_t is_valid_size;
 
39
 
 
40
 
 
41
            axis2_char_t* property_format;
 
42
 
 
43
                
 
44
                axis2_bool_t is_valid_format;
 
45
 
 
46
 
 
47
            
 
48
        };
 
49
 
 
50
 
 
51
       /************************* Private Function prototypes ********************************/
 
52
        
 
53
 
 
54
                axis2_status_t AXIS2_CALL
 
55
                adb_deviceMappingType_set_deviceName_nil(
 
56
                        adb_deviceMappingType_t* _deviceMappingType,
 
57
                        const axutil_env_t *env);
 
58
            
 
59
 
 
60
                axis2_status_t AXIS2_CALL
 
61
                adb_deviceMappingType_set_virtualName_nil(
 
62
                        adb_deviceMappingType_t* _deviceMappingType,
 
63
                        const axutil_env_t *env);
 
64
            
 
65
 
 
66
                axis2_status_t AXIS2_CALL
 
67
                adb_deviceMappingType_set_size_nil(
 
68
                        adb_deviceMappingType_t* _deviceMappingType,
 
69
                        const axutil_env_t *env);
 
70
            
 
71
 
 
72
                axis2_status_t AXIS2_CALL
 
73
                adb_deviceMappingType_set_format_nil(
 
74
                        adb_deviceMappingType_t* _deviceMappingType,
 
75
                        const axutil_env_t *env);
 
76
            
 
77
 
 
78
 
 
79
       /************************* Function Implmentations ********************************/
 
80
        adb_deviceMappingType_t* AXIS2_CALL
 
81
        adb_deviceMappingType_create(
 
82
            const axutil_env_t *env)
 
83
        {
 
84
            adb_deviceMappingType_t *_deviceMappingType = NULL;
 
85
            
 
86
            AXIS2_ENV_CHECK(env, NULL);
 
87
 
 
88
            _deviceMappingType = (adb_deviceMappingType_t *) AXIS2_MALLOC(env->
 
89
                allocator, sizeof(adb_deviceMappingType_t));
 
90
 
 
91
            if(NULL == _deviceMappingType)
 
92
            {
 
93
                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
 
94
                return NULL;
 
95
            }
 
96
 
 
97
            memset(_deviceMappingType, 0, sizeof(adb_deviceMappingType_t));
 
98
 
 
99
            _deviceMappingType->property_deviceName  = NULL;
 
100
                  _deviceMappingType->is_valid_deviceName  = AXIS2_FALSE;
 
101
            _deviceMappingType->property_virtualName  = NULL;
 
102
                  _deviceMappingType->is_valid_virtualName  = AXIS2_FALSE;
 
103
            _deviceMappingType->is_valid_size  = AXIS2_FALSE;
 
104
            _deviceMappingType->property_format  = NULL;
 
105
                  _deviceMappingType->is_valid_format  = AXIS2_FALSE;
 
106
            
 
107
 
 
108
            return _deviceMappingType;
 
109
        }
 
110
 
 
111
        axis2_status_t AXIS2_CALL
 
112
        adb_deviceMappingType_free (
 
113
                adb_deviceMappingType_t* _deviceMappingType,
 
114
                const axutil_env_t *env)
 
115
        {
 
116
            
 
117
 
 
118
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
119
            AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
120
 
 
121
            adb_deviceMappingType_reset_deviceName(_deviceMappingType, env);
 
122
            adb_deviceMappingType_reset_virtualName(_deviceMappingType, env);
 
123
            adb_deviceMappingType_reset_size(_deviceMappingType, env);
 
124
            adb_deviceMappingType_reset_format(_deviceMappingType, env);
 
125
            
 
126
 
 
127
            if(_deviceMappingType)
 
128
            {
 
129
                AXIS2_FREE(env->allocator, _deviceMappingType);
 
130
                _deviceMappingType = NULL;
 
131
            }
 
132
            return AXIS2_SUCCESS;
 
133
        }
 
134
 
 
135
 
 
136
        
 
137
 
 
138
        axis2_status_t AXIS2_CALL
 
139
        adb_deviceMappingType_deserialize(
 
140
                adb_deviceMappingType_t* _deviceMappingType,
 
141
                const axutil_env_t *env,
 
142
                axiom_node_t **dp_parent,
 
143
                axis2_bool_t *dp_is_early_node_valid,
 
144
                axis2_bool_t dont_care_minoccurs)
 
145
        {
 
146
          axiom_node_t *parent = *dp_parent;
 
147
          
 
148
          axis2_status_t status = AXIS2_SUCCESS;
 
149
           
 
150
             axis2_char_t* text_value = NULL;
 
151
             axutil_qname_t *qname = NULL;
 
152
          
 
153
            axutil_qname_t *element_qname = NULL; 
 
154
            
 
155
               axiom_node_t *first_node = NULL;
 
156
               axis2_bool_t is_early_node_valid = AXIS2_TRUE;
 
157
               axiom_node_t *current_node = NULL;
 
158
               axiom_element_t *current_element = NULL;
 
159
            
 
160
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
161
            AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
162
 
 
163
            
 
164
              
 
165
              while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
 
166
              {
 
167
                  parent = axiom_node_get_next_sibling(parent, env);
 
168
              }
 
169
              if (NULL == parent)
 
170
              {
 
171
                /* This should be checked before everything */
 
172
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
 
173
                            "Failed in building adb object for deviceMappingType : "
 
174
                            "NULL elemenet can not be passed to deserialize");
 
175
                return AXIS2_FAILURE;
 
176
              }
 
177
              
 
178
                      
 
179
                      first_node = axiom_node_get_first_child(parent, env);
 
180
                      
 
181
                    
 
182
 
 
183
                     
 
184
                     /*
 
185
                      * building deviceName element
 
186
                      */
 
187
                     
 
188
                     
 
189
                     
 
190
                                   current_node = first_node;
 
191
                                   is_early_node_valid = AXIS2_FALSE;
 
192
                                   
 
193
                                   
 
194
                                    while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
195
                                    {
 
196
                                        current_node = axiom_node_get_next_sibling(current_node, env);
 
197
                                    }
 
198
                                    if(current_node != NULL)
 
199
                                    {
 
200
                                        current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
201
                                        qname = axiom_element_get_qname(current_element, env, current_node);
 
202
                                    }
 
203
                                   
 
204
                                 element_qname = axutil_qname_create(env, "deviceName", "http://eucalyptus.ucsb.edu/", NULL);
 
205
                                 
 
206
 
 
207
                           if ( 
 
208
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
209
                           {
 
210
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
211
                              {
 
212
                                is_early_node_valid = AXIS2_TRUE;
 
213
                              }
 
214
                              
 
215
                                 
 
216
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
217
                                      if(text_value != NULL)
 
218
                                      {
 
219
                                            status = adb_deviceMappingType_set_deviceName(_deviceMappingType, env,
 
220
                                                               text_value);
 
221
                                      }
 
222
                                      
 
223
                                      else
 
224
                                      {
 
225
                                            /*
 
226
                                             * axis2_qname_t *qname = NULL;
 
227
                                             * axiom_attribute_t *the_attri = NULL;
 
228
                                             * 
 
229
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
230
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
231
                                             */
 
232
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
233
 
 
234
                                            axiom_attribute_t *the_attri = NULL;
 
235
                                            axis2_char_t *attrib_text = NULL;
 
236
                                            axutil_hash_t *attribute_hash = NULL;
 
237
 
 
238
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
239
 
 
240
                                            attrib_text = NULL;
 
241
                                            if(attribute_hash)
 
242
                                            {
 
243
                                                 axutil_hash_index_t *hi;
 
244
                                                 void *val;
 
245
                                                 const void *key;
 
246
                                        
 
247
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
248
                                                 {
 
249
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
250
                                                     
 
251
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
252
                                                     {
 
253
                                                         the_attri = (axiom_attribute_t*)val;
 
254
                                                         break;
 
255
                                                     }
 
256
                                                 }
 
257
                                            }
 
258
 
 
259
                                            if(the_attri)
 
260
                                            {
 
261
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
262
                                            }
 
263
                                            else
 
264
                                            {
 
265
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
266
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
267
                                            }
 
268
 
 
269
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
270
                                            {
 
271
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element deviceName");
 
272
                                                status = AXIS2_FAILURE;
 
273
                                            }
 
274
                                            else
 
275
                                            {
 
276
                                                /* after all, we found this is a empty string */
 
277
                                                status = adb_deviceMappingType_set_deviceName(_deviceMappingType, env,
 
278
                                                                   "");
 
279
                                            }
 
280
                                      }
 
281
                                      
 
282
                                 if(AXIS2_FAILURE ==  status)
 
283
                                 {
 
284
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for deviceName ");
 
285
                                     if(element_qname)
 
286
                                     {
 
287
                                         axutil_qname_free(element_qname, env);
 
288
                                     }
 
289
                                     return AXIS2_FAILURE;
 
290
                                 }
 
291
                              }
 
292
                           
 
293
                  if(element_qname)
 
294
                  {
 
295
                     axutil_qname_free(element_qname, env);
 
296
                     element_qname = NULL;
 
297
                  }
 
298
                 
 
299
 
 
300
                     
 
301
                     /*
 
302
                      * building virtualName element
 
303
                      */
 
304
                     
 
305
                     
 
306
                     
 
307
                                    /*
 
308
                                     * because elements are ordered this works fine
 
309
                                     */
 
310
                                  
 
311
                                   
 
312
                                   if(current_node != NULL && is_early_node_valid)
 
313
                                   {
 
314
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
315
                                       
 
316
                                       
 
317
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
318
                                        {
 
319
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
320
                                        }
 
321
                                        if(current_node != NULL)
 
322
                                        {
 
323
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
324
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
325
                                        }
 
326
                                       
 
327
                                   }
 
328
                                   is_early_node_valid = AXIS2_FALSE;
 
329
                                 
 
330
                                 element_qname = axutil_qname_create(env, "virtualName", "http://eucalyptus.ucsb.edu/", NULL);
 
331
                                 
 
332
 
 
333
                           if ( 
 
334
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
335
                           {
 
336
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
337
                              {
 
338
                                is_early_node_valid = AXIS2_TRUE;
 
339
                              }
 
340
                              
 
341
                                 
 
342
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
343
                                      if(text_value != NULL)
 
344
                                      {
 
345
                                            status = adb_deviceMappingType_set_virtualName(_deviceMappingType, env,
 
346
                                                               text_value);
 
347
                                      }
 
348
                                      
 
349
                                      else
 
350
                                      {
 
351
                                            /*
 
352
                                             * axis2_qname_t *qname = NULL;
 
353
                                             * axiom_attribute_t *the_attri = NULL;
 
354
                                             * 
 
355
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
356
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
357
                                             */
 
358
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
359
 
 
360
                                            axiom_attribute_t *the_attri = NULL;
 
361
                                            axis2_char_t *attrib_text = NULL;
 
362
                                            axutil_hash_t *attribute_hash = NULL;
 
363
 
 
364
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
365
 
 
366
                                            attrib_text = NULL;
 
367
                                            if(attribute_hash)
 
368
                                            {
 
369
                                                 axutil_hash_index_t *hi;
 
370
                                                 void *val;
 
371
                                                 const void *key;
 
372
                                        
 
373
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
374
                                                 {
 
375
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
376
                                                     
 
377
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
378
                                                     {
 
379
                                                         the_attri = (axiom_attribute_t*)val;
 
380
                                                         break;
 
381
                                                     }
 
382
                                                 }
 
383
                                            }
 
384
 
 
385
                                            if(the_attri)
 
386
                                            {
 
387
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
388
                                            }
 
389
                                            else
 
390
                                            {
 
391
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
392
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
393
                                            }
 
394
 
 
395
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
396
                                            {
 
397
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element virtualName");
 
398
                                                status = AXIS2_FAILURE;
 
399
                                            }
 
400
                                            else
 
401
                                            {
 
402
                                                /* after all, we found this is a empty string */
 
403
                                                status = adb_deviceMappingType_set_virtualName(_deviceMappingType, env,
 
404
                                                                   "");
 
405
                                            }
 
406
                                      }
 
407
                                      
 
408
                                 if(AXIS2_FAILURE ==  status)
 
409
                                 {
 
410
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for virtualName ");
 
411
                                     if(element_qname)
 
412
                                     {
 
413
                                         axutil_qname_free(element_qname, env);
 
414
                                     }
 
415
                                     return AXIS2_FAILURE;
 
416
                                 }
 
417
                              }
 
418
                           
 
419
                  if(element_qname)
 
420
                  {
 
421
                     axutil_qname_free(element_qname, env);
 
422
                     element_qname = NULL;
 
423
                  }
 
424
                 
 
425
 
 
426
                     
 
427
                     /*
 
428
                      * building size element
 
429
                      */
 
430
                     
 
431
                     
 
432
                     
 
433
                                    /*
 
434
                                     * because elements are ordered this works fine
 
435
                                     */
 
436
                                  
 
437
                                   
 
438
                                   if(current_node != NULL && is_early_node_valid)
 
439
                                   {
 
440
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
441
                                       
 
442
                                       
 
443
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
444
                                        {
 
445
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
446
                                        }
 
447
                                        if(current_node != NULL)
 
448
                                        {
 
449
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
450
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
451
                                        }
 
452
                                       
 
453
                                   }
 
454
                                   is_early_node_valid = AXIS2_FALSE;
 
455
                                 
 
456
                                 element_qname = axutil_qname_create(env, "size", "http://eucalyptus.ucsb.edu/", NULL);
 
457
                                 
 
458
 
 
459
                           if ( 
 
460
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
461
                           {
 
462
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
463
                              {
 
464
                                is_early_node_valid = AXIS2_TRUE;
 
465
                              }
 
466
                              
 
467
                                 
 
468
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
469
                                      if(text_value != NULL)
 
470
                                      {
 
471
                                            status = adb_deviceMappingType_set_size(_deviceMappingType, env,
 
472
                                                                   atoi(text_value));
 
473
                                      }
 
474
                                      
 
475
                                      else
 
476
                                      {
 
477
                                          AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element size");
 
478
                                          status = AXIS2_FAILURE;
 
479
                                      }
 
480
                                      
 
481
                                 if(AXIS2_FAILURE ==  status)
 
482
                                 {
 
483
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for size ");
 
484
                                     if(element_qname)
 
485
                                     {
 
486
                                         axutil_qname_free(element_qname, env);
 
487
                                     }
 
488
                                     return AXIS2_FAILURE;
 
489
                                 }
 
490
                              }
 
491
                           
 
492
                  if(element_qname)
 
493
                  {
 
494
                     axutil_qname_free(element_qname, env);
 
495
                     element_qname = NULL;
 
496
                  }
 
497
                 
 
498
 
 
499
                     
 
500
                     /*
 
501
                      * building format element
 
502
                      */
 
503
                     
 
504
                     
 
505
                     
 
506
                                    /*
 
507
                                     * because elements are ordered this works fine
 
508
                                     */
 
509
                                  
 
510
                                   
 
511
                                   if(current_node != NULL && is_early_node_valid)
 
512
                                   {
 
513
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
514
                                       
 
515
                                       
 
516
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
517
                                        {
 
518
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
519
                                        }
 
520
                                        if(current_node != NULL)
 
521
                                        {
 
522
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
523
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
524
                                        }
 
525
                                       
 
526
                                   }
 
527
                                   is_early_node_valid = AXIS2_FALSE;
 
528
                                 
 
529
                                 element_qname = axutil_qname_create(env, "format", "http://eucalyptus.ucsb.edu/", NULL);
 
530
                                 
 
531
 
 
532
                           if ( 
 
533
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
534
                           {
 
535
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
536
                              {
 
537
                                is_early_node_valid = AXIS2_TRUE;
 
538
                              }
 
539
                              
 
540
                                 
 
541
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
542
                                      if(text_value != NULL)
 
543
                                      {
 
544
                                            status = adb_deviceMappingType_set_format(_deviceMappingType, env,
 
545
                                                               text_value);
 
546
                                      }
 
547
                                      
 
548
                                      else
 
549
                                      {
 
550
                                            /*
 
551
                                             * axis2_qname_t *qname = NULL;
 
552
                                             * axiom_attribute_t *the_attri = NULL;
 
553
                                             * 
 
554
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
555
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
556
                                             */
 
557
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
558
 
 
559
                                            axiom_attribute_t *the_attri = NULL;
 
560
                                            axis2_char_t *attrib_text = NULL;
 
561
                                            axutil_hash_t *attribute_hash = NULL;
 
562
 
 
563
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
564
 
 
565
                                            attrib_text = NULL;
 
566
                                            if(attribute_hash)
 
567
                                            {
 
568
                                                 axutil_hash_index_t *hi;
 
569
                                                 void *val;
 
570
                                                 const void *key;
 
571
                                        
 
572
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
573
                                                 {
 
574
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
575
                                                     
 
576
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
577
                                                     {
 
578
                                                         the_attri = (axiom_attribute_t*)val;
 
579
                                                         break;
 
580
                                                     }
 
581
                                                 }
 
582
                                            }
 
583
 
 
584
                                            if(the_attri)
 
585
                                            {
 
586
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
587
                                            }
 
588
                                            else
 
589
                                            {
 
590
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
591
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
592
                                            }
 
593
 
 
594
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
595
                                            {
 
596
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element format");
 
597
                                                status = AXIS2_FAILURE;
 
598
                                            }
 
599
                                            else
 
600
                                            {
 
601
                                                /* after all, we found this is a empty string */
 
602
                                                status = adb_deviceMappingType_set_format(_deviceMappingType, env,
 
603
                                                                   "");
 
604
                                            }
 
605
                                      }
 
606
                                      
 
607
                                 if(AXIS2_FAILURE ==  status)
 
608
                                 {
 
609
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for format ");
 
610
                                     if(element_qname)
 
611
                                     {
 
612
                                         axutil_qname_free(element_qname, env);
 
613
                                     }
 
614
                                     return AXIS2_FAILURE;
 
615
                                 }
 
616
                              }
 
617
                           
 
618
                  if(element_qname)
 
619
                  {
 
620
                     axutil_qname_free(element_qname, env);
 
621
                     element_qname = NULL;
 
622
                  }
 
623
                 
 
624
          return status;
 
625
       }
 
626
 
 
627
          axis2_bool_t AXIS2_CALL
 
628
          adb_deviceMappingType_is_particle()
 
629
          {
 
630
            
 
631
                 return AXIS2_FALSE;
 
632
              
 
633
          }
 
634
 
 
635
 
 
636
          void AXIS2_CALL
 
637
          adb_deviceMappingType_declare_parent_namespaces(
 
638
                    adb_deviceMappingType_t* _deviceMappingType,
 
639
                    const axutil_env_t *env, axiom_element_t *parent_element,
 
640
                    axutil_hash_t *namespaces, int *next_ns_index)
 
641
          {
 
642
            
 
643
                  /* Here this is an empty function, Nothing to declare */
 
644
                 
 
645
          }
 
646
 
 
647
        
 
648
        
 
649
        axiom_node_t* AXIS2_CALL
 
650
        adb_deviceMappingType_serialize(
 
651
                adb_deviceMappingType_t* _deviceMappingType,
 
652
                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)
 
653
        {
 
654
            
 
655
            
 
656
             axis2_char_t *string_to_stream;
 
657
            
 
658
         
 
659
         axiom_node_t *current_node = NULL;
 
660
         int tag_closed = 0;
 
661
 
 
662
         
 
663
         
 
664
                axiom_namespace_t *ns1 = NULL;
 
665
 
 
666
                axis2_char_t *qname_uri = NULL;
 
667
                axis2_char_t *qname_prefix = NULL;
 
668
                axis2_char_t *p_prefix = NULL;
 
669
                axis2_bool_t ns_already_defined;
 
670
            
 
671
                    axis2_char_t *text_value_1;
 
672
                    axis2_char_t *text_value_1_temp;
 
673
                    
 
674
                    axis2_char_t *text_value_2;
 
675
                    axis2_char_t *text_value_2_temp;
 
676
                    
 
677
                    axis2_char_t text_value_3[64];
 
678
                    
 
679
                    axis2_char_t *text_value_4;
 
680
                    axis2_char_t *text_value_4_temp;
 
681
                    
 
682
               axis2_char_t *start_input_str = NULL;
 
683
               axis2_char_t *end_input_str = NULL;
 
684
               unsigned int start_input_str_len = 0;
 
685
               unsigned int end_input_str_len = 0;
 
686
            
 
687
            
 
688
               axiom_data_source_t *data_source = NULL;
 
689
               axutil_stream_t *stream = NULL;
 
690
 
 
691
            
 
692
 
 
693
            AXIS2_ENV_CHECK(env, NULL);
 
694
            AXIS2_PARAM_CHECK(env->error, _deviceMappingType, NULL);
 
695
            
 
696
            
 
697
                    current_node = parent;
 
698
                    data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
 
699
                    if (!data_source)
 
700
                        return NULL;
 
701
                    stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
 
702
                    if (!stream)
 
703
                        return NULL;
 
704
                  
 
705
            if(!parent_tag_closed)
 
706
            {
 
707
            
 
708
              string_to_stream = ">"; 
 
709
              axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
 
710
              tag_closed = 1;
 
711
            
 
712
            }
 
713
            
 
714
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
715
                       {
 
716
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
717
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
718
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
719
                           
 
720
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
721
                                            "http://eucalyptus.ucsb.edu/",
 
722
                                            p_prefix));
 
723
                       }
 
724
                      
 
725
 
 
726
                   if (!_deviceMappingType->is_valid_deviceName)
 
727
                   {
 
728
                      
 
729
                           /* no need to complain for minoccurs=0 element */
 
730
                            
 
731
                          
 
732
                   }
 
733
                   else
 
734
                   {
 
735
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
736
                                 (4 + axutil_strlen(p_prefix) + 
 
737
                                  axutil_strlen("deviceName"))); 
 
738
                                 
 
739
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
740
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
741
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("deviceName")));
 
742
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
743
                                  
 
744
                     
 
745
 
 
746
                   
 
747
                   
 
748
                     
 
749
                     /*
 
750
                      * parsing deviceName element
 
751
                      */
 
752
 
 
753
                    
 
754
                    
 
755
                            sprintf(start_input_str, "<%s%sdeviceName>",
 
756
                                 p_prefix?p_prefix:"",
 
757
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
758
                            
 
759
                        start_input_str_len = axutil_strlen(start_input_str);
 
760
                        sprintf(end_input_str, "</%s%sdeviceName>",
 
761
                                 p_prefix?p_prefix:"",
 
762
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
763
                        end_input_str_len = axutil_strlen(end_input_str);
 
764
                    
 
765
                           text_value_1 = _deviceMappingType->property_deviceName;
 
766
                           
 
767
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
768
                           
 
769
                            
 
770
                           text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE);
 
771
                           if (text_value_1_temp)
 
772
                           {
 
773
                               axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp));
 
774
                               AXIS2_FREE(env->allocator, text_value_1_temp);
 
775
                           }
 
776
                           else
 
777
                           {
 
778
                               axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
 
779
                           }
 
780
                           
 
781
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
782
                           
 
783
                     
 
784
                     AXIS2_FREE(env->allocator,start_input_str);
 
785
                     AXIS2_FREE(env->allocator,end_input_str);
 
786
                 } 
 
787
 
 
788
                 
 
789
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
790
                       {
 
791
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
792
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
793
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
794
                           
 
795
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
796
                                            "http://eucalyptus.ucsb.edu/",
 
797
                                            p_prefix));
 
798
                       }
 
799
                      
 
800
 
 
801
                   if (!_deviceMappingType->is_valid_virtualName)
 
802
                   {
 
803
                      
 
804
                           /* no need to complain for minoccurs=0 element */
 
805
                            
 
806
                          
 
807
                   }
 
808
                   else
 
809
                   {
 
810
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
811
                                 (4 + axutil_strlen(p_prefix) + 
 
812
                                  axutil_strlen("virtualName"))); 
 
813
                                 
 
814
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
815
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
816
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("virtualName")));
 
817
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
818
                                  
 
819
                     
 
820
 
 
821
                   
 
822
                   
 
823
                     
 
824
                     /*
 
825
                      * parsing virtualName element
 
826
                      */
 
827
 
 
828
                    
 
829
                    
 
830
                            sprintf(start_input_str, "<%s%svirtualName>",
 
831
                                 p_prefix?p_prefix:"",
 
832
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
833
                            
 
834
                        start_input_str_len = axutil_strlen(start_input_str);
 
835
                        sprintf(end_input_str, "</%s%svirtualName>",
 
836
                                 p_prefix?p_prefix:"",
 
837
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
838
                        end_input_str_len = axutil_strlen(end_input_str);
 
839
                    
 
840
                           text_value_2 = _deviceMappingType->property_virtualName;
 
841
                           
 
842
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
843
                           
 
844
                            
 
845
                           text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
 
846
                           if (text_value_2_temp)
 
847
                           {
 
848
                               axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp));
 
849
                               AXIS2_FREE(env->allocator, text_value_2_temp);
 
850
                           }
 
851
                           else
 
852
                           {
 
853
                               axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
 
854
                           }
 
855
                           
 
856
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
857
                           
 
858
                     
 
859
                     AXIS2_FREE(env->allocator,start_input_str);
 
860
                     AXIS2_FREE(env->allocator,end_input_str);
 
861
                 } 
 
862
 
 
863
                 
 
864
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
865
                       {
 
866
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
867
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
868
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
869
                           
 
870
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
871
                                            "http://eucalyptus.ucsb.edu/",
 
872
                                            p_prefix));
 
873
                       }
 
874
                      
 
875
 
 
876
                   if (!_deviceMappingType->is_valid_size)
 
877
                   {
 
878
                      
 
879
                           /* no need to complain for minoccurs=0 element */
 
880
                            
 
881
                          
 
882
                   }
 
883
                   else
 
884
                   {
 
885
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
886
                                 (4 + axutil_strlen(p_prefix) + 
 
887
                                  axutil_strlen("size"))); 
 
888
                                 
 
889
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
890
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
891
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("size")));
 
892
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
893
                                  
 
894
                     
 
895
 
 
896
                   
 
897
                   
 
898
                     
 
899
                     /*
 
900
                      * parsing size element
 
901
                      */
 
902
 
 
903
                    
 
904
                    
 
905
                            sprintf(start_input_str, "<%s%ssize>",
 
906
                                 p_prefix?p_prefix:"",
 
907
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
908
                            
 
909
                        start_input_str_len = axutil_strlen(start_input_str);
 
910
                        sprintf(end_input_str, "</%s%ssize>",
 
911
                                 p_prefix?p_prefix:"",
 
912
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
913
                        end_input_str_len = axutil_strlen(end_input_str);
 
914
                    
 
915
                               sprintf (text_value_3, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _deviceMappingType->property_size);
 
916
                             
 
917
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
918
                           
 
919
                           axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
 
920
                           
 
921
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
922
                           
 
923
                     
 
924
                     AXIS2_FREE(env->allocator,start_input_str);
 
925
                     AXIS2_FREE(env->allocator,end_input_str);
 
926
                 } 
 
927
 
 
928
                 
 
929
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
930
                       {
 
931
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
932
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
933
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
934
                           
 
935
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
936
                                            "http://eucalyptus.ucsb.edu/",
 
937
                                            p_prefix));
 
938
                       }
 
939
                      
 
940
 
 
941
                   if (!_deviceMappingType->is_valid_format)
 
942
                   {
 
943
                      
 
944
                           /* no need to complain for minoccurs=0 element */
 
945
                            
 
946
                          
 
947
                   }
 
948
                   else
 
949
                   {
 
950
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
951
                                 (4 + axutil_strlen(p_prefix) + 
 
952
                                  axutil_strlen("format"))); 
 
953
                                 
 
954
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
955
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
956
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("format")));
 
957
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
958
                                  
 
959
                     
 
960
 
 
961
                   
 
962
                   
 
963
                     
 
964
                     /*
 
965
                      * parsing format element
 
966
                      */
 
967
 
 
968
                    
 
969
                    
 
970
                            sprintf(start_input_str, "<%s%sformat>",
 
971
                                 p_prefix?p_prefix:"",
 
972
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
973
                            
 
974
                        start_input_str_len = axutil_strlen(start_input_str);
 
975
                        sprintf(end_input_str, "</%s%sformat>",
 
976
                                 p_prefix?p_prefix:"",
 
977
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
978
                        end_input_str_len = axutil_strlen(end_input_str);
 
979
                    
 
980
                           text_value_4 = _deviceMappingType->property_format;
 
981
                           
 
982
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
983
                           
 
984
                            
 
985
                           text_value_4_temp = axutil_xml_quote_string(env, text_value_4, AXIS2_TRUE);
 
986
                           if (text_value_4_temp)
 
987
                           {
 
988
                               axutil_stream_write(stream, env, text_value_4_temp, axutil_strlen(text_value_4_temp));
 
989
                               AXIS2_FREE(env->allocator, text_value_4_temp);
 
990
                           }
 
991
                           else
 
992
                           {
 
993
                               axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
 
994
                           }
 
995
                           
 
996
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
997
                           
 
998
                     
 
999
                     AXIS2_FREE(env->allocator,start_input_str);
 
1000
                     AXIS2_FREE(env->allocator,end_input_str);
 
1001
                 } 
 
1002
 
 
1003
                 
 
1004
 
 
1005
            return parent;
 
1006
        }
 
1007
 
 
1008
 
 
1009
        
 
1010
 
 
1011
            /**
 
1012
             * getter for deviceName.
 
1013
             */
 
1014
            axis2_char_t* AXIS2_CALL
 
1015
            adb_deviceMappingType_get_deviceName(
 
1016
                    adb_deviceMappingType_t* _deviceMappingType,
 
1017
                    const axutil_env_t *env)
 
1018
             {
 
1019
                
 
1020
                    AXIS2_ENV_CHECK(env, NULL);
 
1021
                    AXIS2_PARAM_CHECK(env->error, _deviceMappingType, NULL);
 
1022
                  
 
1023
 
 
1024
                return _deviceMappingType->property_deviceName;
 
1025
             }
 
1026
 
 
1027
            /**
 
1028
             * setter for deviceName
 
1029
             */
 
1030
            axis2_status_t AXIS2_CALL
 
1031
            adb_deviceMappingType_set_deviceName(
 
1032
                    adb_deviceMappingType_t* _deviceMappingType,
 
1033
                    const axutil_env_t *env,
 
1034
                    const axis2_char_t*  arg_deviceName)
 
1035
             {
 
1036
                
 
1037
 
 
1038
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1039
                AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1040
                
 
1041
                if(_deviceMappingType->is_valid_deviceName &&
 
1042
                        arg_deviceName == _deviceMappingType->property_deviceName)
 
1043
                {
 
1044
                    
 
1045
                    return AXIS2_SUCCESS; 
 
1046
                }
 
1047
 
 
1048
                adb_deviceMappingType_reset_deviceName(_deviceMappingType, env);
 
1049
 
 
1050
                
 
1051
                if(NULL == arg_deviceName)
 
1052
                {
 
1053
                    /* We are already done */
 
1054
                    return AXIS2_SUCCESS;
 
1055
                }
 
1056
                _deviceMappingType->property_deviceName = (axis2_char_t *)axutil_strdup(env, arg_deviceName);
 
1057
                        if(NULL == _deviceMappingType->property_deviceName)
 
1058
                        {
 
1059
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for deviceName");
 
1060
                            return AXIS2_FAILURE;
 
1061
                        }
 
1062
                        _deviceMappingType->is_valid_deviceName = AXIS2_TRUE;
 
1063
                    
 
1064
                return AXIS2_SUCCESS;
 
1065
             }
 
1066
 
 
1067
             
 
1068
 
 
1069
           /**
 
1070
            * resetter for deviceName
 
1071
            */
 
1072
           axis2_status_t AXIS2_CALL
 
1073
           adb_deviceMappingType_reset_deviceName(
 
1074
                   adb_deviceMappingType_t* _deviceMappingType,
 
1075
                   const axutil_env_t *env)
 
1076
           {
 
1077
               int i = 0;
 
1078
               int count = 0;
 
1079
               void *element = NULL;
 
1080
 
 
1081
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1082
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1083
               
 
1084
 
 
1085
               
 
1086
            
 
1087
                
 
1088
                if(_deviceMappingType->property_deviceName != NULL)
 
1089
                {
 
1090
                   
 
1091
                   
 
1092
                        AXIS2_FREE(env-> allocator, _deviceMappingType->property_deviceName);
 
1093
                     _deviceMappingType->property_deviceName = NULL;
 
1094
                }
 
1095
            
 
1096
                
 
1097
                
 
1098
                _deviceMappingType->is_valid_deviceName = AXIS2_FALSE; 
 
1099
               return AXIS2_SUCCESS;
 
1100
           }
 
1101
 
 
1102
           /**
 
1103
            * Check whether deviceName is nill
 
1104
            */
 
1105
           axis2_bool_t AXIS2_CALL
 
1106
           adb_deviceMappingType_is_deviceName_nil(
 
1107
                   adb_deviceMappingType_t* _deviceMappingType,
 
1108
                   const axutil_env_t *env)
 
1109
           {
 
1110
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1111
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_TRUE);
 
1112
               
 
1113
               return !_deviceMappingType->is_valid_deviceName;
 
1114
           }
 
1115
 
 
1116
           /**
 
1117
            * Set deviceName to nill (currently the same as reset)
 
1118
            */
 
1119
           axis2_status_t AXIS2_CALL
 
1120
           adb_deviceMappingType_set_deviceName_nil(
 
1121
                   adb_deviceMappingType_t* _deviceMappingType,
 
1122
                   const axutil_env_t *env)
 
1123
           {
 
1124
               return adb_deviceMappingType_reset_deviceName(_deviceMappingType, env);
 
1125
           }
 
1126
 
 
1127
           
 
1128
 
 
1129
            /**
 
1130
             * getter for virtualName.
 
1131
             */
 
1132
            axis2_char_t* AXIS2_CALL
 
1133
            adb_deviceMappingType_get_virtualName(
 
1134
                    adb_deviceMappingType_t* _deviceMappingType,
 
1135
                    const axutil_env_t *env)
 
1136
             {
 
1137
                
 
1138
                    AXIS2_ENV_CHECK(env, NULL);
 
1139
                    AXIS2_PARAM_CHECK(env->error, _deviceMappingType, NULL);
 
1140
                  
 
1141
 
 
1142
                return _deviceMappingType->property_virtualName;
 
1143
             }
 
1144
 
 
1145
            /**
 
1146
             * setter for virtualName
 
1147
             */
 
1148
            axis2_status_t AXIS2_CALL
 
1149
            adb_deviceMappingType_set_virtualName(
 
1150
                    adb_deviceMappingType_t* _deviceMappingType,
 
1151
                    const axutil_env_t *env,
 
1152
                    const axis2_char_t*  arg_virtualName)
 
1153
             {
 
1154
                
 
1155
 
 
1156
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1157
                AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1158
                
 
1159
                if(_deviceMappingType->is_valid_virtualName &&
 
1160
                        arg_virtualName == _deviceMappingType->property_virtualName)
 
1161
                {
 
1162
                    
 
1163
                    return AXIS2_SUCCESS; 
 
1164
                }
 
1165
 
 
1166
                adb_deviceMappingType_reset_virtualName(_deviceMappingType, env);
 
1167
 
 
1168
                
 
1169
                if(NULL == arg_virtualName)
 
1170
                {
 
1171
                    /* We are already done */
 
1172
                    return AXIS2_SUCCESS;
 
1173
                }
 
1174
                _deviceMappingType->property_virtualName = (axis2_char_t *)axutil_strdup(env, arg_virtualName);
 
1175
                        if(NULL == _deviceMappingType->property_virtualName)
 
1176
                        {
 
1177
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for virtualName");
 
1178
                            return AXIS2_FAILURE;
 
1179
                        }
 
1180
                        _deviceMappingType->is_valid_virtualName = AXIS2_TRUE;
 
1181
                    
 
1182
                return AXIS2_SUCCESS;
 
1183
             }
 
1184
 
 
1185
             
 
1186
 
 
1187
           /**
 
1188
            * resetter for virtualName
 
1189
            */
 
1190
           axis2_status_t AXIS2_CALL
 
1191
           adb_deviceMappingType_reset_virtualName(
 
1192
                   adb_deviceMappingType_t* _deviceMappingType,
 
1193
                   const axutil_env_t *env)
 
1194
           {
 
1195
               int i = 0;
 
1196
               int count = 0;
 
1197
               void *element = NULL;
 
1198
 
 
1199
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1200
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1201
               
 
1202
 
 
1203
               
 
1204
            
 
1205
                
 
1206
                if(_deviceMappingType->property_virtualName != NULL)
 
1207
                {
 
1208
                   
 
1209
                   
 
1210
                        AXIS2_FREE(env-> allocator, _deviceMappingType->property_virtualName);
 
1211
                     _deviceMappingType->property_virtualName = NULL;
 
1212
                }
 
1213
            
 
1214
                
 
1215
                
 
1216
                _deviceMappingType->is_valid_virtualName = AXIS2_FALSE; 
 
1217
               return AXIS2_SUCCESS;
 
1218
           }
 
1219
 
 
1220
           /**
 
1221
            * Check whether virtualName is nill
 
1222
            */
 
1223
           axis2_bool_t AXIS2_CALL
 
1224
           adb_deviceMappingType_is_virtualName_nil(
 
1225
                   adb_deviceMappingType_t* _deviceMappingType,
 
1226
                   const axutil_env_t *env)
 
1227
           {
 
1228
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1229
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_TRUE);
 
1230
               
 
1231
               return !_deviceMappingType->is_valid_virtualName;
 
1232
           }
 
1233
 
 
1234
           /**
 
1235
            * Set virtualName to nill (currently the same as reset)
 
1236
            */
 
1237
           axis2_status_t AXIS2_CALL
 
1238
           adb_deviceMappingType_set_virtualName_nil(
 
1239
                   adb_deviceMappingType_t* _deviceMappingType,
 
1240
                   const axutil_env_t *env)
 
1241
           {
 
1242
               return adb_deviceMappingType_reset_virtualName(_deviceMappingType, env);
 
1243
           }
 
1244
 
 
1245
           
 
1246
 
 
1247
            /**
 
1248
             * getter for size.
 
1249
             */
 
1250
            int AXIS2_CALL
 
1251
            adb_deviceMappingType_get_size(
 
1252
                    adb_deviceMappingType_t* _deviceMappingType,
 
1253
                    const axutil_env_t *env)
 
1254
             {
 
1255
                
 
1256
                    AXIS2_ENV_CHECK(env, (int)0);
 
1257
                    AXIS2_PARAM_CHECK(env->error, _deviceMappingType, (int)0);
 
1258
                  
 
1259
 
 
1260
                return _deviceMappingType->property_size;
 
1261
             }
 
1262
 
 
1263
            /**
 
1264
             * setter for size
 
1265
             */
 
1266
            axis2_status_t AXIS2_CALL
 
1267
            adb_deviceMappingType_set_size(
 
1268
                    adb_deviceMappingType_t* _deviceMappingType,
 
1269
                    const axutil_env_t *env,
 
1270
                    const int  arg_size)
 
1271
             {
 
1272
                
 
1273
 
 
1274
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1275
                AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1276
                
 
1277
                if(_deviceMappingType->is_valid_size &&
 
1278
                        arg_size == _deviceMappingType->property_size)
 
1279
                {
 
1280
                    
 
1281
                    return AXIS2_SUCCESS; 
 
1282
                }
 
1283
 
 
1284
                adb_deviceMappingType_reset_size(_deviceMappingType, env);
 
1285
 
 
1286
                _deviceMappingType->property_size = arg_size;
 
1287
                        _deviceMappingType->is_valid_size = AXIS2_TRUE;
 
1288
                    
 
1289
                return AXIS2_SUCCESS;
 
1290
             }
 
1291
 
 
1292
             
 
1293
 
 
1294
           /**
 
1295
            * resetter for size
 
1296
            */
 
1297
           axis2_status_t AXIS2_CALL
 
1298
           adb_deviceMappingType_reset_size(
 
1299
                   adb_deviceMappingType_t* _deviceMappingType,
 
1300
                   const axutil_env_t *env)
 
1301
           {
 
1302
               int i = 0;
 
1303
               int count = 0;
 
1304
               void *element = NULL;
 
1305
 
 
1306
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1307
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1308
               
 
1309
 
 
1310
               _deviceMappingType->is_valid_size = AXIS2_FALSE; 
 
1311
               return AXIS2_SUCCESS;
 
1312
           }
 
1313
 
 
1314
           /**
 
1315
            * Check whether size is nill
 
1316
            */
 
1317
           axis2_bool_t AXIS2_CALL
 
1318
           adb_deviceMappingType_is_size_nil(
 
1319
                   adb_deviceMappingType_t* _deviceMappingType,
 
1320
                   const axutil_env_t *env)
 
1321
           {
 
1322
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1323
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_TRUE);
 
1324
               
 
1325
               return !_deviceMappingType->is_valid_size;
 
1326
           }
 
1327
 
 
1328
           /**
 
1329
            * Set size to nill (currently the same as reset)
 
1330
            */
 
1331
           axis2_status_t AXIS2_CALL
 
1332
           adb_deviceMappingType_set_size_nil(
 
1333
                   adb_deviceMappingType_t* _deviceMappingType,
 
1334
                   const axutil_env_t *env)
 
1335
           {
 
1336
               return adb_deviceMappingType_reset_size(_deviceMappingType, env);
 
1337
           }
 
1338
 
 
1339
           
 
1340
 
 
1341
            /**
 
1342
             * getter for format.
 
1343
             */
 
1344
            axis2_char_t* AXIS2_CALL
 
1345
            adb_deviceMappingType_get_format(
 
1346
                    adb_deviceMappingType_t* _deviceMappingType,
 
1347
                    const axutil_env_t *env)
 
1348
             {
 
1349
                
 
1350
                    AXIS2_ENV_CHECK(env, NULL);
 
1351
                    AXIS2_PARAM_CHECK(env->error, _deviceMappingType, NULL);
 
1352
                  
 
1353
 
 
1354
                return _deviceMappingType->property_format;
 
1355
             }
 
1356
 
 
1357
            /**
 
1358
             * setter for format
 
1359
             */
 
1360
            axis2_status_t AXIS2_CALL
 
1361
            adb_deviceMappingType_set_format(
 
1362
                    adb_deviceMappingType_t* _deviceMappingType,
 
1363
                    const axutil_env_t *env,
 
1364
                    const axis2_char_t*  arg_format)
 
1365
             {
 
1366
                
 
1367
 
 
1368
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1369
                AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1370
                
 
1371
                if(_deviceMappingType->is_valid_format &&
 
1372
                        arg_format == _deviceMappingType->property_format)
 
1373
                {
 
1374
                    
 
1375
                    return AXIS2_SUCCESS; 
 
1376
                }
 
1377
 
 
1378
                adb_deviceMappingType_reset_format(_deviceMappingType, env);
 
1379
 
 
1380
                
 
1381
                if(NULL == arg_format)
 
1382
                {
 
1383
                    /* We are already done */
 
1384
                    return AXIS2_SUCCESS;
 
1385
                }
 
1386
                _deviceMappingType->property_format = (axis2_char_t *)axutil_strdup(env, arg_format);
 
1387
                        if(NULL == _deviceMappingType->property_format)
 
1388
                        {
 
1389
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for format");
 
1390
                            return AXIS2_FAILURE;
 
1391
                        }
 
1392
                        _deviceMappingType->is_valid_format = AXIS2_TRUE;
 
1393
                    
 
1394
                return AXIS2_SUCCESS;
 
1395
             }
 
1396
 
 
1397
             
 
1398
 
 
1399
           /**
 
1400
            * resetter for format
 
1401
            */
 
1402
           axis2_status_t AXIS2_CALL
 
1403
           adb_deviceMappingType_reset_format(
 
1404
                   adb_deviceMappingType_t* _deviceMappingType,
 
1405
                   const axutil_env_t *env)
 
1406
           {
 
1407
               int i = 0;
 
1408
               int count = 0;
 
1409
               void *element = NULL;
 
1410
 
 
1411
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1412
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_FAILURE);
 
1413
               
 
1414
 
 
1415
               
 
1416
            
 
1417
                
 
1418
                if(_deviceMappingType->property_format != NULL)
 
1419
                {
 
1420
                   
 
1421
                   
 
1422
                        AXIS2_FREE(env-> allocator, _deviceMappingType->property_format);
 
1423
                     _deviceMappingType->property_format = NULL;
 
1424
                }
 
1425
            
 
1426
                
 
1427
                
 
1428
                _deviceMappingType->is_valid_format = AXIS2_FALSE; 
 
1429
               return AXIS2_SUCCESS;
 
1430
           }
 
1431
 
 
1432
           /**
 
1433
            * Check whether format is nill
 
1434
            */
 
1435
           axis2_bool_t AXIS2_CALL
 
1436
           adb_deviceMappingType_is_format_nil(
 
1437
                   adb_deviceMappingType_t* _deviceMappingType,
 
1438
                   const axutil_env_t *env)
 
1439
           {
 
1440
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1441
               AXIS2_PARAM_CHECK(env->error, _deviceMappingType, AXIS2_TRUE);
 
1442
               
 
1443
               return !_deviceMappingType->is_valid_format;
 
1444
           }
 
1445
 
 
1446
           /**
 
1447
            * Set format to nill (currently the same as reset)
 
1448
            */
 
1449
           axis2_status_t AXIS2_CALL
 
1450
           adb_deviceMappingType_set_format_nil(
 
1451
                   adb_deviceMappingType_t* _deviceMappingType,
 
1452
                   const axutil_env_t *env)
 
1453
           {
 
1454
               return adb_deviceMappingType_reset_format(_deviceMappingType, env);
 
1455
           }
 
1456
 
 
1457
           
 
1458