~kirkland/+junk/eucalyptus

« back to all changes in this revision

Viewing changes to cluster/generated/adb_networkType.c

  • Committer: Dustin Kirkland
  • Date: 2010-06-15 17:54:01 UTC
  • mfrom: (1034.1.12 core-devel)
  • Revision ID: kirkland@x200-20100615175401-c2ogiz5jq03sfn4f
Tags: 1.6.2+bzr1230-0ubuntu1
releasing version 1.6.2+bzr1230-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
        /**
 
4
         * adb_networkType.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_networkType.h"
 
11
 
 
12
                /*
 
13
                 * This type was generated from the piece of schema that had
 
14
                 * name = networkType
 
15
                 * Namespace URI = http://eucalyptus.ucsb.edu/
 
16
                 * Namespace Prefix = ns1
 
17
                 */
 
18
 
 
19
 
 
20
 
 
21
        struct adb_networkType
 
22
        {
 
23
            int property_vlan;
 
24
 
 
25
 
 
26
                axis2_bool_t is_valid_vlan;
 
27
 
 
28
 
 
29
            axis2_char_t* property_netName;
 
30
 
 
31
 
 
32
                axis2_bool_t is_valid_netName;
 
33
 
 
34
 
 
35
            axis2_char_t* property_userName;
 
36
 
 
37
 
 
38
                axis2_bool_t is_valid_userName;
 
39
 
 
40
 
 
41
            axutil_array_list_t* property_activeAddrs;
 
42
 
 
43
 
 
44
                axis2_bool_t is_valid_activeAddrs;
 
45
 
 
46
 
 
47
 
 
48
        };
 
49
 
 
50
 
 
51
       /************************* Private Function prototypes ********************************/
 
52
 
 
53
 
 
54
                axis2_status_t AXIS2_CALL
 
55
                adb_networkType_set_vlan_nil(
 
56
                        adb_networkType_t* _networkType,
 
57
                        const axutil_env_t *env);
 
58
 
 
59
 
 
60
                axis2_status_t AXIS2_CALL
 
61
                adb_networkType_set_netName_nil(
 
62
                        adb_networkType_t* _networkType,
 
63
                        const axutil_env_t *env);
 
64
 
 
65
 
 
66
                axis2_status_t AXIS2_CALL
 
67
                adb_networkType_set_userName_nil(
 
68
                        adb_networkType_t* _networkType,
 
69
                        const axutil_env_t *env);
 
70
 
 
71
                 axis2_status_t AXIS2_CALL
 
72
                 adb_networkType_set_activeAddrs_nil_at(
 
73
                        adb_networkType_t* _networkType,
 
74
                        const axutil_env_t *env, int i);
 
75
 
 
76
 
 
77
                axis2_status_t AXIS2_CALL
 
78
                adb_networkType_set_activeAddrs_nil(
 
79
                        adb_networkType_t* _networkType,
 
80
                        const axutil_env_t *env);
 
81
 
 
82
 
 
83
 
 
84
       /************************* Function Implmentations ********************************/
 
85
        adb_networkType_t* AXIS2_CALL
 
86
        adb_networkType_create(
 
87
            const axutil_env_t *env)
 
88
        {
 
89
            adb_networkType_t *_networkType = NULL;
 
90
 
 
91
            AXIS2_ENV_CHECK(env, NULL);
 
92
 
 
93
            _networkType = (adb_networkType_t *) AXIS2_MALLOC(env->
 
94
                allocator, sizeof(adb_networkType_t));
 
95
 
 
96
            if(NULL == _networkType)
 
97
            {
 
98
                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
 
99
                return NULL;
 
100
            }
 
101
 
 
102
            memset(_networkType, 0, sizeof(adb_networkType_t));
 
103
 
 
104
            _networkType->is_valid_vlan  = AXIS2_FALSE;
 
105
            _networkType->property_netName  = NULL;
 
106
                  _networkType->is_valid_netName  = AXIS2_FALSE;
 
107
            _networkType->property_userName  = NULL;
 
108
                  _networkType->is_valid_userName  = AXIS2_FALSE;
 
109
            _networkType->is_valid_activeAddrs  = AXIS2_FALSE;
 
110
 
 
111
 
 
112
            return _networkType;
 
113
        }
 
114
 
 
115
        axis2_status_t AXIS2_CALL
 
116
        adb_networkType_free (
 
117
                adb_networkType_t* _networkType,
 
118
                const axutil_env_t *env)
 
119
        {
 
120
 
 
121
                int i = 0;
 
122
                int count = 0;
 
123
                void *element = NULL;
 
124
 
 
125
 
 
126
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
127
            AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
128
 
 
129
            adb_networkType_reset_vlan(_networkType, env);
 
130
            adb_networkType_reset_netName(_networkType, env);
 
131
            adb_networkType_reset_userName(_networkType, env);
 
132
            adb_networkType_reset_activeAddrs(_networkType, env);
 
133
 
 
134
 
 
135
            if(_networkType)
 
136
            {
 
137
                AXIS2_FREE(env->allocator, _networkType);
 
138
                _networkType = NULL;
 
139
            }
 
140
            return AXIS2_SUCCESS;
 
141
        }
 
142
 
 
143
 
 
144
 
 
145
 
 
146
        axis2_status_t AXIS2_CALL
 
147
        adb_networkType_deserialize(
 
148
                adb_networkType_t* _networkType,
 
149
                const axutil_env_t *env,
 
150
                axiom_node_t **dp_parent,
 
151
                axis2_bool_t *dp_is_early_node_valid,
 
152
                axis2_bool_t dont_care_minoccurs)
 
153
        {
 
154
          axiom_node_t *parent = *dp_parent;
 
155
 
 
156
          axis2_status_t status = AXIS2_SUCCESS;
 
157
 
 
158
              void *element = NULL;
 
159
 
 
160
             axis2_char_t* text_value = NULL;
 
161
             axutil_qname_t *qname = NULL;
 
162
 
 
163
               int i = 0;
 
164
               axutil_array_list_t *arr_list = NULL;
 
165
 
 
166
               int sequence_broken = 0;
 
167
               axiom_node_t *tmp_node = NULL;
 
168
 
 
169
            axutil_qname_t *element_qname = NULL;
 
170
 
 
171
               axiom_node_t *first_node = NULL;
 
172
               axis2_bool_t is_early_node_valid = AXIS2_TRUE;
 
173
               axiom_node_t *current_node = NULL;
 
174
               axiom_element_t *current_element = NULL;
 
175
 
 
176
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
177
            AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
178
 
 
179
 
 
180
 
 
181
              while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
 
182
              {
 
183
                  parent = axiom_node_get_next_sibling(parent, env);
 
184
              }
 
185
              if (NULL == parent)
 
186
              {
 
187
                /* This should be checked before everything */
 
188
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
 
189
                            "Failed in building adb object for networkType : "
 
190
                            "NULL elemenet can not be passed to deserialize");
 
191
                return AXIS2_FAILURE;
 
192
              }
 
193
 
 
194
 
 
195
                      first_node = axiom_node_get_first_child(parent, env);
 
196
 
 
197
 
 
198
 
 
199
 
 
200
                     /*
 
201
                      * building vlan element
 
202
                      */
 
203
 
 
204
 
 
205
 
 
206
                                   current_node = first_node;
 
207
                                   is_early_node_valid = AXIS2_FALSE;
 
208
 
 
209
 
 
210
                                    while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
211
                                    {
 
212
                                        current_node = axiom_node_get_next_sibling(current_node, env);
 
213
                                    }
 
214
                                    if(current_node != NULL)
 
215
                                    {
 
216
                                        current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
217
                                        qname = axiom_element_get_qname(current_element, env, current_node);
 
218
                                    }
 
219
 
 
220
                                 element_qname = axutil_qname_create(env, "vlan", "http://eucalyptus.ucsb.edu/", NULL);
 
221
 
 
222
 
 
223
                           if (
 
224
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
225
                           {
 
226
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
227
                              {
 
228
                                is_early_node_valid = AXIS2_TRUE;
 
229
                              }
 
230
 
 
231
 
 
232
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
233
                                      if(text_value != NULL)
 
234
                                      {
 
235
                                            status = adb_networkType_set_vlan(_networkType, env,
 
236
                                                                   atoi(text_value));
 
237
                                      }
 
238
 
 
239
                                      else
 
240
                                      {
 
241
                                          AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element vlan");
 
242
                                          status = AXIS2_FAILURE;
 
243
                                      }
 
244
 
 
245
                                 if(AXIS2_FAILURE ==  status)
 
246
                                 {
 
247
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for vlan ");
 
248
                                     if(element_qname)
 
249
                                     {
 
250
                                         axutil_qname_free(element_qname, env);
 
251
                                     }
 
252
                                     return AXIS2_FAILURE;
 
253
                                 }
 
254
                              }
 
255
 
 
256
                              else if(!dont_care_minoccurs)
 
257
                              {
 
258
                                  if(element_qname)
 
259
                                  {
 
260
                                      axutil_qname_free(element_qname, env);
 
261
                                  }
 
262
                                  /* this is not a nillable element*/
 
263
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element vlan missing");
 
264
                                  return AXIS2_FAILURE;
 
265
                              }
 
266
 
 
267
                  if(element_qname)
 
268
                  {
 
269
                     axutil_qname_free(element_qname, env);
 
270
                     element_qname = NULL;
 
271
                  }
 
272
 
 
273
 
 
274
 
 
275
                     /*
 
276
                      * building netName element
 
277
                      */
 
278
 
 
279
 
 
280
 
 
281
                                    /*
 
282
                                     * because elements are ordered this works fine
 
283
                                     */
 
284
 
 
285
 
 
286
                                   if(current_node != NULL && is_early_node_valid)
 
287
                                   {
 
288
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
289
 
 
290
 
 
291
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
292
                                        {
 
293
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
294
                                        }
 
295
                                        if(current_node != NULL)
 
296
                                        {
 
297
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
298
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
299
                                        }
 
300
 
 
301
                                   }
 
302
                                   is_early_node_valid = AXIS2_FALSE;
 
303
 
 
304
                                 element_qname = axutil_qname_create(env, "netName", "http://eucalyptus.ucsb.edu/", NULL);
 
305
 
 
306
 
 
307
                           if (
 
308
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
309
                           {
 
310
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
311
                              {
 
312
                                is_early_node_valid = AXIS2_TRUE;
 
313
                              }
 
314
 
 
315
 
 
316
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
317
                                      if(text_value != NULL)
 
318
                                      {
 
319
                                            status = adb_networkType_set_netName(_networkType, env,
 
320
                                                               text_value);
 
321
                                      }
 
322
 
 
323
                                      else
 
324
                                      {
 
325
                                            /*
 
326
                                             * axis2_qname_t *qname = NULL;
 
327
                                             * axiom_attribute_t *the_attri = NULL;
 
328
                                             *
 
329
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
330
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
331
                                             */
 
332
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
333
 
 
334
                                            axiom_attribute_t *the_attri = NULL;
 
335
                                            axis2_char_t *attrib_text = NULL;
 
336
                                            axutil_hash_t *attribute_hash = NULL;
 
337
 
 
338
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
339
 
 
340
                                            attrib_text = NULL;
 
341
                                            if(attribute_hash)
 
342
                                            {
 
343
                                                 axutil_hash_index_t *hi;
 
344
                                                 void *val;
 
345
                                                 const void *key;
 
346
 
 
347
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
 
348
                                                 {
 
349
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
350
 
 
351
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
352
                                                     {
 
353
                                                         the_attri = (axiom_attribute_t*)val;
 
354
                                                         break;
 
355
                                                     }
 
356
                                                 }
 
357
                                            }
 
358
 
 
359
                                            if(the_attri)
 
360
                                            {
 
361
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
362
                                            }
 
363
                                            else
 
364
                                            {
 
365
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
366
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
367
                                            }
 
368
 
 
369
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
370
                                            {
 
371
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element netName");
 
372
                                                status = AXIS2_FAILURE;
 
373
                                            }
 
374
                                            else
 
375
                                            {
 
376
                                                /* after all, we found this is a empty string */
 
377
                                                status = adb_networkType_set_netName(_networkType, env,
 
378
                                                                   "");
 
379
                                            }
 
380
                                      }
 
381
 
 
382
                                 if(AXIS2_FAILURE ==  status)
 
383
                                 {
 
384
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for netName ");
 
385
                                     if(element_qname)
 
386
                                     {
 
387
                                         axutil_qname_free(element_qname, env);
 
388
                                     }
 
389
                                     return AXIS2_FAILURE;
 
390
                                 }
 
391
                              }
 
392
 
 
393
                              else if(!dont_care_minoccurs)
 
394
                              {
 
395
                                  if(element_qname)
 
396
                                  {
 
397
                                      axutil_qname_free(element_qname, env);
 
398
                                  }
 
399
                                  /* this is not a nillable element*/
 
400
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element netName missing");
 
401
                                  return AXIS2_FAILURE;
 
402
                              }
 
403
 
 
404
                  if(element_qname)
 
405
                  {
 
406
                     axutil_qname_free(element_qname, env);
 
407
                     element_qname = NULL;
 
408
                  }
 
409
 
 
410
 
 
411
 
 
412
                     /*
 
413
                      * building userName element
 
414
                      */
 
415
 
 
416
 
 
417
 
 
418
                                    /*
 
419
                                     * because elements are ordered this works fine
 
420
                                     */
 
421
 
 
422
 
 
423
                                   if(current_node != NULL && is_early_node_valid)
 
424
                                   {
 
425
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
426
 
 
427
 
 
428
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
429
                                        {
 
430
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
431
                                        }
 
432
                                        if(current_node != NULL)
 
433
                                        {
 
434
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
435
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
436
                                        }
 
437
 
 
438
                                   }
 
439
                                   is_early_node_valid = AXIS2_FALSE;
 
440
 
 
441
                                 element_qname = axutil_qname_create(env, "userName", "http://eucalyptus.ucsb.edu/", NULL);
 
442
 
 
443
 
 
444
                           if (
 
445
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
446
                           {
 
447
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
448
                              {
 
449
                                is_early_node_valid = AXIS2_TRUE;
 
450
                              }
 
451
 
 
452
 
 
453
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
454
                                      if(text_value != NULL)
 
455
                                      {
 
456
                                            status = adb_networkType_set_userName(_networkType, env,
 
457
                                                               text_value);
 
458
                                      }
 
459
 
 
460
                                      else
 
461
                                      {
 
462
                                            /*
 
463
                                             * axis2_qname_t *qname = NULL;
 
464
                                             * axiom_attribute_t *the_attri = NULL;
 
465
                                             *
 
466
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
467
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
468
                                             */
 
469
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
470
 
 
471
                                            axiom_attribute_t *the_attri = NULL;
 
472
                                            axis2_char_t *attrib_text = NULL;
 
473
                                            axutil_hash_t *attribute_hash = NULL;
 
474
 
 
475
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
476
 
 
477
                                            attrib_text = NULL;
 
478
                                            if(attribute_hash)
 
479
                                            {
 
480
                                                 axutil_hash_index_t *hi;
 
481
                                                 void *val;
 
482
                                                 const void *key;
 
483
 
 
484
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi))
 
485
                                                 {
 
486
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
487
 
 
488
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
489
                                                     {
 
490
                                                         the_attri = (axiom_attribute_t*)val;
 
491
                                                         break;
 
492
                                                     }
 
493
                                                 }
 
494
                                            }
 
495
 
 
496
                                            if(the_attri)
 
497
                                            {
 
498
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
499
                                            }
 
500
                                            else
 
501
                                            {
 
502
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
503
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
504
                                            }
 
505
 
 
506
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
507
                                            {
 
508
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element userName");
 
509
                                                status = AXIS2_FAILURE;
 
510
                                            }
 
511
                                            else
 
512
                                            {
 
513
                                                /* after all, we found this is a empty string */
 
514
                                                status = adb_networkType_set_userName(_networkType, env,
 
515
                                                                   "");
 
516
                                            }
 
517
                                      }
 
518
 
 
519
                                 if(AXIS2_FAILURE ==  status)
 
520
                                 {
 
521
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for userName ");
 
522
                                     if(element_qname)
 
523
                                     {
 
524
                                         axutil_qname_free(element_qname, env);
 
525
                                     }
 
526
                                     return AXIS2_FAILURE;
 
527
                                 }
 
528
                              }
 
529
 
 
530
                              else if(!dont_care_minoccurs)
 
531
                              {
 
532
                                  if(element_qname)
 
533
                                  {
 
534
                                      axutil_qname_free(element_qname, env);
 
535
                                  }
 
536
                                  /* this is not a nillable element*/
 
537
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element userName missing");
 
538
                                  return AXIS2_FAILURE;
 
539
                              }
 
540
 
 
541
                  if(element_qname)
 
542
                  {
 
543
                     axutil_qname_free(element_qname, env);
 
544
                     element_qname = NULL;
 
545
                  }
 
546
 
 
547
                    /*
 
548
                     * building activeAddrs array
 
549
                     */
 
550
                       arr_list = axutil_array_list_create(env, 10);
 
551
 
 
552
 
 
553
 
 
554
                     /*
 
555
                      * building activeAddrs element
 
556
                      */
 
557
 
 
558
 
 
559
 
 
560
                                    element_qname = axutil_qname_create(env, "activeAddrs", "http://eucalyptus.ucsb.edu/", NULL);
 
561
 
 
562
 
 
563
                               for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, env):current_node); !sequence_broken && current_node != NULL;)
 
564
 
 
565
                               {
 
566
                                  if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
567
                                  {
 
568
                                     current_node =axiom_node_get_next_sibling(current_node, env);
 
569
                                     is_early_node_valid = AXIS2_FALSE;
 
570
                                     continue;
 
571
                                  }
 
572
 
 
573
                                  current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
574
                                  qname = axiom_element_get_qname(current_element, env, current_node);
 
575
 
 
576
                                  if (axutil_qname_equals(element_qname, env, qname))
 
577
                                  {
 
578
 
 
579
                                      is_early_node_valid = AXIS2_TRUE;
 
580
 
 
581
 
 
582
                                          text_value = axiom_element_get_text(current_element, env, current_node);
 
583
                                          if(text_value != NULL)
 
584
                                          {
 
585
                                              /* we keeps ints in arrays from their pointers */
 
586
                                              element = AXIS2_MALLOC(env-> allocator, sizeof(int));
 
587
                                              (*(int*)element) = atoi(text_value);
 
588
                                              axutil_array_list_add_at(arr_list, env, i, element);
 
589
                                          }
 
590
 
 
591
                                          else
 
592
                                          {
 
593
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element activeAddrs");
 
594
                                                status = AXIS2_FAILURE;
 
595
                                          }
 
596
 
 
597
                                     if(AXIS2_FAILURE ==  status)
 
598
                                     {
 
599
                                         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for activeAddrs ");
 
600
                                         if(element_qname)
 
601
                                         {
 
602
                                            axutil_qname_free(element_qname, env);
 
603
                                         }
 
604
                                         if(arr_list)
 
605
                                         {
 
606
                                            axutil_array_list_free(arr_list, env);
 
607
                                         }
 
608
                                         return AXIS2_FAILURE;
 
609
                                     }
 
610
 
 
611
                                     i ++;
 
612
                                    current_node = axiom_node_get_next_sibling(current_node, env);
 
613
                                  }
 
614
                                  else
 
615
                                  {
 
616
                                      is_early_node_valid = AXIS2_FALSE;
 
617
                                      sequence_broken = 1;
 
618
                                  }
 
619
 
 
620
                               }
 
621
 
 
622
 
 
623
                                   if (i < 0)
 
624
                                   {
 
625
                                     /* found element out of order */
 
626
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "activeAddrs (@minOccurs = '0') only have %d elements", i);
 
627
                                     if(element_qname)
 
628
                                     {
 
629
                                        axutil_qname_free(element_qname, env);
 
630
                                     }
 
631
                                     if(arr_list)
 
632
                                     {
 
633
                                        axutil_array_list_free(arr_list, env);
 
634
                                     }
 
635
                                     return AXIS2_FAILURE;
 
636
                                   }
 
637
 
 
638
 
 
639
                               if(0 == axutil_array_list_size(arr_list,env))
 
640
                               {
 
641
                                    axutil_array_list_free(arr_list, env);
 
642
                               }
 
643
                               else
 
644
                               {
 
645
                                    status = adb_networkType_set_activeAddrs(_networkType, env,
 
646
                                                                   arr_list);
 
647
                               }
 
648
 
 
649
 
 
650
                  if(element_qname)
 
651
                  {
 
652
                     axutil_qname_free(element_qname, env);
 
653
                     element_qname = NULL;
 
654
                  }
 
655
 
 
656
          return status;
 
657
       }
 
658
 
 
659
          axis2_bool_t AXIS2_CALL
 
660
          adb_networkType_is_particle()
 
661
          {
 
662
 
 
663
                 return AXIS2_FALSE;
 
664
 
 
665
          }
 
666
 
 
667
 
 
668
          void AXIS2_CALL
 
669
          adb_networkType_declare_parent_namespaces(
 
670
                    adb_networkType_t* _networkType,
 
671
                    const axutil_env_t *env, axiom_element_t *parent_element,
 
672
                    axutil_hash_t *namespaces, int *next_ns_index)
 
673
          {
 
674
 
 
675
                  /* Here this is an empty function, Nothing to declare */
 
676
 
 
677
          }
 
678
 
 
679
 
 
680
 
 
681
        axiom_node_t* AXIS2_CALL
 
682
        adb_networkType_serialize(
 
683
                adb_networkType_t* _networkType,
 
684
                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)
 
685
        {
 
686
 
 
687
 
 
688
             axis2_char_t *string_to_stream;
 
689
 
 
690
 
 
691
         axiom_node_t *current_node = NULL;
 
692
         int tag_closed = 0;
 
693
 
 
694
 
 
695
 
 
696
                axiom_namespace_t *ns1 = NULL;
 
697
 
 
698
                axis2_char_t *qname_uri = NULL;
 
699
                axis2_char_t *qname_prefix = NULL;
 
700
                axis2_char_t *p_prefix = NULL;
 
701
                axis2_bool_t ns_already_defined;
 
702
 
 
703
               int i = 0;
 
704
               int count = 0;
 
705
               void *element = NULL;
 
706
 
 
707
                    axis2_char_t text_value_1[64];
 
708
 
 
709
                    axis2_char_t *text_value_2;
 
710
                    axis2_char_t *text_value_2_temp;
 
711
 
 
712
                    axis2_char_t *text_value_3;
 
713
                    axis2_char_t *text_value_3_temp;
 
714
 
 
715
                    axis2_char_t text_value_4[64];
 
716
 
 
717
               axis2_char_t *start_input_str = NULL;
 
718
               axis2_char_t *end_input_str = NULL;
 
719
               unsigned int start_input_str_len = 0;
 
720
               unsigned int end_input_str_len = 0;
 
721
 
 
722
 
 
723
               axiom_data_source_t *data_source = NULL;
 
724
               axutil_stream_t *stream = NULL;
 
725
 
 
726
 
 
727
 
 
728
            AXIS2_ENV_CHECK(env, NULL);
 
729
            AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
 
730
 
 
731
 
 
732
                    current_node = parent;
 
733
                    data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
 
734
                    if (!data_source)
 
735
                        return NULL;
 
736
                    stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
 
737
                    if (!stream)
 
738
                        return NULL;
 
739
 
 
740
            if(!parent_tag_closed)
 
741
            {
 
742
 
 
743
              string_to_stream = ">";
 
744
              axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
 
745
              tag_closed = 1;
 
746
 
 
747
            }
 
748
 
 
749
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
750
                       {
 
751
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
752
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
753
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
754
 
 
755
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
756
                                            "http://eucalyptus.ucsb.edu/",
 
757
                                            p_prefix));
 
758
                       }
 
759
 
 
760
 
 
761
                   if (!_networkType->is_valid_vlan)
 
762
                   {
 
763
 
 
764
 
 
765
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property vlan");
 
766
                            return NULL;
 
767
 
 
768
                   }
 
769
                   else
 
770
                   {
 
771
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
772
                                 (4 + axutil_strlen(p_prefix) +
 
773
                                  axutil_strlen("vlan")));
 
774
 
 
775
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
776
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
777
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("vlan")));
 
778
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
779
 
 
780
 
 
781
 
 
782
 
 
783
 
 
784
 
 
785
                     /*
 
786
                      * parsing vlan element
 
787
                      */
 
788
 
 
789
 
 
790
 
 
791
                            sprintf(start_input_str, "<%s%svlan>",
 
792
                                 p_prefix?p_prefix:"",
 
793
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
794
 
 
795
                        start_input_str_len = axutil_strlen(start_input_str);
 
796
                        sprintf(end_input_str, "</%s%svlan>",
 
797
                                 p_prefix?p_prefix:"",
 
798
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
799
                        end_input_str_len = axutil_strlen(end_input_str);
 
800
 
 
801
                               sprintf (text_value_1, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _networkType->property_vlan);
 
802
 
 
803
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
804
 
 
805
                           axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
 
806
 
 
807
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
808
 
 
809
 
 
810
                     AXIS2_FREE(env->allocator,start_input_str);
 
811
                     AXIS2_FREE(env->allocator,end_input_str);
 
812
                 }
 
813
 
 
814
 
 
815
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
816
                       {
 
817
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
818
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
819
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
820
 
 
821
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
822
                                            "http://eucalyptus.ucsb.edu/",
 
823
                                            p_prefix));
 
824
                       }
 
825
 
 
826
 
 
827
                   if (!_networkType->is_valid_netName)
 
828
                   {
 
829
 
 
830
 
 
831
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property netName");
 
832
                            return NULL;
 
833
 
 
834
                   }
 
835
                   else
 
836
                   {
 
837
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
838
                                 (4 + axutil_strlen(p_prefix) +
 
839
                                  axutil_strlen("netName")));
 
840
 
 
841
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
842
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
843
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("netName")));
 
844
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
845
 
 
846
 
 
847
 
 
848
 
 
849
 
 
850
 
 
851
                     /*
 
852
                      * parsing netName element
 
853
                      */
 
854
 
 
855
 
 
856
 
 
857
                            sprintf(start_input_str, "<%s%snetName>",
 
858
                                 p_prefix?p_prefix:"",
 
859
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
860
 
 
861
                        start_input_str_len = axutil_strlen(start_input_str);
 
862
                        sprintf(end_input_str, "</%s%snetName>",
 
863
                                 p_prefix?p_prefix:"",
 
864
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
865
                        end_input_str_len = axutil_strlen(end_input_str);
 
866
 
 
867
                           text_value_2 = _networkType->property_netName;
 
868
 
 
869
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
870
 
 
871
 
 
872
                           text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
 
873
                           if (text_value_2_temp)
 
874
                           {
 
875
                               axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp));
 
876
                               AXIS2_FREE(env->allocator, text_value_2_temp);
 
877
                           }
 
878
                           else
 
879
                           {
 
880
                               axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
 
881
                           }
 
882
 
 
883
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
884
 
 
885
 
 
886
                     AXIS2_FREE(env->allocator,start_input_str);
 
887
                     AXIS2_FREE(env->allocator,end_input_str);
 
888
                 }
 
889
 
 
890
 
 
891
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
892
                       {
 
893
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
894
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
895
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
896
 
 
897
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
898
                                            "http://eucalyptus.ucsb.edu/",
 
899
                                            p_prefix));
 
900
                       }
 
901
 
 
902
 
 
903
                   if (!_networkType->is_valid_userName)
 
904
                   {
 
905
 
 
906
 
 
907
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property userName");
 
908
                            return NULL;
 
909
 
 
910
                   }
 
911
                   else
 
912
                   {
 
913
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
914
                                 (4 + axutil_strlen(p_prefix) +
 
915
                                  axutil_strlen("userName")));
 
916
 
 
917
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
918
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
919
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("userName")));
 
920
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
921
 
 
922
 
 
923
 
 
924
 
 
925
 
 
926
 
 
927
                     /*
 
928
                      * parsing userName element
 
929
                      */
 
930
 
 
931
 
 
932
 
 
933
                            sprintf(start_input_str, "<%s%suserName>",
 
934
                                 p_prefix?p_prefix:"",
 
935
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
936
 
 
937
                        start_input_str_len = axutil_strlen(start_input_str);
 
938
                        sprintf(end_input_str, "</%s%suserName>",
 
939
                                 p_prefix?p_prefix:"",
 
940
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
941
                        end_input_str_len = axutil_strlen(end_input_str);
 
942
 
 
943
                           text_value_3 = _networkType->property_userName;
 
944
 
 
945
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
946
 
 
947
 
 
948
                           text_value_3_temp = axutil_xml_quote_string(env, text_value_3, AXIS2_TRUE);
 
949
                           if (text_value_3_temp)
 
950
                           {
 
951
                               axutil_stream_write(stream, env, text_value_3_temp, axutil_strlen(text_value_3_temp));
 
952
                               AXIS2_FREE(env->allocator, text_value_3_temp);
 
953
                           }
 
954
                           else
 
955
                           {
 
956
                               axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
 
957
                           }
 
958
 
 
959
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
960
 
 
961
 
 
962
                     AXIS2_FREE(env->allocator,start_input_str);
 
963
                     AXIS2_FREE(env->allocator,end_input_str);
 
964
                 }
 
965
 
 
966
 
 
967
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
968
                       {
 
969
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
970
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
971
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
972
 
 
973
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
974
                                            "http://eucalyptus.ucsb.edu/",
 
975
                                            p_prefix));
 
976
                       }
 
977
 
 
978
 
 
979
                   if (!_networkType->is_valid_activeAddrs)
 
980
                   {
 
981
 
 
982
                           /* no need to complain for minoccurs=0 element */
 
983
 
 
984
 
 
985
                   }
 
986
                   else
 
987
                   {
 
988
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
989
                                 (4 + axutil_strlen(p_prefix) +
 
990
                                  axutil_strlen("activeAddrs")));
 
991
 
 
992
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
993
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
994
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("activeAddrs")));
 
995
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
996
 
 
997
 
 
998
 
 
999
 
 
1000
 
 
1001
                     /*
 
1002
                      * Parsing activeAddrs array
 
1003
                      */
 
1004
                     if (_networkType->property_activeAddrs != NULL)
 
1005
                     {
 
1006
 
 
1007
                            sprintf(start_input_str, "<%s%sactiveAddrs>",
 
1008
                                 p_prefix?p_prefix:"",
 
1009
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1010
 
 
1011
                         start_input_str_len = axutil_strlen(start_input_str);
 
1012
 
 
1013
                         sprintf(end_input_str, "</%s%sactiveAddrs>",
 
1014
                                 p_prefix?p_prefix:"",
 
1015
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1016
                         end_input_str_len = axutil_strlen(end_input_str);
 
1017
 
 
1018
                         count = axutil_array_list_size(_networkType->property_activeAddrs, env);
 
1019
                         for(i = 0; i < count; i ++)
 
1020
                         {
 
1021
                            element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
 
1022
 
 
1023
                            if(NULL == element)
 
1024
                            {
 
1025
                                continue;
 
1026
                            }
 
1027
 
 
1028
 
 
1029
                     /*
 
1030
                      * parsing activeAddrs element
 
1031
                      */
 
1032
 
 
1033
 
 
1034
 
 
1035
                               sprintf (text_value_4, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, *((int*)element));
 
1036
 
 
1037
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
1038
 
 
1039
                           axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
 
1040
 
 
1041
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
1042
 
 
1043
                         }
 
1044
                     }
 
1045
 
 
1046
 
 
1047
                     AXIS2_FREE(env->allocator,start_input_str);
 
1048
                     AXIS2_FREE(env->allocator,end_input_str);
 
1049
                 }
 
1050
 
 
1051
 
 
1052
 
 
1053
            return parent;
 
1054
        }
 
1055
 
 
1056
 
 
1057
 
 
1058
 
 
1059
            /**
 
1060
             * getter for vlan.
 
1061
             */
 
1062
            int AXIS2_CALL
 
1063
            adb_networkType_get_vlan(
 
1064
                    adb_networkType_t* _networkType,
 
1065
                    const axutil_env_t *env)
 
1066
             {
 
1067
 
 
1068
                    AXIS2_ENV_CHECK(env, (int)0);
 
1069
                    AXIS2_PARAM_CHECK(env->error, _networkType, (int)0);
 
1070
 
 
1071
 
 
1072
                return _networkType->property_vlan;
 
1073
             }
 
1074
 
 
1075
            /**
 
1076
             * setter for vlan
 
1077
             */
 
1078
            axis2_status_t AXIS2_CALL
 
1079
            adb_networkType_set_vlan(
 
1080
                    adb_networkType_t* _networkType,
 
1081
                    const axutil_env_t *env,
 
1082
                    const int  arg_vlan)
 
1083
             {
 
1084
 
 
1085
 
 
1086
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1087
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1088
 
 
1089
                if(_networkType->is_valid_vlan &&
 
1090
                        arg_vlan == _networkType->property_vlan)
 
1091
                {
 
1092
 
 
1093
                    return AXIS2_SUCCESS;
 
1094
                }
 
1095
 
 
1096
                adb_networkType_reset_vlan(_networkType, env);
 
1097
 
 
1098
                _networkType->property_vlan = arg_vlan;
 
1099
                        _networkType->is_valid_vlan = AXIS2_TRUE;
 
1100
 
 
1101
                return AXIS2_SUCCESS;
 
1102
             }
 
1103
 
 
1104
 
 
1105
 
 
1106
           /**
 
1107
            * resetter for vlan
 
1108
            */
 
1109
           axis2_status_t AXIS2_CALL
 
1110
           adb_networkType_reset_vlan(
 
1111
                   adb_networkType_t* _networkType,
 
1112
                   const axutil_env_t *env)
 
1113
           {
 
1114
               int i = 0;
 
1115
               int count = 0;
 
1116
               void *element = NULL;
 
1117
 
 
1118
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1119
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1120
 
 
1121
 
 
1122
               _networkType->is_valid_vlan = AXIS2_FALSE;
 
1123
               return AXIS2_SUCCESS;
 
1124
           }
 
1125
 
 
1126
           /**
 
1127
            * Check whether vlan is nill
 
1128
            */
 
1129
           axis2_bool_t AXIS2_CALL
 
1130
           adb_networkType_is_vlan_nil(
 
1131
                   adb_networkType_t* _networkType,
 
1132
                   const axutil_env_t *env)
 
1133
           {
 
1134
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1135
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
 
1136
 
 
1137
               return !_networkType->is_valid_vlan;
 
1138
           }
 
1139
 
 
1140
           /**
 
1141
            * Set vlan to nill (currently the same as reset)
 
1142
            */
 
1143
           axis2_status_t AXIS2_CALL
 
1144
           adb_networkType_set_vlan_nil(
 
1145
                   adb_networkType_t* _networkType,
 
1146
                   const axutil_env_t *env)
 
1147
           {
 
1148
               return adb_networkType_reset_vlan(_networkType, env);
 
1149
           }
 
1150
 
 
1151
 
 
1152
 
 
1153
            /**
 
1154
             * getter for netName.
 
1155
             */
 
1156
            axis2_char_t* AXIS2_CALL
 
1157
            adb_networkType_get_netName(
 
1158
                    adb_networkType_t* _networkType,
 
1159
                    const axutil_env_t *env)
 
1160
             {
 
1161
 
 
1162
                    AXIS2_ENV_CHECK(env, NULL);
 
1163
                    AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
 
1164
 
 
1165
 
 
1166
                return _networkType->property_netName;
 
1167
             }
 
1168
 
 
1169
            /**
 
1170
             * setter for netName
 
1171
             */
 
1172
            axis2_status_t AXIS2_CALL
 
1173
            adb_networkType_set_netName(
 
1174
                    adb_networkType_t* _networkType,
 
1175
                    const axutil_env_t *env,
 
1176
                    const axis2_char_t*  arg_netName)
 
1177
             {
 
1178
 
 
1179
 
 
1180
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1181
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1182
 
 
1183
                if(_networkType->is_valid_netName &&
 
1184
                        arg_netName == _networkType->property_netName)
 
1185
                {
 
1186
 
 
1187
                    return AXIS2_SUCCESS;
 
1188
                }
 
1189
 
 
1190
 
 
1191
                  if(NULL == arg_netName)
 
1192
                  {
 
1193
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "netName is being set to NULL, but it is not a nullable element");
 
1194
                      return AXIS2_FAILURE;
 
1195
                  }
 
1196
                adb_networkType_reset_netName(_networkType, env);
 
1197
 
 
1198
 
 
1199
                if(NULL == arg_netName)
 
1200
                {
 
1201
                    /* We are already done */
 
1202
                    return AXIS2_SUCCESS;
 
1203
                }
 
1204
                _networkType->property_netName = (axis2_char_t *)axutil_strdup(env, arg_netName);
 
1205
                        if(NULL == _networkType->property_netName)
 
1206
                        {
 
1207
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for netName");
 
1208
                            return AXIS2_FAILURE;
 
1209
                        }
 
1210
                        _networkType->is_valid_netName = AXIS2_TRUE;
 
1211
 
 
1212
                return AXIS2_SUCCESS;
 
1213
             }
 
1214
 
 
1215
 
 
1216
 
 
1217
           /**
 
1218
            * resetter for netName
 
1219
            */
 
1220
           axis2_status_t AXIS2_CALL
 
1221
           adb_networkType_reset_netName(
 
1222
                   adb_networkType_t* _networkType,
 
1223
                   const axutil_env_t *env)
 
1224
           {
 
1225
               int i = 0;
 
1226
               int count = 0;
 
1227
               void *element = NULL;
 
1228
 
 
1229
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1230
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1231
 
 
1232
 
 
1233
 
 
1234
 
 
1235
 
 
1236
                if(_networkType->property_netName != NULL)
 
1237
                {
 
1238
 
 
1239
 
 
1240
                        AXIS2_FREE(env-> allocator, _networkType->property_netName);
 
1241
                     _networkType->property_netName = NULL;
 
1242
                }
 
1243
 
 
1244
 
 
1245
 
 
1246
                _networkType->is_valid_netName = AXIS2_FALSE;
 
1247
               return AXIS2_SUCCESS;
 
1248
           }
 
1249
 
 
1250
           /**
 
1251
            * Check whether netName is nill
 
1252
            */
 
1253
           axis2_bool_t AXIS2_CALL
 
1254
           adb_networkType_is_netName_nil(
 
1255
                   adb_networkType_t* _networkType,
 
1256
                   const axutil_env_t *env)
 
1257
           {
 
1258
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1259
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
 
1260
 
 
1261
               return !_networkType->is_valid_netName;
 
1262
           }
 
1263
 
 
1264
           /**
 
1265
            * Set netName to nill (currently the same as reset)
 
1266
            */
 
1267
           axis2_status_t AXIS2_CALL
 
1268
           adb_networkType_set_netName_nil(
 
1269
                   adb_networkType_t* _networkType,
 
1270
                   const axutil_env_t *env)
 
1271
           {
 
1272
               return adb_networkType_reset_netName(_networkType, env);
 
1273
           }
 
1274
 
 
1275
 
 
1276
 
 
1277
            /**
 
1278
             * getter for userName.
 
1279
             */
 
1280
            axis2_char_t* AXIS2_CALL
 
1281
            adb_networkType_get_userName(
 
1282
                    adb_networkType_t* _networkType,
 
1283
                    const axutil_env_t *env)
 
1284
             {
 
1285
 
 
1286
                    AXIS2_ENV_CHECK(env, NULL);
 
1287
                    AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
 
1288
 
 
1289
 
 
1290
                return _networkType->property_userName;
 
1291
             }
 
1292
 
 
1293
            /**
 
1294
             * setter for userName
 
1295
             */
 
1296
            axis2_status_t AXIS2_CALL
 
1297
            adb_networkType_set_userName(
 
1298
                    adb_networkType_t* _networkType,
 
1299
                    const axutil_env_t *env,
 
1300
                    const axis2_char_t*  arg_userName)
 
1301
             {
 
1302
 
 
1303
 
 
1304
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1305
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1306
 
 
1307
                if(_networkType->is_valid_userName &&
 
1308
                        arg_userName == _networkType->property_userName)
 
1309
                {
 
1310
 
 
1311
                    return AXIS2_SUCCESS;
 
1312
                }
 
1313
 
 
1314
 
 
1315
                  if(NULL == arg_userName)
 
1316
                  {
 
1317
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "userName is being set to NULL, but it is not a nullable element");
 
1318
                      return AXIS2_FAILURE;
 
1319
                  }
 
1320
                adb_networkType_reset_userName(_networkType, env);
 
1321
 
 
1322
 
 
1323
                if(NULL == arg_userName)
 
1324
                {
 
1325
                    /* We are already done */
 
1326
                    return AXIS2_SUCCESS;
 
1327
                }
 
1328
                _networkType->property_userName = (axis2_char_t *)axutil_strdup(env, arg_userName);
 
1329
                        if(NULL == _networkType->property_userName)
 
1330
                        {
 
1331
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for userName");
 
1332
                            return AXIS2_FAILURE;
 
1333
                        }
 
1334
                        _networkType->is_valid_userName = AXIS2_TRUE;
 
1335
 
 
1336
                return AXIS2_SUCCESS;
 
1337
             }
 
1338
 
 
1339
 
 
1340
 
 
1341
           /**
 
1342
            * resetter for userName
 
1343
            */
 
1344
           axis2_status_t AXIS2_CALL
 
1345
           adb_networkType_reset_userName(
 
1346
                   adb_networkType_t* _networkType,
 
1347
                   const axutil_env_t *env)
 
1348
           {
 
1349
               int i = 0;
 
1350
               int count = 0;
 
1351
               void *element = NULL;
 
1352
 
 
1353
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1354
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1355
 
 
1356
 
 
1357
 
 
1358
 
 
1359
 
 
1360
                if(_networkType->property_userName != NULL)
 
1361
                {
 
1362
 
 
1363
 
 
1364
                        AXIS2_FREE(env-> allocator, _networkType->property_userName);
 
1365
                     _networkType->property_userName = NULL;
 
1366
                }
 
1367
 
 
1368
 
 
1369
 
 
1370
                _networkType->is_valid_userName = AXIS2_FALSE;
 
1371
               return AXIS2_SUCCESS;
 
1372
           }
 
1373
 
 
1374
           /**
 
1375
            * Check whether userName is nill
 
1376
            */
 
1377
           axis2_bool_t AXIS2_CALL
 
1378
           adb_networkType_is_userName_nil(
 
1379
                   adb_networkType_t* _networkType,
 
1380
                   const axutil_env_t *env)
 
1381
           {
 
1382
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1383
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
 
1384
 
 
1385
               return !_networkType->is_valid_userName;
 
1386
           }
 
1387
 
 
1388
           /**
 
1389
            * Set userName to nill (currently the same as reset)
 
1390
            */
 
1391
           axis2_status_t AXIS2_CALL
 
1392
           adb_networkType_set_userName_nil(
 
1393
                   adb_networkType_t* _networkType,
 
1394
                   const axutil_env_t *env)
 
1395
           {
 
1396
               return adb_networkType_reset_userName(_networkType, env);
 
1397
           }
 
1398
 
 
1399
 
 
1400
 
 
1401
            /**
 
1402
             * getter for activeAddrs.
 
1403
             */
 
1404
            axutil_array_list_t* AXIS2_CALL
 
1405
            adb_networkType_get_activeAddrs(
 
1406
                    adb_networkType_t* _networkType,
 
1407
                    const axutil_env_t *env)
 
1408
             {
 
1409
 
 
1410
                    AXIS2_ENV_CHECK(env, NULL);
 
1411
                    AXIS2_PARAM_CHECK(env->error, _networkType, NULL);
 
1412
 
 
1413
 
 
1414
                return _networkType->property_activeAddrs;
 
1415
             }
 
1416
 
 
1417
            /**
 
1418
             * setter for activeAddrs
 
1419
             */
 
1420
            axis2_status_t AXIS2_CALL
 
1421
            adb_networkType_set_activeAddrs(
 
1422
                    adb_networkType_t* _networkType,
 
1423
                    const axutil_env_t *env,
 
1424
                    axutil_array_list_t*  arg_activeAddrs)
 
1425
             {
 
1426
 
 
1427
                 int size = 0;
 
1428
                 int i = 0;
 
1429
                 axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
1430
 
 
1431
 
 
1432
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1433
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1434
 
 
1435
                if(_networkType->is_valid_activeAddrs &&
 
1436
                        arg_activeAddrs == _networkType->property_activeAddrs)
 
1437
                {
 
1438
 
 
1439
                    return AXIS2_SUCCESS;
 
1440
                }
 
1441
 
 
1442
 
 
1443
                 size = axutil_array_list_size(arg_activeAddrs, env);
 
1444
 
 
1445
                 if (size < 0)
 
1446
                 {
 
1447
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "activeAddrs has less than minOccurs(0)");
 
1448
                     return AXIS2_FAILURE;
 
1449
                 }
 
1450
                 for(i = 0; i < size; i ++ )
 
1451
                 {
 
1452
                     if(NULL != axutil_array_list_get(arg_activeAddrs, env, i))
 
1453
                     {
 
1454
                         non_nil_exists = AXIS2_TRUE;
 
1455
                         break;
 
1456
                     }
 
1457
                 }
 
1458
 
 
1459
                 adb_networkType_reset_activeAddrs(_networkType, env);
 
1460
 
 
1461
 
 
1462
                if(NULL == arg_activeAddrs)
 
1463
                {
 
1464
                    /* We are already done */
 
1465
                    return AXIS2_SUCCESS;
 
1466
                }
 
1467
                _networkType->property_activeAddrs = arg_activeAddrs;
 
1468
                        if(non_nil_exists)
 
1469
                        {
 
1470
                            _networkType->is_valid_activeAddrs = AXIS2_TRUE;
 
1471
                        }
 
1472
 
 
1473
 
 
1474
                return AXIS2_SUCCESS;
 
1475
             }
 
1476
 
 
1477
 
 
1478
            /**
 
1479
             * Get ith element of activeAddrs.
 
1480
             */
 
1481
            int AXIS2_CALL
 
1482
            adb_networkType_get_activeAddrs_at(
 
1483
                    adb_networkType_t* _networkType,
 
1484
                    const axutil_env_t *env, int i)
 
1485
            {
 
1486
                int* ret_val;
 
1487
 
 
1488
 
 
1489
                    AXIS2_ENV_CHECK(env, (int)0);
 
1490
                    AXIS2_PARAM_CHECK(env->error, _networkType, (int)0);
 
1491
 
 
1492
 
 
1493
                if(_networkType->property_activeAddrs == NULL)
 
1494
                {
 
1495
                    return (int)0;
 
1496
                }
 
1497
                ret_val = (int*)axutil_array_list_get(_networkType->property_activeAddrs, env, i);
 
1498
 
 
1499
                    if(ret_val)
 
1500
                    {
 
1501
                        return *ret_val;
 
1502
                    }
 
1503
                    return (int)0;
 
1504
 
 
1505
            }
 
1506
 
 
1507
            /**
 
1508
             * Set the ith element of activeAddrs.
 
1509
             */
 
1510
            axis2_status_t AXIS2_CALL
 
1511
            adb_networkType_set_activeAddrs_at(
 
1512
                    adb_networkType_t* _networkType,
 
1513
                    const axutil_env_t *env, int i,
 
1514
                    const int arg_activeAddrs)
 
1515
            {
 
1516
                void *element = NULL;
 
1517
                int size = 0;
 
1518
                int j;
 
1519
                int k;
 
1520
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
1521
 
 
1522
                int* ptr_param_activeAddrs;
 
1523
 
 
1524
 
 
1525
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1526
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1527
 
 
1528
                if( _networkType->is_valid_activeAddrs &&
 
1529
                    _networkType->property_activeAddrs &&
 
1530
 
 
1531
                    arg_activeAddrs == *((int*)axutil_array_list_get(_networkType->property_activeAddrs, env, i)))
 
1532
 
 
1533
                {
 
1534
 
 
1535
                    return AXIS2_SUCCESS;
 
1536
                }
 
1537
 
 
1538
 
 
1539
                     non_nil_exists = AXIS2_TRUE; /* no way to check for nill for each elements for primitive types */
 
1540
 
 
1541
                if( k < 0)
 
1542
                {
 
1543
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of activeAddrs is beinng set to be smaller than the specificed number of minOccurs(0)");
 
1544
                       return AXIS2_FAILURE;
 
1545
                }
 
1546
 
 
1547
                if(_networkType->property_activeAddrs == NULL)
 
1548
                {
 
1549
                    _networkType->property_activeAddrs = axutil_array_list_create(env, 10);
 
1550
                }
 
1551
 
 
1552
                /* check whether there already exist an element */
 
1553
                element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
 
1554
                if(NULL != element)
 
1555
                {
 
1556
 
 
1557
 
 
1558
 
 
1559
 
 
1560
                        /* we keep primtives as pointers in arrasy, so need to free them */
 
1561
                        AXIS2_FREE(env-> allocator, element);
 
1562
 
 
1563
                }
 
1564
 
 
1565
 
 
1566
                    if(!non_nil_exists)
 
1567
                    {
 
1568
 
 
1569
                        _networkType->is_valid_activeAddrs = AXIS2_FALSE;
 
1570
                        axutil_array_list_set(_networkType->property_activeAddrs , env, i, NULL);
 
1571
 
 
1572
                        return AXIS2_SUCCESS;
 
1573
                    }
 
1574
                ptr_param_activeAddrs =  (int*)
 
1575
                            AXIS2_MALLOC(env->allocator, sizeof(int));
 
1576
                   if(_networkType->property_activeAddrs == NULL)
 
1577
                   {
 
1578
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for new value of activeAddrs");
 
1579
                       return AXIS2_FAILURE;
 
1580
 
 
1581
                   }
 
1582
                   *ptr_param_activeAddrs = arg_activeAddrs;
 
1583
                   axutil_array_list_set(_networkType->property_activeAddrs , env, i, ptr_param_activeAddrs);
 
1584
                  _networkType->is_valid_activeAddrs = AXIS2_TRUE;
 
1585
 
 
1586
                return AXIS2_SUCCESS;
 
1587
            }
 
1588
 
 
1589
            /**
 
1590
             * Add to activeAddrs.
 
1591
             */
 
1592
            axis2_status_t AXIS2_CALL
 
1593
            adb_networkType_add_activeAddrs(
 
1594
                    adb_networkType_t* _networkType,
 
1595
                    const axutil_env_t *env,
 
1596
                    const int arg_activeAddrs)
 
1597
             {
 
1598
                int* ptr_param_activeAddrs;
 
1599
 
 
1600
 
 
1601
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1602
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1603
 
 
1604
 
 
1605
 
 
1606
                if(_networkType->property_activeAddrs == NULL)
 
1607
                {
 
1608
                    _networkType->property_activeAddrs = axutil_array_list_create(env, 10);
 
1609
                }
 
1610
                if(_networkType->property_activeAddrs == NULL)
 
1611
                {
 
1612
                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for activeAddrs");
 
1613
                    return AXIS2_FAILURE;
 
1614
 
 
1615
                }
 
1616
                ptr_param_activeAddrs =  (int*)
 
1617
                            AXIS2_MALLOC(env->allocator, sizeof(int));
 
1618
                   if(_networkType->property_activeAddrs == NULL)
 
1619
                   {
 
1620
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for new value of activeAddrs");
 
1621
                       return AXIS2_FAILURE;
 
1622
 
 
1623
                   }
 
1624
                   *ptr_param_activeAddrs = arg_activeAddrs;
 
1625
                   axutil_array_list_add(_networkType->property_activeAddrs , env, ptr_param_activeAddrs);
 
1626
                  _networkType->is_valid_activeAddrs = AXIS2_TRUE;
 
1627
                return AXIS2_SUCCESS;
 
1628
             }
 
1629
 
 
1630
            /**
 
1631
             * Get the size of the activeAddrs array.
 
1632
             */
 
1633
            int AXIS2_CALL
 
1634
            adb_networkType_sizeof_activeAddrs(
 
1635
                    adb_networkType_t* _networkType,
 
1636
                    const axutil_env_t *env)
 
1637
            {
 
1638
                AXIS2_ENV_CHECK(env, -1);
 
1639
                AXIS2_PARAM_CHECK(env->error, _networkType, -1);
 
1640
                if(_networkType->property_activeAddrs == NULL)
 
1641
                {
 
1642
                    return 0;
 
1643
                }
 
1644
                return axutil_array_list_size(_networkType->property_activeAddrs, env);
 
1645
            }
 
1646
 
 
1647
            /**
 
1648
             * remove the ith element, same as set_nil_at.
 
1649
             */
 
1650
            axis2_status_t AXIS2_CALL
 
1651
            adb_networkType_remove_activeAddrs_at(
 
1652
                    adb_networkType_t* _networkType,
 
1653
                    const axutil_env_t *env, int i)
 
1654
            {
 
1655
                return adb_networkType_set_activeAddrs_nil_at(_networkType, env, i);
 
1656
            }
 
1657
 
 
1658
 
 
1659
 
 
1660
           /**
 
1661
            * resetter for activeAddrs
 
1662
            */
 
1663
           axis2_status_t AXIS2_CALL
 
1664
           adb_networkType_reset_activeAddrs(
 
1665
                   adb_networkType_t* _networkType,
 
1666
                   const axutil_env_t *env)
 
1667
           {
 
1668
               int i = 0;
 
1669
               int count = 0;
 
1670
               void *element = NULL;
 
1671
 
 
1672
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1673
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1674
 
 
1675
 
 
1676
 
 
1677
                  if (_networkType->property_activeAddrs != NULL)
 
1678
                  {
 
1679
                      count = axutil_array_list_size(_networkType->property_activeAddrs, env);
 
1680
                      for(i = 0; i < count; i ++)
 
1681
                      {
 
1682
                         element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
 
1683
 
 
1684
 
 
1685
 
 
1686
                if(element != NULL)
 
1687
                {
 
1688
 
 
1689
 
 
1690
 
 
1691
                        /* we keep primtives as pointers in arrasy, so need to free them */
 
1692
                        AXIS2_FREE(env-> allocator, element);
 
1693
                       element = NULL;
 
1694
                }
 
1695
 
 
1696
 
 
1697
 
 
1698
 
 
1699
                      }
 
1700
                      axutil_array_list_free(_networkType->property_activeAddrs, env);
 
1701
                  }
 
1702
                _networkType->is_valid_activeAddrs = AXIS2_FALSE;
 
1703
               return AXIS2_SUCCESS;
 
1704
           }
 
1705
 
 
1706
           /**
 
1707
            * Check whether activeAddrs is nill
 
1708
            */
 
1709
           axis2_bool_t AXIS2_CALL
 
1710
           adb_networkType_is_activeAddrs_nil(
 
1711
                   adb_networkType_t* _networkType,
 
1712
                   const axutil_env_t *env)
 
1713
           {
 
1714
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1715
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
 
1716
 
 
1717
               return !_networkType->is_valid_activeAddrs;
 
1718
           }
 
1719
 
 
1720
           /**
 
1721
            * Set activeAddrs to nill (currently the same as reset)
 
1722
            */
 
1723
           axis2_status_t AXIS2_CALL
 
1724
           adb_networkType_set_activeAddrs_nil(
 
1725
                   adb_networkType_t* _networkType,
 
1726
                   const axutil_env_t *env)
 
1727
           {
 
1728
               return adb_networkType_reset_activeAddrs(_networkType, env);
 
1729
           }
 
1730
 
 
1731
 
 
1732
           /**
 
1733
            * Check whether activeAddrs is nill at i
 
1734
            */
 
1735
           axis2_bool_t AXIS2_CALL
 
1736
           adb_networkType_is_activeAddrs_nil_at(
 
1737
                   adb_networkType_t* _networkType,
 
1738
                   const axutil_env_t *env, int i)
 
1739
           {
 
1740
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
1741
               AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_TRUE);
 
1742
 
 
1743
               return (_networkType->is_valid_activeAddrs == AXIS2_FALSE ||
 
1744
                        NULL == _networkType->property_activeAddrs ||
 
1745
                        NULL == axutil_array_list_get(_networkType->property_activeAddrs, env, i));
 
1746
           }
 
1747
 
 
1748
           /**
 
1749
            * Set activeAddrs to nill at i
 
1750
            */
 
1751
           axis2_status_t AXIS2_CALL
 
1752
           adb_networkType_set_activeAddrs_nil_at(
 
1753
                   adb_networkType_t* _networkType,
 
1754
                   const axutil_env_t *env, int i)
 
1755
           {
 
1756
                void *element = NULL;
 
1757
                int size = 0;
 
1758
                int j;
 
1759
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
1760
 
 
1761
                int k = 0;
 
1762
 
 
1763
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
1764
                AXIS2_PARAM_CHECK(env->error, _networkType, AXIS2_FAILURE);
 
1765
 
 
1766
                if(_networkType->property_activeAddrs == NULL ||
 
1767
                            _networkType->is_valid_activeAddrs == AXIS2_FALSE)
 
1768
                {
 
1769
 
 
1770
                    non_nil_exists = AXIS2_FALSE;
 
1771
                }
 
1772
                else
 
1773
                {
 
1774
                    size = axutil_array_list_size(_networkType->property_activeAddrs, env);
 
1775
                    for(j = 0, k = 0; j < size; j ++ )
 
1776
                    {
 
1777
                        if(i == j) continue;
 
1778
                        if(NULL != axutil_array_list_get(_networkType->property_activeAddrs, env, i))
 
1779
                        {
 
1780
                            k ++;
 
1781
                            non_nil_exists = AXIS2_TRUE;
 
1782
                            if( k >= 0)
 
1783
                            {
 
1784
                                break;
 
1785
                            }
 
1786
                        }
 
1787
                    }
 
1788
                }
 
1789
 
 
1790
 
 
1791
                if( k < 0)
 
1792
                {
 
1793
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of activeAddrs is beinng set to be smaller than the specificed number of minOccurs(0)");
 
1794
                       return AXIS2_FAILURE;
 
1795
                }
 
1796
 
 
1797
                if(_networkType->property_activeAddrs == NULL)
 
1798
                {
 
1799
                    _networkType->is_valid_activeAddrs = AXIS2_FALSE;
 
1800
 
 
1801
                    return AXIS2_SUCCESS;
 
1802
                }
 
1803
 
 
1804
                /* check whether there already exist an element */
 
1805
                element = axutil_array_list_get(_networkType->property_activeAddrs, env, i);
 
1806
                if(NULL != element)
 
1807
                {
 
1808
 
 
1809
 
 
1810
 
 
1811
 
 
1812
                        /* we keep primtives as pointers in arrasy, so need to free them */
 
1813
                        AXIS2_FREE(env-> allocator, element);
 
1814
 
 
1815
                }
 
1816
 
 
1817
 
 
1818
                    if(!non_nil_exists)
 
1819
                    {
 
1820
 
 
1821
                        _networkType->is_valid_activeAddrs = AXIS2_FALSE;
 
1822
                        axutil_array_list_set(_networkType->property_activeAddrs , env, i, NULL);
 
1823
                        return AXIS2_SUCCESS;
 
1824
                    }
 
1825
 
 
1826
 
 
1827
 
 
1828
                axutil_array_list_set(_networkType->property_activeAddrs , env, i, NULL);
 
1829
 
 
1830
                return AXIS2_SUCCESS;
 
1831
 
 
1832
           }
 
1833
 
 
1834
 
 
1835