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

« back to all changes in this revision

Viewing changes to cluster/generated/adb_networkRule.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_networkRule.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_networkRule.h"
 
11
        
 
12
                /*
 
13
                 * This type was generated from the piece of schema that had
 
14
                 * name = networkRule
 
15
                 * Namespace URI = http://eucalyptus.ucsb.edu/
 
16
                 * Namespace Prefix = ns1
 
17
                 */
 
18
           
 
19
 
 
20
 
 
21
        struct adb_networkRule
 
22
        {
 
23
            axis2_char_t* property_type;
 
24
 
 
25
                
 
26
                axis2_bool_t is_valid_type;
 
27
 
 
28
 
 
29
            axutil_array_list_t* property_sourceNames;
 
30
 
 
31
                
 
32
                axis2_bool_t is_valid_sourceNames;
 
33
 
 
34
 
 
35
            axutil_array_list_t* property_userNames;
 
36
 
 
37
                
 
38
                axis2_bool_t is_valid_userNames;
 
39
 
 
40
 
 
41
            axutil_array_list_t* property_sourceNets;
 
42
 
 
43
                
 
44
                axis2_bool_t is_valid_sourceNets;
 
45
 
 
46
 
 
47
            axis2_char_t* property_destUserName;
 
48
 
 
49
                
 
50
                axis2_bool_t is_valid_destUserName;
 
51
 
 
52
 
 
53
            axis2_char_t* property_destName;
 
54
 
 
55
                
 
56
                axis2_bool_t is_valid_destName;
 
57
 
 
58
 
 
59
            axis2_char_t* property_protocol;
 
60
 
 
61
                
 
62
                axis2_bool_t is_valid_protocol;
 
63
 
 
64
 
 
65
            int property_portRangeMin;
 
66
 
 
67
                
 
68
                axis2_bool_t is_valid_portRangeMin;
 
69
 
 
70
 
 
71
            int property_portRangeMax;
 
72
 
 
73
                
 
74
                axis2_bool_t is_valid_portRangeMax;
 
75
 
 
76
 
 
77
            
 
78
        };
 
79
 
 
80
 
 
81
       /************************* Private Function prototypes ********************************/
 
82
        
 
83
 
 
84
                axis2_status_t AXIS2_CALL
 
85
                adb_networkRule_set_type_nil(
 
86
                        adb_networkRule_t* _networkRule,
 
87
                        const axutil_env_t *env);
 
88
            
 
89
                 axis2_status_t AXIS2_CALL
 
90
                 adb_networkRule_set_sourceNames_nil_at(
 
91
                        adb_networkRule_t* _networkRule, 
 
92
                        const axutil_env_t *env, int i);
 
93
                
 
94
 
 
95
                axis2_status_t AXIS2_CALL
 
96
                adb_networkRule_set_sourceNames_nil(
 
97
                        adb_networkRule_t* _networkRule,
 
98
                        const axutil_env_t *env);
 
99
            
 
100
                 axis2_status_t AXIS2_CALL
 
101
                 adb_networkRule_set_userNames_nil_at(
 
102
                        adb_networkRule_t* _networkRule, 
 
103
                        const axutil_env_t *env, int i);
 
104
                
 
105
 
 
106
                axis2_status_t AXIS2_CALL
 
107
                adb_networkRule_set_userNames_nil(
 
108
                        adb_networkRule_t* _networkRule,
 
109
                        const axutil_env_t *env);
 
110
            
 
111
                 axis2_status_t AXIS2_CALL
 
112
                 adb_networkRule_set_sourceNets_nil_at(
 
113
                        adb_networkRule_t* _networkRule, 
 
114
                        const axutil_env_t *env, int i);
 
115
                
 
116
 
 
117
                axis2_status_t AXIS2_CALL
 
118
                adb_networkRule_set_sourceNets_nil(
 
119
                        adb_networkRule_t* _networkRule,
 
120
                        const axutil_env_t *env);
 
121
            
 
122
 
 
123
                axis2_status_t AXIS2_CALL
 
124
                adb_networkRule_set_destUserName_nil(
 
125
                        adb_networkRule_t* _networkRule,
 
126
                        const axutil_env_t *env);
 
127
            
 
128
 
 
129
                axis2_status_t AXIS2_CALL
 
130
                adb_networkRule_set_destName_nil(
 
131
                        adb_networkRule_t* _networkRule,
 
132
                        const axutil_env_t *env);
 
133
            
 
134
 
 
135
                axis2_status_t AXIS2_CALL
 
136
                adb_networkRule_set_protocol_nil(
 
137
                        adb_networkRule_t* _networkRule,
 
138
                        const axutil_env_t *env);
 
139
            
 
140
 
 
141
                axis2_status_t AXIS2_CALL
 
142
                adb_networkRule_set_portRangeMin_nil(
 
143
                        adb_networkRule_t* _networkRule,
 
144
                        const axutil_env_t *env);
 
145
            
 
146
 
 
147
                axis2_status_t AXIS2_CALL
 
148
                adb_networkRule_set_portRangeMax_nil(
 
149
                        adb_networkRule_t* _networkRule,
 
150
                        const axutil_env_t *env);
 
151
            
 
152
 
 
153
 
 
154
       /************************* Function Implmentations ********************************/
 
155
        adb_networkRule_t* AXIS2_CALL
 
156
        adb_networkRule_create(
 
157
            const axutil_env_t *env)
 
158
        {
 
159
            adb_networkRule_t *_networkRule = NULL;
 
160
            
 
161
            AXIS2_ENV_CHECK(env, NULL);
 
162
 
 
163
            _networkRule = (adb_networkRule_t *) AXIS2_MALLOC(env->
 
164
                allocator, sizeof(adb_networkRule_t));
 
165
 
 
166
            if(NULL == _networkRule)
 
167
            {
 
168
                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
 
169
                return NULL;
 
170
            }
 
171
 
 
172
            memset(_networkRule, 0, sizeof(adb_networkRule_t));
 
173
 
 
174
            _networkRule->property_type  = NULL;
 
175
                  _networkRule->is_valid_type  = AXIS2_FALSE;
 
176
            _networkRule->property_sourceNames  = NULL;
 
177
                  _networkRule->is_valid_sourceNames  = AXIS2_FALSE;
 
178
            _networkRule->property_userNames  = NULL;
 
179
                  _networkRule->is_valid_userNames  = AXIS2_FALSE;
 
180
            _networkRule->property_sourceNets  = NULL;
 
181
                  _networkRule->is_valid_sourceNets  = AXIS2_FALSE;
 
182
            _networkRule->property_destUserName  = NULL;
 
183
                  _networkRule->is_valid_destUserName  = AXIS2_FALSE;
 
184
            _networkRule->property_destName  = NULL;
 
185
                  _networkRule->is_valid_destName  = AXIS2_FALSE;
 
186
            _networkRule->property_protocol  = NULL;
 
187
                  _networkRule->is_valid_protocol  = AXIS2_FALSE;
 
188
            _networkRule->is_valid_portRangeMin  = AXIS2_FALSE;
 
189
            _networkRule->is_valid_portRangeMax  = AXIS2_FALSE;
 
190
            
 
191
 
 
192
            return _networkRule;
 
193
        }
 
194
 
 
195
        axis2_status_t AXIS2_CALL
 
196
        adb_networkRule_free (
 
197
                adb_networkRule_t* _networkRule,
 
198
                const axutil_env_t *env)
 
199
        {
 
200
            
 
201
                int i = 0;
 
202
                int count = 0;
 
203
                void *element = NULL;
 
204
            
 
205
 
 
206
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
207
            AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
208
 
 
209
            adb_networkRule_reset_type(_networkRule, env);
 
210
            adb_networkRule_reset_sourceNames(_networkRule, env);
 
211
            adb_networkRule_reset_userNames(_networkRule, env);
 
212
            adb_networkRule_reset_sourceNets(_networkRule, env);
 
213
            adb_networkRule_reset_destUserName(_networkRule, env);
 
214
            adb_networkRule_reset_destName(_networkRule, env);
 
215
            adb_networkRule_reset_protocol(_networkRule, env);
 
216
            adb_networkRule_reset_portRangeMin(_networkRule, env);
 
217
            adb_networkRule_reset_portRangeMax(_networkRule, env);
 
218
            
 
219
 
 
220
            if(_networkRule)
 
221
            {
 
222
                AXIS2_FREE(env->allocator, _networkRule);
 
223
                _networkRule = NULL;
 
224
            }
 
225
            return AXIS2_SUCCESS;
 
226
        }
 
227
 
 
228
 
 
229
        
 
230
 
 
231
        axis2_status_t AXIS2_CALL
 
232
        adb_networkRule_deserialize(
 
233
                adb_networkRule_t* _networkRule,
 
234
                const axutil_env_t *env,
 
235
                axiom_node_t **dp_parent,
 
236
                axis2_bool_t *dp_is_early_node_valid,
 
237
                axis2_bool_t dont_care_minoccurs)
 
238
        {
 
239
          axiom_node_t *parent = *dp_parent;
 
240
          
 
241
          axis2_status_t status = AXIS2_SUCCESS;
 
242
          
 
243
              void *element = NULL;
 
244
           
 
245
             axis2_char_t* text_value = NULL;
 
246
             axutil_qname_t *qname = NULL;
 
247
          
 
248
               int i = 0;
 
249
               axutil_array_list_t *arr_list = NULL;
 
250
            
 
251
               int sequence_broken = 0;
 
252
               axiom_node_t *tmp_node = NULL;
 
253
            
 
254
            axutil_qname_t *element_qname = NULL; 
 
255
            
 
256
               axiom_node_t *first_node = NULL;
 
257
               axis2_bool_t is_early_node_valid = AXIS2_TRUE;
 
258
               axiom_node_t *current_node = NULL;
 
259
               axiom_element_t *current_element = NULL;
 
260
            
 
261
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
262
            AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
263
 
 
264
            
 
265
              
 
266
              while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
 
267
              {
 
268
                  parent = axiom_node_get_next_sibling(parent, env);
 
269
              }
 
270
              if (NULL == parent)
 
271
              {
 
272
                /* This should be checked before everything */
 
273
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
 
274
                            "Failed in building adb object for networkRule : "
 
275
                            "NULL elemenet can not be passed to deserialize");
 
276
                return AXIS2_FAILURE;
 
277
              }
 
278
              
 
279
                      
 
280
                      first_node = axiom_node_get_first_child(parent, env);
 
281
                      
 
282
                    
 
283
 
 
284
                     
 
285
                     /*
 
286
                      * building type element
 
287
                      */
 
288
                     
 
289
                     
 
290
                     
 
291
                                   current_node = first_node;
 
292
                                   is_early_node_valid = AXIS2_FALSE;
 
293
                                   
 
294
                                   
 
295
                                    while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
296
                                    {
 
297
                                        current_node = axiom_node_get_next_sibling(current_node, env);
 
298
                                    }
 
299
                                    if(current_node != NULL)
 
300
                                    {
 
301
                                        current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
302
                                        qname = axiom_element_get_qname(current_element, env, current_node);
 
303
                                    }
 
304
                                   
 
305
                                 element_qname = axutil_qname_create(env, "type", "http://eucalyptus.ucsb.edu/", NULL);
 
306
                                 
 
307
 
 
308
                           if ( 
 
309
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
310
                           {
 
311
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
312
                              {
 
313
                                is_early_node_valid = AXIS2_TRUE;
 
314
                              }
 
315
                              
 
316
                                 
 
317
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
318
                                      if(text_value != NULL)
 
319
                                      {
 
320
                                            status = adb_networkRule_set_type(_networkRule, env,
 
321
                                                               text_value);
 
322
                                      }
 
323
                                      
 
324
                                      else
 
325
                                      {
 
326
                                            /*
 
327
                                             * axis2_qname_t *qname = NULL;
 
328
                                             * axiom_attribute_t *the_attri = NULL;
 
329
                                             * 
 
330
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
331
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
332
                                             */
 
333
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
334
 
 
335
                                            axiom_attribute_t *the_attri = NULL;
 
336
                                            axis2_char_t *attrib_text = NULL;
 
337
                                            axutil_hash_t *attribute_hash = NULL;
 
338
 
 
339
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
340
 
 
341
                                            attrib_text = NULL;
 
342
                                            if(attribute_hash)
 
343
                                            {
 
344
                                                 axutil_hash_index_t *hi;
 
345
                                                 void *val;
 
346
                                                 const void *key;
 
347
                                        
 
348
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
349
                                                 {
 
350
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
351
                                                     
 
352
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
353
                                                     {
 
354
                                                         the_attri = (axiom_attribute_t*)val;
 
355
                                                         break;
 
356
                                                     }
 
357
                                                 }
 
358
                                            }
 
359
 
 
360
                                            if(the_attri)
 
361
                                            {
 
362
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
363
                                            }
 
364
                                            else
 
365
                                            {
 
366
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
367
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
368
                                            }
 
369
 
 
370
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
371
                                            {
 
372
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element type");
 
373
                                                status = AXIS2_FAILURE;
 
374
                                            }
 
375
                                            else
 
376
                                            {
 
377
                                                /* after all, we found this is a empty string */
 
378
                                                status = adb_networkRule_set_type(_networkRule, env,
 
379
                                                                   "");
 
380
                                            }
 
381
                                      }
 
382
                                      
 
383
                                 if(AXIS2_FAILURE ==  status)
 
384
                                 {
 
385
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for type ");
 
386
                                     if(element_qname)
 
387
                                     {
 
388
                                         axutil_qname_free(element_qname, env);
 
389
                                     }
 
390
                                     return AXIS2_FAILURE;
 
391
                                 }
 
392
                              }
 
393
                           
 
394
                              else if(!dont_care_minoccurs)
 
395
                              {
 
396
                                  if(element_qname)
 
397
                                  {
 
398
                                      axutil_qname_free(element_qname, env);
 
399
                                  }
 
400
                                  /* this is not a nillable element*/
 
401
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element type missing");
 
402
                                  return AXIS2_FAILURE;
 
403
                              }
 
404
                           
 
405
                  if(element_qname)
 
406
                  {
 
407
                     axutil_qname_free(element_qname, env);
 
408
                     element_qname = NULL;
 
409
                  }
 
410
                 
 
411
                    /*
 
412
                     * building sourceNames array
 
413
                     */
 
414
                       arr_list = axutil_array_list_create(env, 10);
 
415
                   
 
416
 
 
417
                     
 
418
                     /*
 
419
                      * building sourceNames element
 
420
                      */
 
421
                     
 
422
                     
 
423
                     
 
424
                                    element_qname = axutil_qname_create(env, "sourceNames", "http://eucalyptus.ucsb.edu/", NULL);
 
425
                                  
 
426
                               
 
427
                               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;) 
 
428
                                             
 
429
                               {
 
430
                                  if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
431
                                  {
 
432
                                     current_node =axiom_node_get_next_sibling(current_node, env);
 
433
                                     is_early_node_valid = AXIS2_FALSE;
 
434
                                     continue;
 
435
                                  }
 
436
                                  
 
437
                                  current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
438
                                  qname = axiom_element_get_qname(current_element, env, current_node);
 
439
 
 
440
                                  if (axutil_qname_equals(element_qname, env, qname))
 
441
                                  {
 
442
                                  
 
443
                                      is_early_node_valid = AXIS2_TRUE;
 
444
                                      
 
445
                                     
 
446
                                          text_value = axiom_element_get_text(current_element, env, current_node);
 
447
                                          if(text_value != NULL)
 
448
                                          {
 
449
                                              axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, text_value));
 
450
                                          }
 
451
                                          
 
452
                                          else
 
453
                                          {
 
454
                                              /*
 
455
                                               * axis2_qname_t *qname = NULL;
 
456
                                               * axiom_attribute_t *the_attri = NULL;
 
457
                                               * 
 
458
                                               * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
459
                                               * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
460
                                               */
 
461
                                           
 
462
                                              /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
463
                                             
 
464
                                              axiom_attribute_t *the_attri = NULL;
 
465
                                              axis2_char_t *attrib_text = NULL;
 
466
                                              axutil_hash_t *attribute_hash = NULL;
 
467
                                             
 
468
                                              attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
469
                                             
 
470
                                              attrib_text = NULL;
 
471
                                              if(attribute_hash)
 
472
                                              {
 
473
                                                   axutil_hash_index_t *hi;
 
474
                                                   void *val;
 
475
                                                   const void *key;
 
476
                                             
 
477
                                                   for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
478
                                                   {
 
479
                                                       axutil_hash_this(hi, &key, NULL, &val);
 
480
                                                       
 
481
                                                       if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
482
                                                       {
 
483
                                                           the_attri = (axiom_attribute_t*)val;
 
484
                                                           break;
 
485
                                                       }
 
486
                                                   }
 
487
                                              }
 
488
                                             
 
489
                                              if(the_attri)
 
490
                                              {
 
491
                                                  attrib_text = axiom_attribute_get_value(the_attri, env);
 
492
                                              }
 
493
                                              else
 
494
                                              {
 
495
                                                  /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
496
                                                  attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
497
                                              }
 
498
                                             
 
499
                                              if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
500
                                              {
 
501
                                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element sourceNames");
 
502
                                                  status = AXIS2_FAILURE;
 
503
                                              }
 
504
                                              else
 
505
                                              {
 
506
                                                  /* after all, we found this is a empty string */
 
507
                                                  axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, ""));
 
508
                                              }
 
509
                                          }
 
510
                                          
 
511
                                     if(AXIS2_FAILURE ==  status)
 
512
                                     {
 
513
                                         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for sourceNames ");
 
514
                                         if(element_qname)
 
515
                                         {
 
516
                                            axutil_qname_free(element_qname, env);
 
517
                                         }
 
518
                                         if(arr_list)
 
519
                                         {
 
520
                                            axutil_array_list_free(arr_list, env);
 
521
                                         }
 
522
                                         return AXIS2_FAILURE;
 
523
                                     }
 
524
 
 
525
                                     i ++;
 
526
                                    current_node = axiom_node_get_next_sibling(current_node, env);
 
527
                                  }
 
528
                                  else
 
529
                                  {
 
530
                                      is_early_node_valid = AXIS2_FALSE;
 
531
                                      sequence_broken = 1;
 
532
                                  }
 
533
                                  
 
534
                               }
 
535
 
 
536
                               
 
537
                                   if (i < 0)
 
538
                                   {
 
539
                                     /* found element out of order */
 
540
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNames (@minOccurs = '0') only have %d elements", i);
 
541
                                     if(element_qname)
 
542
                                     {
 
543
                                        axutil_qname_free(element_qname, env);
 
544
                                     }
 
545
                                     if(arr_list)
 
546
                                     {
 
547
                                        axutil_array_list_free(arr_list, env);
 
548
                                     }
 
549
                                     return AXIS2_FAILURE;
 
550
                                   }
 
551
                               
 
552
 
 
553
                               if(0 == axutil_array_list_size(arr_list,env))
 
554
                               {
 
555
                                    axutil_array_list_free(arr_list, env);
 
556
                               }
 
557
                               else
 
558
                               {
 
559
                                    status = adb_networkRule_set_sourceNames(_networkRule, env,
 
560
                                                                   arr_list);
 
561
                               }
 
562
 
 
563
                             
 
564
                  if(element_qname)
 
565
                  {
 
566
                     axutil_qname_free(element_qname, env);
 
567
                     element_qname = NULL;
 
568
                  }
 
569
                 
 
570
                    /*
 
571
                     * building userNames array
 
572
                     */
 
573
                       arr_list = axutil_array_list_create(env, 10);
 
574
                   
 
575
 
 
576
                     
 
577
                     /*
 
578
                      * building userNames element
 
579
                      */
 
580
                     
 
581
                     
 
582
                     
 
583
                                    element_qname = axutil_qname_create(env, "userNames", "http://eucalyptus.ucsb.edu/", NULL);
 
584
                                  
 
585
                               
 
586
                               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;) 
 
587
                                             
 
588
                               {
 
589
                                  if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
590
                                  {
 
591
                                     current_node =axiom_node_get_next_sibling(current_node, env);
 
592
                                     is_early_node_valid = AXIS2_FALSE;
 
593
                                     continue;
 
594
                                  }
 
595
                                  
 
596
                                  current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
597
                                  qname = axiom_element_get_qname(current_element, env, current_node);
 
598
 
 
599
                                  if (axutil_qname_equals(element_qname, env, qname))
 
600
                                  {
 
601
                                  
 
602
                                      is_early_node_valid = AXIS2_TRUE;
 
603
                                      
 
604
                                     
 
605
                                          text_value = axiom_element_get_text(current_element, env, current_node);
 
606
                                          if(text_value != NULL)
 
607
                                          {
 
608
                                              axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, text_value));
 
609
                                          }
 
610
                                          
 
611
                                          else
 
612
                                          {
 
613
                                              /*
 
614
                                               * axis2_qname_t *qname = NULL;
 
615
                                               * axiom_attribute_t *the_attri = NULL;
 
616
                                               * 
 
617
                                               * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
618
                                               * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
619
                                               */
 
620
                                           
 
621
                                              /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
622
                                             
 
623
                                              axiom_attribute_t *the_attri = NULL;
 
624
                                              axis2_char_t *attrib_text = NULL;
 
625
                                              axutil_hash_t *attribute_hash = NULL;
 
626
                                             
 
627
                                              attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
628
                                             
 
629
                                              attrib_text = NULL;
 
630
                                              if(attribute_hash)
 
631
                                              {
 
632
                                                   axutil_hash_index_t *hi;
 
633
                                                   void *val;
 
634
                                                   const void *key;
 
635
                                             
 
636
                                                   for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
637
                                                   {
 
638
                                                       axutil_hash_this(hi, &key, NULL, &val);
 
639
                                                       
 
640
                                                       if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
641
                                                       {
 
642
                                                           the_attri = (axiom_attribute_t*)val;
 
643
                                                           break;
 
644
                                                       }
 
645
                                                   }
 
646
                                              }
 
647
                                             
 
648
                                              if(the_attri)
 
649
                                              {
 
650
                                                  attrib_text = axiom_attribute_get_value(the_attri, env);
 
651
                                              }
 
652
                                              else
 
653
                                              {
 
654
                                                  /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
655
                                                  attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
656
                                              }
 
657
                                             
 
658
                                              if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
659
                                              {
 
660
                                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element userNames");
 
661
                                                  status = AXIS2_FAILURE;
 
662
                                              }
 
663
                                              else
 
664
                                              {
 
665
                                                  /* after all, we found this is a empty string */
 
666
                                                  axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, ""));
 
667
                                              }
 
668
                                          }
 
669
                                          
 
670
                                     if(AXIS2_FAILURE ==  status)
 
671
                                     {
 
672
                                         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for userNames ");
 
673
                                         if(element_qname)
 
674
                                         {
 
675
                                            axutil_qname_free(element_qname, env);
 
676
                                         }
 
677
                                         if(arr_list)
 
678
                                         {
 
679
                                            axutil_array_list_free(arr_list, env);
 
680
                                         }
 
681
                                         return AXIS2_FAILURE;
 
682
                                     }
 
683
 
 
684
                                     i ++;
 
685
                                    current_node = axiom_node_get_next_sibling(current_node, env);
 
686
                                  }
 
687
                                  else
 
688
                                  {
 
689
                                      is_early_node_valid = AXIS2_FALSE;
 
690
                                      sequence_broken = 1;
 
691
                                  }
 
692
                                  
 
693
                               }
 
694
 
 
695
                               
 
696
                                   if (i < 0)
 
697
                                   {
 
698
                                     /* found element out of order */
 
699
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "userNames (@minOccurs = '0') only have %d elements", i);
 
700
                                     if(element_qname)
 
701
                                     {
 
702
                                        axutil_qname_free(element_qname, env);
 
703
                                     }
 
704
                                     if(arr_list)
 
705
                                     {
 
706
                                        axutil_array_list_free(arr_list, env);
 
707
                                     }
 
708
                                     return AXIS2_FAILURE;
 
709
                                   }
 
710
                               
 
711
 
 
712
                               if(0 == axutil_array_list_size(arr_list,env))
 
713
                               {
 
714
                                    axutil_array_list_free(arr_list, env);
 
715
                               }
 
716
                               else
 
717
                               {
 
718
                                    status = adb_networkRule_set_userNames(_networkRule, env,
 
719
                                                                   arr_list);
 
720
                               }
 
721
 
 
722
                             
 
723
                  if(element_qname)
 
724
                  {
 
725
                     axutil_qname_free(element_qname, env);
 
726
                     element_qname = NULL;
 
727
                  }
 
728
                 
 
729
                    /*
 
730
                     * building sourceNets array
 
731
                     */
 
732
                       arr_list = axutil_array_list_create(env, 10);
 
733
                   
 
734
 
 
735
                     
 
736
                     /*
 
737
                      * building sourceNets element
 
738
                      */
 
739
                     
 
740
                     
 
741
                     
 
742
                                    element_qname = axutil_qname_create(env, "sourceNets", "http://eucalyptus.ucsb.edu/", NULL);
 
743
                                  
 
744
                               
 
745
                               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;) 
 
746
                                             
 
747
                               {
 
748
                                  if(axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
749
                                  {
 
750
                                     current_node =axiom_node_get_next_sibling(current_node, env);
 
751
                                     is_early_node_valid = AXIS2_FALSE;
 
752
                                     continue;
 
753
                                  }
 
754
                                  
 
755
                                  current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
756
                                  qname = axiom_element_get_qname(current_element, env, current_node);
 
757
 
 
758
                                  if (axutil_qname_equals(element_qname, env, qname))
 
759
                                  {
 
760
                                  
 
761
                                      is_early_node_valid = AXIS2_TRUE;
 
762
                                      
 
763
                                     
 
764
                                          text_value = axiom_element_get_text(current_element, env, current_node);
 
765
                                          if(text_value != NULL)
 
766
                                          {
 
767
                                              axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, text_value));
 
768
                                          }
 
769
                                          
 
770
                                          else
 
771
                                          {
 
772
                                              /*
 
773
                                               * axis2_qname_t *qname = NULL;
 
774
                                               * axiom_attribute_t *the_attri = NULL;
 
775
                                               * 
 
776
                                               * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
777
                                               * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
778
                                               */
 
779
                                           
 
780
                                              /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
781
                                             
 
782
                                              axiom_attribute_t *the_attri = NULL;
 
783
                                              axis2_char_t *attrib_text = NULL;
 
784
                                              axutil_hash_t *attribute_hash = NULL;
 
785
                                             
 
786
                                              attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
787
                                             
 
788
                                              attrib_text = NULL;
 
789
                                              if(attribute_hash)
 
790
                                              {
 
791
                                                   axutil_hash_index_t *hi;
 
792
                                                   void *val;
 
793
                                                   const void *key;
 
794
                                             
 
795
                                                   for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
796
                                                   {
 
797
                                                       axutil_hash_this(hi, &key, NULL, &val);
 
798
                                                       
 
799
                                                       if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
800
                                                       {
 
801
                                                           the_attri = (axiom_attribute_t*)val;
 
802
                                                           break;
 
803
                                                       }
 
804
                                                   }
 
805
                                              }
 
806
                                             
 
807
                                              if(the_attri)
 
808
                                              {
 
809
                                                  attrib_text = axiom_attribute_get_value(the_attri, env);
 
810
                                              }
 
811
                                              else
 
812
                                              {
 
813
                                                  /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
814
                                                  attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
815
                                              }
 
816
                                             
 
817
                                              if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
818
                                              {
 
819
                                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element sourceNets");
 
820
                                                  status = AXIS2_FAILURE;
 
821
                                              }
 
822
                                              else
 
823
                                              {
 
824
                                                  /* after all, we found this is a empty string */
 
825
                                                  axutil_array_list_add_at(arr_list, env, i, axutil_strdup(env, ""));
 
826
                                              }
 
827
                                          }
 
828
                                          
 
829
                                     if(AXIS2_FAILURE ==  status)
 
830
                                     {
 
831
                                         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for sourceNets ");
 
832
                                         if(element_qname)
 
833
                                         {
 
834
                                            axutil_qname_free(element_qname, env);
 
835
                                         }
 
836
                                         if(arr_list)
 
837
                                         {
 
838
                                            axutil_array_list_free(arr_list, env);
 
839
                                         }
 
840
                                         return AXIS2_FAILURE;
 
841
                                     }
 
842
 
 
843
                                     i ++;
 
844
                                    current_node = axiom_node_get_next_sibling(current_node, env);
 
845
                                  }
 
846
                                  else
 
847
                                  {
 
848
                                      is_early_node_valid = AXIS2_FALSE;
 
849
                                      sequence_broken = 1;
 
850
                                  }
 
851
                                  
 
852
                               }
 
853
 
 
854
                               
 
855
                                   if (i < 0)
 
856
                                   {
 
857
                                     /* found element out of order */
 
858
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNets (@minOccurs = '0') only have %d elements", i);
 
859
                                     if(element_qname)
 
860
                                     {
 
861
                                        axutil_qname_free(element_qname, env);
 
862
                                     }
 
863
                                     if(arr_list)
 
864
                                     {
 
865
                                        axutil_array_list_free(arr_list, env);
 
866
                                     }
 
867
                                     return AXIS2_FAILURE;
 
868
                                   }
 
869
                               
 
870
 
 
871
                               if(0 == axutil_array_list_size(arr_list,env))
 
872
                               {
 
873
                                    axutil_array_list_free(arr_list, env);
 
874
                               }
 
875
                               else
 
876
                               {
 
877
                                    status = adb_networkRule_set_sourceNets(_networkRule, env,
 
878
                                                                   arr_list);
 
879
                               }
 
880
 
 
881
                             
 
882
                  if(element_qname)
 
883
                  {
 
884
                     axutil_qname_free(element_qname, env);
 
885
                     element_qname = NULL;
 
886
                  }
 
887
                 
 
888
 
 
889
                     
 
890
                     /*
 
891
                      * building destUserName element
 
892
                      */
 
893
                     
 
894
                     
 
895
                     
 
896
                                    /*
 
897
                                     * because elements are ordered this works fine
 
898
                                     */
 
899
                                  
 
900
                                   
 
901
                                   if(current_node != NULL && is_early_node_valid)
 
902
                                   {
 
903
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
904
                                       
 
905
                                       
 
906
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
907
                                        {
 
908
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
909
                                        }
 
910
                                        if(current_node != NULL)
 
911
                                        {
 
912
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
913
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
914
                                        }
 
915
                                       
 
916
                                   }
 
917
                                   is_early_node_valid = AXIS2_FALSE;
 
918
                                 
 
919
                                 element_qname = axutil_qname_create(env, "destUserName", "http://eucalyptus.ucsb.edu/", NULL);
 
920
                                 
 
921
 
 
922
                           if ( 
 
923
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
924
                           {
 
925
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
926
                              {
 
927
                                is_early_node_valid = AXIS2_TRUE;
 
928
                              }
 
929
                              
 
930
                                 
 
931
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
932
                                      if(text_value != NULL)
 
933
                                      {
 
934
                                            status = adb_networkRule_set_destUserName(_networkRule, env,
 
935
                                                               text_value);
 
936
                                      }
 
937
                                      
 
938
                                      else
 
939
                                      {
 
940
                                            /*
 
941
                                             * axis2_qname_t *qname = NULL;
 
942
                                             * axiom_attribute_t *the_attri = NULL;
 
943
                                             * 
 
944
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
945
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
946
                                             */
 
947
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
948
 
 
949
                                            axiom_attribute_t *the_attri = NULL;
 
950
                                            axis2_char_t *attrib_text = NULL;
 
951
                                            axutil_hash_t *attribute_hash = NULL;
 
952
 
 
953
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
954
 
 
955
                                            attrib_text = NULL;
 
956
                                            if(attribute_hash)
 
957
                                            {
 
958
                                                 axutil_hash_index_t *hi;
 
959
                                                 void *val;
 
960
                                                 const void *key;
 
961
                                        
 
962
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
963
                                                 {
 
964
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
965
                                                     
 
966
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
967
                                                     {
 
968
                                                         the_attri = (axiom_attribute_t*)val;
 
969
                                                         break;
 
970
                                                     }
 
971
                                                 }
 
972
                                            }
 
973
 
 
974
                                            if(the_attri)
 
975
                                            {
 
976
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
977
                                            }
 
978
                                            else
 
979
                                            {
 
980
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
981
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
982
                                            }
 
983
 
 
984
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
985
                                            {
 
986
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element destUserName");
 
987
                                                status = AXIS2_FAILURE;
 
988
                                            }
 
989
                                            else
 
990
                                            {
 
991
                                                /* after all, we found this is a empty string */
 
992
                                                status = adb_networkRule_set_destUserName(_networkRule, env,
 
993
                                                                   "");
 
994
                                            }
 
995
                                      }
 
996
                                      
 
997
                                 if(AXIS2_FAILURE ==  status)
 
998
                                 {
 
999
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for destUserName ");
 
1000
                                     if(element_qname)
 
1001
                                     {
 
1002
                                         axutil_qname_free(element_qname, env);
 
1003
                                     }
 
1004
                                     return AXIS2_FAILURE;
 
1005
                                 }
 
1006
                              }
 
1007
                           
 
1008
                  if(element_qname)
 
1009
                  {
 
1010
                     axutil_qname_free(element_qname, env);
 
1011
                     element_qname = NULL;
 
1012
                  }
 
1013
                 
 
1014
 
 
1015
                     
 
1016
                     /*
 
1017
                      * building destName element
 
1018
                      */
 
1019
                     
 
1020
                     
 
1021
                     
 
1022
                                    /*
 
1023
                                     * because elements are ordered this works fine
 
1024
                                     */
 
1025
                                  
 
1026
                                   
 
1027
                                   if(current_node != NULL && is_early_node_valid)
 
1028
                                   {
 
1029
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
1030
                                       
 
1031
                                       
 
1032
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
1033
                                        {
 
1034
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
1035
                                        }
 
1036
                                        if(current_node != NULL)
 
1037
                                        {
 
1038
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
1039
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
1040
                                        }
 
1041
                                       
 
1042
                                   }
 
1043
                                   is_early_node_valid = AXIS2_FALSE;
 
1044
                                 
 
1045
                                 element_qname = axutil_qname_create(env, "destName", "http://eucalyptus.ucsb.edu/", NULL);
 
1046
                                 
 
1047
 
 
1048
                           if ( 
 
1049
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
1050
                           {
 
1051
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
1052
                              {
 
1053
                                is_early_node_valid = AXIS2_TRUE;
 
1054
                              }
 
1055
                              
 
1056
                                 
 
1057
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
1058
                                      if(text_value != NULL)
 
1059
                                      {
 
1060
                                            status = adb_networkRule_set_destName(_networkRule, env,
 
1061
                                                               text_value);
 
1062
                                      }
 
1063
                                      
 
1064
                                      else
 
1065
                                      {
 
1066
                                            /*
 
1067
                                             * axis2_qname_t *qname = NULL;
 
1068
                                             * axiom_attribute_t *the_attri = NULL;
 
1069
                                             * 
 
1070
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
1071
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
1072
                                             */
 
1073
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
1074
 
 
1075
                                            axiom_attribute_t *the_attri = NULL;
 
1076
                                            axis2_char_t *attrib_text = NULL;
 
1077
                                            axutil_hash_t *attribute_hash = NULL;
 
1078
 
 
1079
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
1080
 
 
1081
                                            attrib_text = NULL;
 
1082
                                            if(attribute_hash)
 
1083
                                            {
 
1084
                                                 axutil_hash_index_t *hi;
 
1085
                                                 void *val;
 
1086
                                                 const void *key;
 
1087
                                        
 
1088
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
1089
                                                 {
 
1090
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
1091
                                                     
 
1092
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
1093
                                                     {
 
1094
                                                         the_attri = (axiom_attribute_t*)val;
 
1095
                                                         break;
 
1096
                                                     }
 
1097
                                                 }
 
1098
                                            }
 
1099
 
 
1100
                                            if(the_attri)
 
1101
                                            {
 
1102
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
1103
                                            }
 
1104
                                            else
 
1105
                                            {
 
1106
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
1107
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
1108
                                            }
 
1109
 
 
1110
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
1111
                                            {
 
1112
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element destName");
 
1113
                                                status = AXIS2_FAILURE;
 
1114
                                            }
 
1115
                                            else
 
1116
                                            {
 
1117
                                                /* after all, we found this is a empty string */
 
1118
                                                status = adb_networkRule_set_destName(_networkRule, env,
 
1119
                                                                   "");
 
1120
                                            }
 
1121
                                      }
 
1122
                                      
 
1123
                                 if(AXIS2_FAILURE ==  status)
 
1124
                                 {
 
1125
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for destName ");
 
1126
                                     if(element_qname)
 
1127
                                     {
 
1128
                                         axutil_qname_free(element_qname, env);
 
1129
                                     }
 
1130
                                     return AXIS2_FAILURE;
 
1131
                                 }
 
1132
                              }
 
1133
                           
 
1134
                              else if(!dont_care_minoccurs)
 
1135
                              {
 
1136
                                  if(element_qname)
 
1137
                                  {
 
1138
                                      axutil_qname_free(element_qname, env);
 
1139
                                  }
 
1140
                                  /* this is not a nillable element*/
 
1141
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element destName missing");
 
1142
                                  return AXIS2_FAILURE;
 
1143
                              }
 
1144
                           
 
1145
                  if(element_qname)
 
1146
                  {
 
1147
                     axutil_qname_free(element_qname, env);
 
1148
                     element_qname = NULL;
 
1149
                  }
 
1150
                 
 
1151
 
 
1152
                     
 
1153
                     /*
 
1154
                      * building protocol element
 
1155
                      */
 
1156
                     
 
1157
                     
 
1158
                     
 
1159
                                    /*
 
1160
                                     * because elements are ordered this works fine
 
1161
                                     */
 
1162
                                  
 
1163
                                   
 
1164
                                   if(current_node != NULL && is_early_node_valid)
 
1165
                                   {
 
1166
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
1167
                                       
 
1168
                                       
 
1169
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
1170
                                        {
 
1171
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
1172
                                        }
 
1173
                                        if(current_node != NULL)
 
1174
                                        {
 
1175
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
1176
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
1177
                                        }
 
1178
                                       
 
1179
                                   }
 
1180
                                   is_early_node_valid = AXIS2_FALSE;
 
1181
                                 
 
1182
                                 element_qname = axutil_qname_create(env, "protocol", "http://eucalyptus.ucsb.edu/", NULL);
 
1183
                                 
 
1184
 
 
1185
                           if ( 
 
1186
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
1187
                           {
 
1188
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
1189
                              {
 
1190
                                is_early_node_valid = AXIS2_TRUE;
 
1191
                              }
 
1192
                              
 
1193
                                 
 
1194
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
1195
                                      if(text_value != NULL)
 
1196
                                      {
 
1197
                                            status = adb_networkRule_set_protocol(_networkRule, env,
 
1198
                                                               text_value);
 
1199
                                      }
 
1200
                                      
 
1201
                                      else
 
1202
                                      {
 
1203
                                            /*
 
1204
                                             * axis2_qname_t *qname = NULL;
 
1205
                                             * axiom_attribute_t *the_attri = NULL;
 
1206
                                             * 
 
1207
                                             * qname = axutil_qname_create(env, "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi");
 
1208
                                             * the_attri = axiom_element_get_attribute(current_element, env, qname);
 
1209
                                             */
 
1210
                                            /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */
 
1211
 
 
1212
                                            axiom_attribute_t *the_attri = NULL;
 
1213
                                            axis2_char_t *attrib_text = NULL;
 
1214
                                            axutil_hash_t *attribute_hash = NULL;
 
1215
 
 
1216
                                            attribute_hash = axiom_element_get_all_attributes(current_element, env);
 
1217
 
 
1218
                                            attrib_text = NULL;
 
1219
                                            if(attribute_hash)
 
1220
                                            {
 
1221
                                                 axutil_hash_index_t *hi;
 
1222
                                                 void *val;
 
1223
                                                 const void *key;
 
1224
                                        
 
1225
                                                 for (hi = axutil_hash_first(attribute_hash, env); hi; hi = axutil_hash_next(env, hi)) 
 
1226
                                                 {
 
1227
                                                     axutil_hash_this(hi, &key, NULL, &val);
 
1228
                                                     
 
1229
                                                     if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance"))
 
1230
                                                     {
 
1231
                                                         the_attri = (axiom_attribute_t*)val;
 
1232
                                                         break;
 
1233
                                                     }
 
1234
                                                 }
 
1235
                                            }
 
1236
 
 
1237
                                            if(the_attri)
 
1238
                                            {
 
1239
                                                attrib_text = axiom_attribute_get_value(the_attri, env);
 
1240
                                            }
 
1241
                                            else
 
1242
                                            {
 
1243
                                                /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */
 
1244
                                                attrib_text = axiom_element_get_attribute_value_by_name(current_element, env, "nil");
 
1245
                                            }
 
1246
 
 
1247
                                            if(attrib_text && 0 == axutil_strcmp(attrib_text, "1"))
 
1248
                                            {
 
1249
                                                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element protocol");
 
1250
                                                status = AXIS2_FAILURE;
 
1251
                                            }
 
1252
                                            else
 
1253
                                            {
 
1254
                                                /* after all, we found this is a empty string */
 
1255
                                                status = adb_networkRule_set_protocol(_networkRule, env,
 
1256
                                                                   "");
 
1257
                                            }
 
1258
                                      }
 
1259
                                      
 
1260
                                 if(AXIS2_FAILURE ==  status)
 
1261
                                 {
 
1262
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for protocol ");
 
1263
                                     if(element_qname)
 
1264
                                     {
 
1265
                                         axutil_qname_free(element_qname, env);
 
1266
                                     }
 
1267
                                     return AXIS2_FAILURE;
 
1268
                                 }
 
1269
                              }
 
1270
                           
 
1271
                              else if(!dont_care_minoccurs)
 
1272
                              {
 
1273
                                  if(element_qname)
 
1274
                                  {
 
1275
                                      axutil_qname_free(element_qname, env);
 
1276
                                  }
 
1277
                                  /* this is not a nillable element*/
 
1278
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element protocol missing");
 
1279
                                  return AXIS2_FAILURE;
 
1280
                              }
 
1281
                           
 
1282
                  if(element_qname)
 
1283
                  {
 
1284
                     axutil_qname_free(element_qname, env);
 
1285
                     element_qname = NULL;
 
1286
                  }
 
1287
                 
 
1288
 
 
1289
                     
 
1290
                     /*
 
1291
                      * building portRangeMin element
 
1292
                      */
 
1293
                     
 
1294
                     
 
1295
                     
 
1296
                                    /*
 
1297
                                     * because elements are ordered this works fine
 
1298
                                     */
 
1299
                                  
 
1300
                                   
 
1301
                                   if(current_node != NULL && is_early_node_valid)
 
1302
                                   {
 
1303
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
1304
                                       
 
1305
                                       
 
1306
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
1307
                                        {
 
1308
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
1309
                                        }
 
1310
                                        if(current_node != NULL)
 
1311
                                        {
 
1312
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
1313
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
1314
                                        }
 
1315
                                       
 
1316
                                   }
 
1317
                                   is_early_node_valid = AXIS2_FALSE;
 
1318
                                 
 
1319
                                 element_qname = axutil_qname_create(env, "portRangeMin", "http://eucalyptus.ucsb.edu/", NULL);
 
1320
                                 
 
1321
 
 
1322
                           if ( 
 
1323
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
1324
                           {
 
1325
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
1326
                              {
 
1327
                                is_early_node_valid = AXIS2_TRUE;
 
1328
                              }
 
1329
                              
 
1330
                                 
 
1331
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
1332
                                      if(text_value != NULL)
 
1333
                                      {
 
1334
                                            status = adb_networkRule_set_portRangeMin(_networkRule, env,
 
1335
                                                                   atoi(text_value));
 
1336
                                      }
 
1337
                                      
 
1338
                                      else
 
1339
                                      {
 
1340
                                          AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element portRangeMin");
 
1341
                                          status = AXIS2_FAILURE;
 
1342
                                      }
 
1343
                                      
 
1344
                                 if(AXIS2_FAILURE ==  status)
 
1345
                                 {
 
1346
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for portRangeMin ");
 
1347
                                     if(element_qname)
 
1348
                                     {
 
1349
                                         axutil_qname_free(element_qname, env);
 
1350
                                     }
 
1351
                                     return AXIS2_FAILURE;
 
1352
                                 }
 
1353
                              }
 
1354
                           
 
1355
                              else if(!dont_care_minoccurs)
 
1356
                              {
 
1357
                                  if(element_qname)
 
1358
                                  {
 
1359
                                      axutil_qname_free(element_qname, env);
 
1360
                                  }
 
1361
                                  /* this is not a nillable element*/
 
1362
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element portRangeMin missing");
 
1363
                                  return AXIS2_FAILURE;
 
1364
                              }
 
1365
                           
 
1366
                  if(element_qname)
 
1367
                  {
 
1368
                     axutil_qname_free(element_qname, env);
 
1369
                     element_qname = NULL;
 
1370
                  }
 
1371
                 
 
1372
 
 
1373
                     
 
1374
                     /*
 
1375
                      * building portRangeMax element
 
1376
                      */
 
1377
                     
 
1378
                     
 
1379
                     
 
1380
                                    /*
 
1381
                                     * because elements are ordered this works fine
 
1382
                                     */
 
1383
                                  
 
1384
                                   
 
1385
                                   if(current_node != NULL && is_early_node_valid)
 
1386
                                   {
 
1387
                                       current_node = axiom_node_get_next_sibling(current_node, env);
 
1388
                                       
 
1389
                                       
 
1390
                                        while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
 
1391
                                        {
 
1392
                                            current_node = axiom_node_get_next_sibling(current_node, env);
 
1393
                                        }
 
1394
                                        if(current_node != NULL)
 
1395
                                        {
 
1396
                                            current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
 
1397
                                            qname = axiom_element_get_qname(current_element, env, current_node);
 
1398
                                        }
 
1399
                                       
 
1400
                                   }
 
1401
                                   is_early_node_valid = AXIS2_FALSE;
 
1402
                                 
 
1403
                                 element_qname = axutil_qname_create(env, "portRangeMax", "http://eucalyptus.ucsb.edu/", NULL);
 
1404
                                 
 
1405
 
 
1406
                           if ( 
 
1407
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
 
1408
                           {
 
1409
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
 
1410
                              {
 
1411
                                is_early_node_valid = AXIS2_TRUE;
 
1412
                              }
 
1413
                              
 
1414
                                 
 
1415
                                      text_value = axiom_element_get_text(current_element, env, current_node);
 
1416
                                      if(text_value != NULL)
 
1417
                                      {
 
1418
                                            status = adb_networkRule_set_portRangeMax(_networkRule, env,
 
1419
                                                                   atoi(text_value));
 
1420
                                      }
 
1421
                                      
 
1422
                                      else
 
1423
                                      {
 
1424
                                          AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element portRangeMax");
 
1425
                                          status = AXIS2_FAILURE;
 
1426
                                      }
 
1427
                                      
 
1428
                                 if(AXIS2_FAILURE ==  status)
 
1429
                                 {
 
1430
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for portRangeMax ");
 
1431
                                     if(element_qname)
 
1432
                                     {
 
1433
                                         axutil_qname_free(element_qname, env);
 
1434
                                     }
 
1435
                                     return AXIS2_FAILURE;
 
1436
                                 }
 
1437
                              }
 
1438
                           
 
1439
                              else if(!dont_care_minoccurs)
 
1440
                              {
 
1441
                                  if(element_qname)
 
1442
                                  {
 
1443
                                      axutil_qname_free(element_qname, env);
 
1444
                                  }
 
1445
                                  /* this is not a nillable element*/
 
1446
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element portRangeMax missing");
 
1447
                                  return AXIS2_FAILURE;
 
1448
                              }
 
1449
                           
 
1450
                  if(element_qname)
 
1451
                  {
 
1452
                     axutil_qname_free(element_qname, env);
 
1453
                     element_qname = NULL;
 
1454
                  }
 
1455
                 
 
1456
          return status;
 
1457
       }
 
1458
 
 
1459
          axis2_bool_t AXIS2_CALL
 
1460
          adb_networkRule_is_particle()
 
1461
          {
 
1462
            
 
1463
                 return AXIS2_FALSE;
 
1464
              
 
1465
          }
 
1466
 
 
1467
 
 
1468
          void AXIS2_CALL
 
1469
          adb_networkRule_declare_parent_namespaces(
 
1470
                    adb_networkRule_t* _networkRule,
 
1471
                    const axutil_env_t *env, axiom_element_t *parent_element,
 
1472
                    axutil_hash_t *namespaces, int *next_ns_index)
 
1473
          {
 
1474
            
 
1475
                  /* Here this is an empty function, Nothing to declare */
 
1476
                 
 
1477
          }
 
1478
 
 
1479
        
 
1480
        
 
1481
        axiom_node_t* AXIS2_CALL
 
1482
        adb_networkRule_serialize(
 
1483
                adb_networkRule_t* _networkRule,
 
1484
                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)
 
1485
        {
 
1486
            
 
1487
            
 
1488
             axis2_char_t *string_to_stream;
 
1489
            
 
1490
         
 
1491
         axiom_node_t *current_node = NULL;
 
1492
         int tag_closed = 0;
 
1493
 
 
1494
         
 
1495
         
 
1496
                axiom_namespace_t *ns1 = NULL;
 
1497
 
 
1498
                axis2_char_t *qname_uri = NULL;
 
1499
                axis2_char_t *qname_prefix = NULL;
 
1500
                axis2_char_t *p_prefix = NULL;
 
1501
                axis2_bool_t ns_already_defined;
 
1502
            
 
1503
               int i = 0;
 
1504
               int count = 0;
 
1505
               void *element = NULL;
 
1506
             
 
1507
                    axis2_char_t *text_value_1;
 
1508
                    axis2_char_t *text_value_1_temp;
 
1509
                    
 
1510
                    axis2_char_t *text_value_2;
 
1511
                    axis2_char_t *text_value_2_temp;
 
1512
                    
 
1513
                    axis2_char_t *text_value_3;
 
1514
                    axis2_char_t *text_value_3_temp;
 
1515
                    
 
1516
                    axis2_char_t *text_value_4;
 
1517
                    axis2_char_t *text_value_4_temp;
 
1518
                    
 
1519
                    axis2_char_t *text_value_5;
 
1520
                    axis2_char_t *text_value_5_temp;
 
1521
                    
 
1522
                    axis2_char_t *text_value_6;
 
1523
                    axis2_char_t *text_value_6_temp;
 
1524
                    
 
1525
                    axis2_char_t *text_value_7;
 
1526
                    axis2_char_t *text_value_7_temp;
 
1527
                    
 
1528
                    axis2_char_t text_value_8[64];
 
1529
                    
 
1530
                    axis2_char_t text_value_9[64];
 
1531
                    
 
1532
               axis2_char_t *start_input_str = NULL;
 
1533
               axis2_char_t *end_input_str = NULL;
 
1534
               unsigned int start_input_str_len = 0;
 
1535
               unsigned int end_input_str_len = 0;
 
1536
            
 
1537
            
 
1538
               axiom_data_source_t *data_source = NULL;
 
1539
               axutil_stream_t *stream = NULL;
 
1540
 
 
1541
            
 
1542
 
 
1543
            AXIS2_ENV_CHECK(env, NULL);
 
1544
            AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
1545
            
 
1546
            
 
1547
                    current_node = parent;
 
1548
                    data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env);
 
1549
                    if (!data_source)
 
1550
                        return NULL;
 
1551
                    stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
 
1552
                    if (!stream)
 
1553
                        return NULL;
 
1554
                  
 
1555
            if(!parent_tag_closed)
 
1556
            {
 
1557
            
 
1558
              string_to_stream = ">"; 
 
1559
              axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
 
1560
              tag_closed = 1;
 
1561
            
 
1562
            }
 
1563
            
 
1564
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
1565
                       {
 
1566
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
1567
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
1568
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
1569
                           
 
1570
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
1571
                                            "http://eucalyptus.ucsb.edu/",
 
1572
                                            p_prefix));
 
1573
                       }
 
1574
                      
 
1575
 
 
1576
                   if (!_networkRule->is_valid_type)
 
1577
                   {
 
1578
                      
 
1579
                            
 
1580
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property type");
 
1581
                            return NULL;
 
1582
                          
 
1583
                   }
 
1584
                   else
 
1585
                   {
 
1586
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1587
                                 (4 + axutil_strlen(p_prefix) + 
 
1588
                                  axutil_strlen("type"))); 
 
1589
                                 
 
1590
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
1591
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1592
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("type")));
 
1593
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
1594
                                  
 
1595
                     
 
1596
 
 
1597
                   
 
1598
                   
 
1599
                     
 
1600
                     /*
 
1601
                      * parsing type element
 
1602
                      */
 
1603
 
 
1604
                    
 
1605
                    
 
1606
                            sprintf(start_input_str, "<%s%stype>",
 
1607
                                 p_prefix?p_prefix:"",
 
1608
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1609
                            
 
1610
                        start_input_str_len = axutil_strlen(start_input_str);
 
1611
                        sprintf(end_input_str, "</%s%stype>",
 
1612
                                 p_prefix?p_prefix:"",
 
1613
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1614
                        end_input_str_len = axutil_strlen(end_input_str);
 
1615
                    
 
1616
                           text_value_1 = _networkRule->property_type;
 
1617
                           
 
1618
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
1619
                           
 
1620
                            
 
1621
                           text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE);
 
1622
                           if (text_value_1_temp)
 
1623
                           {
 
1624
                               axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp));
 
1625
                               AXIS2_FREE(env->allocator, text_value_1_temp);
 
1626
                           }
 
1627
                           else
 
1628
                           {
 
1629
                               axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1));
 
1630
                           }
 
1631
                           
 
1632
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
1633
                           
 
1634
                     
 
1635
                     AXIS2_FREE(env->allocator,start_input_str);
 
1636
                     AXIS2_FREE(env->allocator,end_input_str);
 
1637
                 } 
 
1638
 
 
1639
                 
 
1640
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
1641
                       {
 
1642
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
1643
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
1644
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
1645
                           
 
1646
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
1647
                                            "http://eucalyptus.ucsb.edu/",
 
1648
                                            p_prefix));
 
1649
                       }
 
1650
                      
 
1651
 
 
1652
                   if (!_networkRule->is_valid_sourceNames)
 
1653
                   {
 
1654
                      
 
1655
                           /* no need to complain for minoccurs=0 element */
 
1656
                            
 
1657
                          
 
1658
                   }
 
1659
                   else
 
1660
                   {
 
1661
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1662
                                 (4 + axutil_strlen(p_prefix) + 
 
1663
                                  axutil_strlen("sourceNames"))); 
 
1664
                                 
 
1665
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
1666
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1667
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("sourceNames")));
 
1668
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
1669
                                  
 
1670
                     
 
1671
 
 
1672
                   
 
1673
                   
 
1674
                     /*
 
1675
                      * Parsing sourceNames array
 
1676
                      */
 
1677
                     if (_networkRule->property_sourceNames != NULL)
 
1678
                     {
 
1679
                        
 
1680
                            sprintf(start_input_str, "<%s%ssourceNames>",
 
1681
                                 p_prefix?p_prefix:"",
 
1682
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); 
 
1683
                            
 
1684
                         start_input_str_len = axutil_strlen(start_input_str);
 
1685
 
 
1686
                         sprintf(end_input_str, "</%s%ssourceNames>",
 
1687
                                 p_prefix?p_prefix:"",
 
1688
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1689
                         end_input_str_len = axutil_strlen(end_input_str);
 
1690
 
 
1691
                         count = axutil_array_list_size(_networkRule->property_sourceNames, env);
 
1692
                         for(i = 0; i < count; i ++)
 
1693
                         {
 
1694
                            element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
 
1695
 
 
1696
                            if(NULL == element) 
 
1697
                            {
 
1698
                                continue;
 
1699
                            }
 
1700
                    
 
1701
                     
 
1702
                     /*
 
1703
                      * parsing sourceNames element
 
1704
                      */
 
1705
 
 
1706
                    
 
1707
                    
 
1708
                           text_value_2 = (axis2_char_t*)element;
 
1709
                           
 
1710
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
1711
                           
 
1712
                            
 
1713
                           text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
 
1714
                           if (text_value_2_temp)
 
1715
                           {
 
1716
                               axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp));
 
1717
                               AXIS2_FREE(env->allocator, text_value_2_temp);
 
1718
                           }
 
1719
                           else
 
1720
                           {
 
1721
                               axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2));
 
1722
                           }
 
1723
                           
 
1724
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
1725
                           
 
1726
                         }
 
1727
                     }
 
1728
                   
 
1729
                     
 
1730
                     AXIS2_FREE(env->allocator,start_input_str);
 
1731
                     AXIS2_FREE(env->allocator,end_input_str);
 
1732
                 } 
 
1733
 
 
1734
                 
 
1735
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
1736
                       {
 
1737
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
1738
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
1739
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
1740
                           
 
1741
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
1742
                                            "http://eucalyptus.ucsb.edu/",
 
1743
                                            p_prefix));
 
1744
                       }
 
1745
                      
 
1746
 
 
1747
                   if (!_networkRule->is_valid_userNames)
 
1748
                   {
 
1749
                      
 
1750
                           /* no need to complain for minoccurs=0 element */
 
1751
                            
 
1752
                          
 
1753
                   }
 
1754
                   else
 
1755
                   {
 
1756
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1757
                                 (4 + axutil_strlen(p_prefix) + 
 
1758
                                  axutil_strlen("userNames"))); 
 
1759
                                 
 
1760
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
1761
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1762
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("userNames")));
 
1763
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
1764
                                  
 
1765
                     
 
1766
 
 
1767
                   
 
1768
                   
 
1769
                     /*
 
1770
                      * Parsing userNames array
 
1771
                      */
 
1772
                     if (_networkRule->property_userNames != NULL)
 
1773
                     {
 
1774
                        
 
1775
                            sprintf(start_input_str, "<%s%suserNames>",
 
1776
                                 p_prefix?p_prefix:"",
 
1777
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); 
 
1778
                            
 
1779
                         start_input_str_len = axutil_strlen(start_input_str);
 
1780
 
 
1781
                         sprintf(end_input_str, "</%s%suserNames>",
 
1782
                                 p_prefix?p_prefix:"",
 
1783
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1784
                         end_input_str_len = axutil_strlen(end_input_str);
 
1785
 
 
1786
                         count = axutil_array_list_size(_networkRule->property_userNames, env);
 
1787
                         for(i = 0; i < count; i ++)
 
1788
                         {
 
1789
                            element = axutil_array_list_get(_networkRule->property_userNames, env, i);
 
1790
 
 
1791
                            if(NULL == element) 
 
1792
                            {
 
1793
                                continue;
 
1794
                            }
 
1795
                    
 
1796
                     
 
1797
                     /*
 
1798
                      * parsing userNames element
 
1799
                      */
 
1800
 
 
1801
                    
 
1802
                    
 
1803
                           text_value_3 = (axis2_char_t*)element;
 
1804
                           
 
1805
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
1806
                           
 
1807
                            
 
1808
                           text_value_3_temp = axutil_xml_quote_string(env, text_value_3, AXIS2_TRUE);
 
1809
                           if (text_value_3_temp)
 
1810
                           {
 
1811
                               axutil_stream_write(stream, env, text_value_3_temp, axutil_strlen(text_value_3_temp));
 
1812
                               AXIS2_FREE(env->allocator, text_value_3_temp);
 
1813
                           }
 
1814
                           else
 
1815
                           {
 
1816
                               axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3));
 
1817
                           }
 
1818
                           
 
1819
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
1820
                           
 
1821
                         }
 
1822
                     }
 
1823
                   
 
1824
                     
 
1825
                     AXIS2_FREE(env->allocator,start_input_str);
 
1826
                     AXIS2_FREE(env->allocator,end_input_str);
 
1827
                 } 
 
1828
 
 
1829
                 
 
1830
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
1831
                       {
 
1832
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
1833
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
1834
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
1835
                           
 
1836
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
1837
                                            "http://eucalyptus.ucsb.edu/",
 
1838
                                            p_prefix));
 
1839
                       }
 
1840
                      
 
1841
 
 
1842
                   if (!_networkRule->is_valid_sourceNets)
 
1843
                   {
 
1844
                      
 
1845
                           /* no need to complain for minoccurs=0 element */
 
1846
                            
 
1847
                          
 
1848
                   }
 
1849
                   else
 
1850
                   {
 
1851
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1852
                                 (4 + axutil_strlen(p_prefix) + 
 
1853
                                  axutil_strlen("sourceNets"))); 
 
1854
                                 
 
1855
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
1856
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1857
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("sourceNets")));
 
1858
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
1859
                                  
 
1860
                     
 
1861
 
 
1862
                   
 
1863
                   
 
1864
                     /*
 
1865
                      * Parsing sourceNets array
 
1866
                      */
 
1867
                     if (_networkRule->property_sourceNets != NULL)
 
1868
                     {
 
1869
                        
 
1870
                            sprintf(start_input_str, "<%s%ssourceNets>",
 
1871
                                 p_prefix?p_prefix:"",
 
1872
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); 
 
1873
                            
 
1874
                         start_input_str_len = axutil_strlen(start_input_str);
 
1875
 
 
1876
                         sprintf(end_input_str, "</%s%ssourceNets>",
 
1877
                                 p_prefix?p_prefix:"",
 
1878
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1879
                         end_input_str_len = axutil_strlen(end_input_str);
 
1880
 
 
1881
                         count = axutil_array_list_size(_networkRule->property_sourceNets, env);
 
1882
                         for(i = 0; i < count; i ++)
 
1883
                         {
 
1884
                            element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
 
1885
 
 
1886
                            if(NULL == element) 
 
1887
                            {
 
1888
                                continue;
 
1889
                            }
 
1890
                    
 
1891
                     
 
1892
                     /*
 
1893
                      * parsing sourceNets element
 
1894
                      */
 
1895
 
 
1896
                    
 
1897
                    
 
1898
                           text_value_4 = (axis2_char_t*)element;
 
1899
                           
 
1900
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
1901
                           
 
1902
                            
 
1903
                           text_value_4_temp = axutil_xml_quote_string(env, text_value_4, AXIS2_TRUE);
 
1904
                           if (text_value_4_temp)
 
1905
                           {
 
1906
                               axutil_stream_write(stream, env, text_value_4_temp, axutil_strlen(text_value_4_temp));
 
1907
                               AXIS2_FREE(env->allocator, text_value_4_temp);
 
1908
                           }
 
1909
                           else
 
1910
                           {
 
1911
                               axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4));
 
1912
                           }
 
1913
                           
 
1914
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
1915
                           
 
1916
                         }
 
1917
                     }
 
1918
                   
 
1919
                     
 
1920
                     AXIS2_FREE(env->allocator,start_input_str);
 
1921
                     AXIS2_FREE(env->allocator,end_input_str);
 
1922
                 } 
 
1923
 
 
1924
                 
 
1925
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
1926
                       {
 
1927
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
1928
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
1929
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
1930
                           
 
1931
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
1932
                                            "http://eucalyptus.ucsb.edu/",
 
1933
                                            p_prefix));
 
1934
                       }
 
1935
                      
 
1936
 
 
1937
                   if (!_networkRule->is_valid_destUserName)
 
1938
                   {
 
1939
                      
 
1940
                           /* no need to complain for minoccurs=0 element */
 
1941
                            
 
1942
                          
 
1943
                   }
 
1944
                   else
 
1945
                   {
 
1946
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1947
                                 (4 + axutil_strlen(p_prefix) + 
 
1948
                                  axutil_strlen("destUserName"))); 
 
1949
                                 
 
1950
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
1951
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
1952
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("destUserName")));
 
1953
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
1954
                                  
 
1955
                     
 
1956
 
 
1957
                   
 
1958
                   
 
1959
                     
 
1960
                     /*
 
1961
                      * parsing destUserName element
 
1962
                      */
 
1963
 
 
1964
                    
 
1965
                    
 
1966
                            sprintf(start_input_str, "<%s%sdestUserName>",
 
1967
                                 p_prefix?p_prefix:"",
 
1968
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1969
                            
 
1970
                        start_input_str_len = axutil_strlen(start_input_str);
 
1971
                        sprintf(end_input_str, "</%s%sdestUserName>",
 
1972
                                 p_prefix?p_prefix:"",
 
1973
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
1974
                        end_input_str_len = axutil_strlen(end_input_str);
 
1975
                    
 
1976
                           text_value_5 = _networkRule->property_destUserName;
 
1977
                           
 
1978
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
1979
                           
 
1980
                            
 
1981
                           text_value_5_temp = axutil_xml_quote_string(env, text_value_5, AXIS2_TRUE);
 
1982
                           if (text_value_5_temp)
 
1983
                           {
 
1984
                               axutil_stream_write(stream, env, text_value_5_temp, axutil_strlen(text_value_5_temp));
 
1985
                               AXIS2_FREE(env->allocator, text_value_5_temp);
 
1986
                           }
 
1987
                           else
 
1988
                           {
 
1989
                               axutil_stream_write(stream, env, text_value_5, axutil_strlen(text_value_5));
 
1990
                           }
 
1991
                           
 
1992
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
1993
                           
 
1994
                     
 
1995
                     AXIS2_FREE(env->allocator,start_input_str);
 
1996
                     AXIS2_FREE(env->allocator,end_input_str);
 
1997
                 } 
 
1998
 
 
1999
                 
 
2000
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
2001
                       {
 
2002
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
2003
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
2004
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
2005
                           
 
2006
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
2007
                                            "http://eucalyptus.ucsb.edu/",
 
2008
                                            p_prefix));
 
2009
                       }
 
2010
                      
 
2011
 
 
2012
                   if (!_networkRule->is_valid_destName)
 
2013
                   {
 
2014
                      
 
2015
                            
 
2016
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property destName");
 
2017
                            return NULL;
 
2018
                          
 
2019
                   }
 
2020
                   else
 
2021
                   {
 
2022
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2023
                                 (4 + axutil_strlen(p_prefix) + 
 
2024
                                  axutil_strlen("destName"))); 
 
2025
                                 
 
2026
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
2027
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2028
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("destName")));
 
2029
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
2030
                                  
 
2031
                     
 
2032
 
 
2033
                   
 
2034
                   
 
2035
                     
 
2036
                     /*
 
2037
                      * parsing destName element
 
2038
                      */
 
2039
 
 
2040
                    
 
2041
                    
 
2042
                            sprintf(start_input_str, "<%s%sdestName>",
 
2043
                                 p_prefix?p_prefix:"",
 
2044
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2045
                            
 
2046
                        start_input_str_len = axutil_strlen(start_input_str);
 
2047
                        sprintf(end_input_str, "</%s%sdestName>",
 
2048
                                 p_prefix?p_prefix:"",
 
2049
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2050
                        end_input_str_len = axutil_strlen(end_input_str);
 
2051
                    
 
2052
                           text_value_6 = _networkRule->property_destName;
 
2053
                           
 
2054
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
2055
                           
 
2056
                            
 
2057
                           text_value_6_temp = axutil_xml_quote_string(env, text_value_6, AXIS2_TRUE);
 
2058
                           if (text_value_6_temp)
 
2059
                           {
 
2060
                               axutil_stream_write(stream, env, text_value_6_temp, axutil_strlen(text_value_6_temp));
 
2061
                               AXIS2_FREE(env->allocator, text_value_6_temp);
 
2062
                           }
 
2063
                           else
 
2064
                           {
 
2065
                               axutil_stream_write(stream, env, text_value_6, axutil_strlen(text_value_6));
 
2066
                           }
 
2067
                           
 
2068
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
2069
                           
 
2070
                     
 
2071
                     AXIS2_FREE(env->allocator,start_input_str);
 
2072
                     AXIS2_FREE(env->allocator,end_input_str);
 
2073
                 } 
 
2074
 
 
2075
                 
 
2076
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
2077
                       {
 
2078
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
2079
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
2080
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
2081
                           
 
2082
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
2083
                                            "http://eucalyptus.ucsb.edu/",
 
2084
                                            p_prefix));
 
2085
                       }
 
2086
                      
 
2087
 
 
2088
                   if (!_networkRule->is_valid_protocol)
 
2089
                   {
 
2090
                      
 
2091
                            
 
2092
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property protocol");
 
2093
                            return NULL;
 
2094
                          
 
2095
                   }
 
2096
                   else
 
2097
                   {
 
2098
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2099
                                 (4 + axutil_strlen(p_prefix) + 
 
2100
                                  axutil_strlen("protocol"))); 
 
2101
                                 
 
2102
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
2103
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2104
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("protocol")));
 
2105
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
2106
                                  
 
2107
                     
 
2108
 
 
2109
                   
 
2110
                   
 
2111
                     
 
2112
                     /*
 
2113
                      * parsing protocol element
 
2114
                      */
 
2115
 
 
2116
                    
 
2117
                    
 
2118
                            sprintf(start_input_str, "<%s%sprotocol>",
 
2119
                                 p_prefix?p_prefix:"",
 
2120
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2121
                            
 
2122
                        start_input_str_len = axutil_strlen(start_input_str);
 
2123
                        sprintf(end_input_str, "</%s%sprotocol>",
 
2124
                                 p_prefix?p_prefix:"",
 
2125
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2126
                        end_input_str_len = axutil_strlen(end_input_str);
 
2127
                    
 
2128
                           text_value_7 = _networkRule->property_protocol;
 
2129
                           
 
2130
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
2131
                           
 
2132
                            
 
2133
                           text_value_7_temp = axutil_xml_quote_string(env, text_value_7, AXIS2_TRUE);
 
2134
                           if (text_value_7_temp)
 
2135
                           {
 
2136
                               axutil_stream_write(stream, env, text_value_7_temp, axutil_strlen(text_value_7_temp));
 
2137
                               AXIS2_FREE(env->allocator, text_value_7_temp);
 
2138
                           }
 
2139
                           else
 
2140
                           {
 
2141
                               axutil_stream_write(stream, env, text_value_7, axutil_strlen(text_value_7));
 
2142
                           }
 
2143
                           
 
2144
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
2145
                           
 
2146
                     
 
2147
                     AXIS2_FREE(env->allocator,start_input_str);
 
2148
                     AXIS2_FREE(env->allocator,end_input_str);
 
2149
                 } 
 
2150
 
 
2151
                 
 
2152
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
2153
                       {
 
2154
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
2155
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
2156
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
2157
                           
 
2158
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
2159
                                            "http://eucalyptus.ucsb.edu/",
 
2160
                                            p_prefix));
 
2161
                       }
 
2162
                      
 
2163
 
 
2164
                   if (!_networkRule->is_valid_portRangeMin)
 
2165
                   {
 
2166
                      
 
2167
                            
 
2168
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property portRangeMin");
 
2169
                            return NULL;
 
2170
                          
 
2171
                   }
 
2172
                   else
 
2173
                   {
 
2174
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2175
                                 (4 + axutil_strlen(p_prefix) + 
 
2176
                                  axutil_strlen("portRangeMin"))); 
 
2177
                                 
 
2178
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
2179
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2180
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("portRangeMin")));
 
2181
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
2182
                                  
 
2183
                     
 
2184
 
 
2185
                   
 
2186
                   
 
2187
                     
 
2188
                     /*
 
2189
                      * parsing portRangeMin element
 
2190
                      */
 
2191
 
 
2192
                    
 
2193
                    
 
2194
                            sprintf(start_input_str, "<%s%sportRangeMin>",
 
2195
                                 p_prefix?p_prefix:"",
 
2196
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2197
                            
 
2198
                        start_input_str_len = axutil_strlen(start_input_str);
 
2199
                        sprintf(end_input_str, "</%s%sportRangeMin>",
 
2200
                                 p_prefix?p_prefix:"",
 
2201
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2202
                        end_input_str_len = axutil_strlen(end_input_str);
 
2203
                    
 
2204
                               sprintf (text_value_8, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _networkRule->property_portRangeMin);
 
2205
                             
 
2206
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
2207
                           
 
2208
                           axutil_stream_write(stream, env, text_value_8, axutil_strlen(text_value_8));
 
2209
                           
 
2210
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
2211
                           
 
2212
                     
 
2213
                     AXIS2_FREE(env->allocator,start_input_str);
 
2214
                     AXIS2_FREE(env->allocator,end_input_str);
 
2215
                 } 
 
2216
 
 
2217
                 
 
2218
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
 
2219
                       {
 
2220
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
 
2221
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
 
2222
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
 
2223
                           
 
2224
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
 
2225
                                            "http://eucalyptus.ucsb.edu/",
 
2226
                                            p_prefix));
 
2227
                       }
 
2228
                      
 
2229
 
 
2230
                   if (!_networkRule->is_valid_portRangeMax)
 
2231
                   {
 
2232
                      
 
2233
                            
 
2234
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property portRangeMax");
 
2235
                            return NULL;
 
2236
                          
 
2237
                   }
 
2238
                   else
 
2239
                   {
 
2240
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2241
                                 (4 + axutil_strlen(p_prefix) + 
 
2242
                                  axutil_strlen("portRangeMax"))); 
 
2243
                                 
 
2244
                                 /* axutil_strlen("<:>") + 1 = 4 */
 
2245
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
 
2246
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("portRangeMax")));
 
2247
                                  /* axutil_strlen("</:>") + 1 = 5 */
 
2248
                                  
 
2249
                     
 
2250
 
 
2251
                   
 
2252
                   
 
2253
                     
 
2254
                     /*
 
2255
                      * parsing portRangeMax element
 
2256
                      */
 
2257
 
 
2258
                    
 
2259
                    
 
2260
                            sprintf(start_input_str, "<%s%sportRangeMax>",
 
2261
                                 p_prefix?p_prefix:"",
 
2262
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2263
                            
 
2264
                        start_input_str_len = axutil_strlen(start_input_str);
 
2265
                        sprintf(end_input_str, "</%s%sportRangeMax>",
 
2266
                                 p_prefix?p_prefix:"",
 
2267
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
 
2268
                        end_input_str_len = axutil_strlen(end_input_str);
 
2269
                    
 
2270
                               sprintf (text_value_9, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _networkRule->property_portRangeMax);
 
2271
                             
 
2272
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
 
2273
                           
 
2274
                           axutil_stream_write(stream, env, text_value_9, axutil_strlen(text_value_9));
 
2275
                           
 
2276
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
 
2277
                           
 
2278
                     
 
2279
                     AXIS2_FREE(env->allocator,start_input_str);
 
2280
                     AXIS2_FREE(env->allocator,end_input_str);
 
2281
                 } 
 
2282
 
 
2283
                 
 
2284
 
 
2285
            return parent;
 
2286
        }
 
2287
 
 
2288
 
 
2289
        
 
2290
 
 
2291
            /**
 
2292
             * getter for type.
 
2293
             */
 
2294
            axis2_char_t* AXIS2_CALL
 
2295
            adb_networkRule_get_type(
 
2296
                    adb_networkRule_t* _networkRule,
 
2297
                    const axutil_env_t *env)
 
2298
             {
 
2299
                
 
2300
                    AXIS2_ENV_CHECK(env, NULL);
 
2301
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
2302
                  
 
2303
 
 
2304
                return _networkRule->property_type;
 
2305
             }
 
2306
 
 
2307
            /**
 
2308
             * setter for type
 
2309
             */
 
2310
            axis2_status_t AXIS2_CALL
 
2311
            adb_networkRule_set_type(
 
2312
                    adb_networkRule_t* _networkRule,
 
2313
                    const axutil_env_t *env,
 
2314
                    const axis2_char_t*  arg_type)
 
2315
             {
 
2316
                
 
2317
 
 
2318
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2319
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2320
                
 
2321
                if(_networkRule->is_valid_type &&
 
2322
                        arg_type == _networkRule->property_type)
 
2323
                {
 
2324
                    
 
2325
                    return AXIS2_SUCCESS; 
 
2326
                }
 
2327
 
 
2328
                
 
2329
                  if(NULL == arg_type)
 
2330
                  {
 
2331
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "type is being set to NULL, but it is not a nullable element");
 
2332
                      return AXIS2_FAILURE;
 
2333
                  }
 
2334
                adb_networkRule_reset_type(_networkRule, env);
 
2335
 
 
2336
                
 
2337
                if(NULL == arg_type)
 
2338
                {
 
2339
                    /* We are already done */
 
2340
                    return AXIS2_SUCCESS;
 
2341
                }
 
2342
                _networkRule->property_type = (axis2_char_t *)axutil_strdup(env, arg_type);
 
2343
                        if(NULL == _networkRule->property_type)
 
2344
                        {
 
2345
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for type");
 
2346
                            return AXIS2_FAILURE;
 
2347
                        }
 
2348
                        _networkRule->is_valid_type = AXIS2_TRUE;
 
2349
                    
 
2350
                return AXIS2_SUCCESS;
 
2351
             }
 
2352
 
 
2353
             
 
2354
 
 
2355
           /**
 
2356
            * resetter for type
 
2357
            */
 
2358
           axis2_status_t AXIS2_CALL
 
2359
           adb_networkRule_reset_type(
 
2360
                   adb_networkRule_t* _networkRule,
 
2361
                   const axutil_env_t *env)
 
2362
           {
 
2363
               int i = 0;
 
2364
               int count = 0;
 
2365
               void *element = NULL;
 
2366
 
 
2367
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2368
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2369
               
 
2370
 
 
2371
               
 
2372
            
 
2373
                
 
2374
                if(_networkRule->property_type != NULL)
 
2375
                {
 
2376
                   
 
2377
                   
 
2378
                        AXIS2_FREE(env-> allocator, _networkRule->property_type);
 
2379
                     _networkRule->property_type = NULL;
 
2380
                }
 
2381
            
 
2382
                
 
2383
                
 
2384
                _networkRule->is_valid_type = AXIS2_FALSE; 
 
2385
               return AXIS2_SUCCESS;
 
2386
           }
 
2387
 
 
2388
           /**
 
2389
            * Check whether type is nill
 
2390
            */
 
2391
           axis2_bool_t AXIS2_CALL
 
2392
           adb_networkRule_is_type_nil(
 
2393
                   adb_networkRule_t* _networkRule,
 
2394
                   const axutil_env_t *env)
 
2395
           {
 
2396
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
2397
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
2398
               
 
2399
               return !_networkRule->is_valid_type;
 
2400
           }
 
2401
 
 
2402
           /**
 
2403
            * Set type to nill (currently the same as reset)
 
2404
            */
 
2405
           axis2_status_t AXIS2_CALL
 
2406
           adb_networkRule_set_type_nil(
 
2407
                   adb_networkRule_t* _networkRule,
 
2408
                   const axutil_env_t *env)
 
2409
           {
 
2410
               return adb_networkRule_reset_type(_networkRule, env);
 
2411
           }
 
2412
 
 
2413
           
 
2414
 
 
2415
            /**
 
2416
             * getter for sourceNames.
 
2417
             */
 
2418
            axutil_array_list_t* AXIS2_CALL
 
2419
            adb_networkRule_get_sourceNames(
 
2420
                    adb_networkRule_t* _networkRule,
 
2421
                    const axutil_env_t *env)
 
2422
             {
 
2423
                
 
2424
                    AXIS2_ENV_CHECK(env, NULL);
 
2425
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
2426
                  
 
2427
 
 
2428
                return _networkRule->property_sourceNames;
 
2429
             }
 
2430
 
 
2431
            /**
 
2432
             * setter for sourceNames
 
2433
             */
 
2434
            axis2_status_t AXIS2_CALL
 
2435
            adb_networkRule_set_sourceNames(
 
2436
                    adb_networkRule_t* _networkRule,
 
2437
                    const axutil_env_t *env,
 
2438
                    axutil_array_list_t*  arg_sourceNames)
 
2439
             {
 
2440
                
 
2441
                 int size = 0;
 
2442
                 int i = 0;
 
2443
                 axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
2444
                
 
2445
 
 
2446
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2447
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2448
                
 
2449
                if(_networkRule->is_valid_sourceNames &&
 
2450
                        arg_sourceNames == _networkRule->property_sourceNames)
 
2451
                {
 
2452
                    
 
2453
                    return AXIS2_SUCCESS; 
 
2454
                }
 
2455
 
 
2456
                
 
2457
                 size = axutil_array_list_size(arg_sourceNames, env);
 
2458
                 
 
2459
                 if (size < 0)
 
2460
                 {
 
2461
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNames has less than minOccurs(0)");
 
2462
                     return AXIS2_FAILURE;
 
2463
                 }
 
2464
                 for(i = 0; i < size; i ++ )
 
2465
                 {
 
2466
                     if(NULL != axutil_array_list_get(arg_sourceNames, env, i))
 
2467
                     {
 
2468
                         non_nil_exists = AXIS2_TRUE;
 
2469
                         break;
 
2470
                     }
 
2471
                 }
 
2472
 
 
2473
                 adb_networkRule_reset_sourceNames(_networkRule, env);
 
2474
 
 
2475
                
 
2476
                if(NULL == arg_sourceNames)
 
2477
                {
 
2478
                    /* We are already done */
 
2479
                    return AXIS2_SUCCESS;
 
2480
                }
 
2481
                _networkRule->property_sourceNames = arg_sourceNames;
 
2482
                        if(non_nil_exists)
 
2483
                        {
 
2484
                            _networkRule->is_valid_sourceNames = AXIS2_TRUE;
 
2485
                        }
 
2486
                        
 
2487
                    
 
2488
                return AXIS2_SUCCESS;
 
2489
             }
 
2490
 
 
2491
            
 
2492
            /**
 
2493
             * Get ith element of sourceNames.
 
2494
             */
 
2495
            axis2_char_t* AXIS2_CALL
 
2496
            adb_networkRule_get_sourceNames_at(
 
2497
                    adb_networkRule_t* _networkRule,
 
2498
                    const axutil_env_t *env, int i)
 
2499
            {
 
2500
                axis2_char_t* ret_val;
 
2501
 
 
2502
                
 
2503
                    AXIS2_ENV_CHECK(env, NULL);
 
2504
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
2505
                  
 
2506
 
 
2507
                if(_networkRule->property_sourceNames == NULL)
 
2508
                {
 
2509
                    return (axis2_char_t*)0;
 
2510
                }
 
2511
                ret_val = (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNames, env, i);
 
2512
                
 
2513
                    return ret_val;
 
2514
                  
 
2515
            }
 
2516
 
 
2517
            /**
 
2518
             * Set the ith element of sourceNames.
 
2519
             */
 
2520
            axis2_status_t AXIS2_CALL
 
2521
            adb_networkRule_set_sourceNames_at(
 
2522
                    adb_networkRule_t* _networkRule,
 
2523
                    const axutil_env_t *env, int i,
 
2524
                    const axis2_char_t* arg_sourceNames)
 
2525
            {
 
2526
                void *element = NULL;
 
2527
                int size = 0;
 
2528
                int j;
 
2529
                int k;
 
2530
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
2531
 
 
2532
                
 
2533
 
 
2534
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2535
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2536
                
 
2537
                if( _networkRule->is_valid_sourceNames &&
 
2538
                    _networkRule->property_sourceNames &&
 
2539
                
 
2540
                    arg_sourceNames == (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNames, env, i))
 
2541
                  
 
2542
                {
 
2543
                    
 
2544
                    return AXIS2_SUCCESS; 
 
2545
                }
 
2546
 
 
2547
                
 
2548
                    if(NULL == arg_sourceNames)
 
2549
                    {
 
2550
                        if(_networkRule->property_sourceNames != NULL)
 
2551
                        {
 
2552
                            size = axutil_array_list_size(_networkRule->property_sourceNames, env);
 
2553
                            for(j = 0, k = 0; j < size; j ++ )
 
2554
                            {
 
2555
                                if(i == j) continue; 
 
2556
                                if(NULL != axutil_array_list_get(_networkRule->property_sourceNames, env, i))
 
2557
                                {
 
2558
                                    k ++;
 
2559
                                    non_nil_exists = AXIS2_TRUE;
 
2560
                                    if(k >= 0)
 
2561
                                    {
 
2562
                                        break;
 
2563
                                    }
 
2564
                                }
 
2565
                            }
 
2566
                        }
 
2567
                    }
 
2568
                    else
 
2569
                    {
 
2570
                        non_nil_exists = AXIS2_TRUE;
 
2571
                    }
 
2572
                  
 
2573
                if( k < 0)
 
2574
                {
 
2575
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNames is beinng set to be smaller than the specificed number of minOccurs(0)");
 
2576
                       return AXIS2_FAILURE;
 
2577
                }
 
2578
 
 
2579
                if(_networkRule->property_sourceNames == NULL)
 
2580
                {
 
2581
                    _networkRule->property_sourceNames = axutil_array_list_create(env, 10);
 
2582
                }
 
2583
                
 
2584
                /* check whether there already exist an element */
 
2585
                element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
 
2586
                if(NULL != element)
 
2587
                {
 
2588
                  
 
2589
                  
 
2590
                  
 
2591
                       /* This is an unknown type or a primitive. Please free this manually*/
 
2592
                     
 
2593
                }
 
2594
 
 
2595
                
 
2596
                    if(!non_nil_exists)
 
2597
                    {
 
2598
                        
 
2599
                        _networkRule->is_valid_sourceNames = AXIS2_FALSE;
 
2600
                        axutil_array_list_set(_networkRule->property_sourceNames , env, i, NULL);
 
2601
                        
 
2602
                        return AXIS2_SUCCESS;
 
2603
                    }
 
2604
                
 
2605
                   axutil_array_list_set(_networkRule->property_sourceNames , env, i, axutil_strdup(env, arg_sourceNames));
 
2606
                  _networkRule->is_valid_sourceNames = AXIS2_TRUE;
 
2607
                
 
2608
                return AXIS2_SUCCESS;
 
2609
            }
 
2610
 
 
2611
            /**
 
2612
             * Add to sourceNames.
 
2613
             */
 
2614
            axis2_status_t AXIS2_CALL
 
2615
            adb_networkRule_add_sourceNames(
 
2616
                    adb_networkRule_t* _networkRule,
 
2617
                    const axutil_env_t *env,
 
2618
                    const axis2_char_t* arg_sourceNames)
 
2619
             {
 
2620
                
 
2621
 
 
2622
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2623
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2624
 
 
2625
                
 
2626
                    if(NULL == arg_sourceNames)
 
2627
                    {
 
2628
                      
 
2629
                           return AXIS2_SUCCESS; 
 
2630
                        
 
2631
                    }
 
2632
                  
 
2633
 
 
2634
                if(_networkRule->property_sourceNames == NULL)
 
2635
                {
 
2636
                    _networkRule->property_sourceNames = axutil_array_list_create(env, 10);
 
2637
                }
 
2638
                if(_networkRule->property_sourceNames == NULL)
 
2639
                {
 
2640
                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for sourceNames");
 
2641
                    return AXIS2_FAILURE;
 
2642
                    
 
2643
                }
 
2644
                
 
2645
                   axutil_array_list_add(_networkRule->property_sourceNames , env, axutil_strdup(env, arg_sourceNames));
 
2646
                  _networkRule->is_valid_sourceNames = AXIS2_TRUE;
 
2647
                return AXIS2_SUCCESS;
 
2648
             }
 
2649
 
 
2650
            /**
 
2651
             * Get the size of the sourceNames array.
 
2652
             */
 
2653
            int AXIS2_CALL
 
2654
            adb_networkRule_sizeof_sourceNames(
 
2655
                    adb_networkRule_t* _networkRule,
 
2656
                    const axutil_env_t *env)
 
2657
            {
 
2658
                AXIS2_ENV_CHECK(env, -1);
 
2659
                AXIS2_PARAM_CHECK(env->error, _networkRule, -1);
 
2660
                if(_networkRule->property_sourceNames == NULL)
 
2661
                {
 
2662
                    return 0;
 
2663
                }
 
2664
                return axutil_array_list_size(_networkRule->property_sourceNames, env);
 
2665
            }
 
2666
 
 
2667
            /**
 
2668
             * remove the ith element, same as set_nil_at.
 
2669
             */
 
2670
            axis2_status_t AXIS2_CALL
 
2671
            adb_networkRule_remove_sourceNames_at(
 
2672
                    adb_networkRule_t* _networkRule,
 
2673
                    const axutil_env_t *env, int i)
 
2674
            {
 
2675
                return adb_networkRule_set_sourceNames_nil_at(_networkRule, env, i);
 
2676
            }
 
2677
 
 
2678
            
 
2679
 
 
2680
           /**
 
2681
            * resetter for sourceNames
 
2682
            */
 
2683
           axis2_status_t AXIS2_CALL
 
2684
           adb_networkRule_reset_sourceNames(
 
2685
                   adb_networkRule_t* _networkRule,
 
2686
                   const axutil_env_t *env)
 
2687
           {
 
2688
               int i = 0;
 
2689
               int count = 0;
 
2690
               void *element = NULL;
 
2691
 
 
2692
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2693
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2694
               
 
2695
 
 
2696
               
 
2697
                  if (_networkRule->property_sourceNames != NULL)
 
2698
                  {
 
2699
                      count = axutil_array_list_size(_networkRule->property_sourceNames, env);
 
2700
                      for(i = 0; i < count; i ++)
 
2701
                      {
 
2702
                         element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
 
2703
                
 
2704
            
 
2705
                
 
2706
                if(element != NULL)
 
2707
                {
 
2708
                   
 
2709
                   
 
2710
                        AXIS2_FREE(env-> allocator, (axis2_char_t*)element);
 
2711
                     element = NULL;
 
2712
                }
 
2713
            
 
2714
                
 
2715
                
 
2716
                
 
2717
                      }
 
2718
                      axutil_array_list_free(_networkRule->property_sourceNames, env);
 
2719
                  }
 
2720
                _networkRule->is_valid_sourceNames = AXIS2_FALSE; 
 
2721
               return AXIS2_SUCCESS;
 
2722
           }
 
2723
 
 
2724
           /**
 
2725
            * Check whether sourceNames is nill
 
2726
            */
 
2727
           axis2_bool_t AXIS2_CALL
 
2728
           adb_networkRule_is_sourceNames_nil(
 
2729
                   adb_networkRule_t* _networkRule,
 
2730
                   const axutil_env_t *env)
 
2731
           {
 
2732
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
2733
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
2734
               
 
2735
               return !_networkRule->is_valid_sourceNames;
 
2736
           }
 
2737
 
 
2738
           /**
 
2739
            * Set sourceNames to nill (currently the same as reset)
 
2740
            */
 
2741
           axis2_status_t AXIS2_CALL
 
2742
           adb_networkRule_set_sourceNames_nil(
 
2743
                   adb_networkRule_t* _networkRule,
 
2744
                   const axutil_env_t *env)
 
2745
           {
 
2746
               return adb_networkRule_reset_sourceNames(_networkRule, env);
 
2747
           }
 
2748
 
 
2749
           
 
2750
           /**
 
2751
            * Check whether sourceNames is nill at i
 
2752
            */
 
2753
           axis2_bool_t AXIS2_CALL
 
2754
           adb_networkRule_is_sourceNames_nil_at(
 
2755
                   adb_networkRule_t* _networkRule,
 
2756
                   const axutil_env_t *env, int i)
 
2757
           {
 
2758
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
2759
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
2760
               
 
2761
               return (_networkRule->is_valid_sourceNames == AXIS2_FALSE ||
 
2762
                        NULL == _networkRule->property_sourceNames || 
 
2763
                        NULL == axutil_array_list_get(_networkRule->property_sourceNames, env, i));
 
2764
           }
 
2765
 
 
2766
           /**
 
2767
            * Set sourceNames to nill at i
 
2768
            */
 
2769
           axis2_status_t AXIS2_CALL
 
2770
           adb_networkRule_set_sourceNames_nil_at(
 
2771
                   adb_networkRule_t* _networkRule,
 
2772
                   const axutil_env_t *env, int i)
 
2773
           {
 
2774
                void *element = NULL;
 
2775
                int size = 0;
 
2776
                int j;
 
2777
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
2778
 
 
2779
                int k = 0;
 
2780
 
 
2781
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2782
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2783
 
 
2784
                if(_networkRule->property_sourceNames == NULL ||
 
2785
                            _networkRule->is_valid_sourceNames == AXIS2_FALSE)
 
2786
                {
 
2787
                    
 
2788
                    non_nil_exists = AXIS2_FALSE;
 
2789
                }
 
2790
                else
 
2791
                {
 
2792
                    size = axutil_array_list_size(_networkRule->property_sourceNames, env);
 
2793
                    for(j = 0, k = 0; j < size; j ++ )
 
2794
                    {
 
2795
                        if(i == j) continue; 
 
2796
                        if(NULL != axutil_array_list_get(_networkRule->property_sourceNames, env, i))
 
2797
                        {
 
2798
                            k ++;
 
2799
                            non_nil_exists = AXIS2_TRUE;
 
2800
                            if( k >= 0)
 
2801
                            {
 
2802
                                break;
 
2803
                            }
 
2804
                        }
 
2805
                    }
 
2806
                }
 
2807
                
 
2808
 
 
2809
                if( k < 0)
 
2810
                {
 
2811
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNames is beinng set to be smaller than the specificed number of minOccurs(0)");
 
2812
                       return AXIS2_FAILURE;
 
2813
                }
 
2814
 
 
2815
                if(_networkRule->property_sourceNames == NULL)
 
2816
                {
 
2817
                    _networkRule->is_valid_sourceNames = AXIS2_FALSE;
 
2818
                    
 
2819
                    return AXIS2_SUCCESS;
 
2820
                }
 
2821
 
 
2822
                /* check whether there already exist an element */
 
2823
                element = axutil_array_list_get(_networkRule->property_sourceNames, env, i);
 
2824
                if(NULL != element)
 
2825
                {
 
2826
                  
 
2827
                  
 
2828
                  
 
2829
                       /* This is an unknown type or a primitive. Please free this manually*/
 
2830
                     
 
2831
                }
 
2832
 
 
2833
                
 
2834
                    if(!non_nil_exists)
 
2835
                    {
 
2836
                        
 
2837
                        _networkRule->is_valid_sourceNames = AXIS2_FALSE;
 
2838
                        axutil_array_list_set(_networkRule->property_sourceNames , env, i, NULL);
 
2839
                        return AXIS2_SUCCESS;
 
2840
                    }
 
2841
                
 
2842
 
 
2843
                
 
2844
                axutil_array_list_set(_networkRule->property_sourceNames , env, i, NULL);
 
2845
                
 
2846
                return AXIS2_SUCCESS;
 
2847
 
 
2848
           }
 
2849
 
 
2850
           
 
2851
 
 
2852
            /**
 
2853
             * getter for userNames.
 
2854
             */
 
2855
            axutil_array_list_t* AXIS2_CALL
 
2856
            adb_networkRule_get_userNames(
 
2857
                    adb_networkRule_t* _networkRule,
 
2858
                    const axutil_env_t *env)
 
2859
             {
 
2860
                
 
2861
                    AXIS2_ENV_CHECK(env, NULL);
 
2862
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
2863
                  
 
2864
 
 
2865
                return _networkRule->property_userNames;
 
2866
             }
 
2867
 
 
2868
            /**
 
2869
             * setter for userNames
 
2870
             */
 
2871
            axis2_status_t AXIS2_CALL
 
2872
            adb_networkRule_set_userNames(
 
2873
                    adb_networkRule_t* _networkRule,
 
2874
                    const axutil_env_t *env,
 
2875
                    axutil_array_list_t*  arg_userNames)
 
2876
             {
 
2877
                
 
2878
                 int size = 0;
 
2879
                 int i = 0;
 
2880
                 axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
2881
                
 
2882
 
 
2883
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2884
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2885
                
 
2886
                if(_networkRule->is_valid_userNames &&
 
2887
                        arg_userNames == _networkRule->property_userNames)
 
2888
                {
 
2889
                    
 
2890
                    return AXIS2_SUCCESS; 
 
2891
                }
 
2892
 
 
2893
                
 
2894
                 size = axutil_array_list_size(arg_userNames, env);
 
2895
                 
 
2896
                 if (size < 0)
 
2897
                 {
 
2898
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "userNames has less than minOccurs(0)");
 
2899
                     return AXIS2_FAILURE;
 
2900
                 }
 
2901
                 for(i = 0; i < size; i ++ )
 
2902
                 {
 
2903
                     if(NULL != axutil_array_list_get(arg_userNames, env, i))
 
2904
                     {
 
2905
                         non_nil_exists = AXIS2_TRUE;
 
2906
                         break;
 
2907
                     }
 
2908
                 }
 
2909
 
 
2910
                 adb_networkRule_reset_userNames(_networkRule, env);
 
2911
 
 
2912
                
 
2913
                if(NULL == arg_userNames)
 
2914
                {
 
2915
                    /* We are already done */
 
2916
                    return AXIS2_SUCCESS;
 
2917
                }
 
2918
                _networkRule->property_userNames = arg_userNames;
 
2919
                        if(non_nil_exists)
 
2920
                        {
 
2921
                            _networkRule->is_valid_userNames = AXIS2_TRUE;
 
2922
                        }
 
2923
                        
 
2924
                    
 
2925
                return AXIS2_SUCCESS;
 
2926
             }
 
2927
 
 
2928
            
 
2929
            /**
 
2930
             * Get ith element of userNames.
 
2931
             */
 
2932
            axis2_char_t* AXIS2_CALL
 
2933
            adb_networkRule_get_userNames_at(
 
2934
                    adb_networkRule_t* _networkRule,
 
2935
                    const axutil_env_t *env, int i)
 
2936
            {
 
2937
                axis2_char_t* ret_val;
 
2938
 
 
2939
                
 
2940
                    AXIS2_ENV_CHECK(env, NULL);
 
2941
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
2942
                  
 
2943
 
 
2944
                if(_networkRule->property_userNames == NULL)
 
2945
                {
 
2946
                    return (axis2_char_t*)0;
 
2947
                }
 
2948
                ret_val = (axis2_char_t*)axutil_array_list_get(_networkRule->property_userNames, env, i);
 
2949
                
 
2950
                    return ret_val;
 
2951
                  
 
2952
            }
 
2953
 
 
2954
            /**
 
2955
             * Set the ith element of userNames.
 
2956
             */
 
2957
            axis2_status_t AXIS2_CALL
 
2958
            adb_networkRule_set_userNames_at(
 
2959
                    adb_networkRule_t* _networkRule,
 
2960
                    const axutil_env_t *env, int i,
 
2961
                    const axis2_char_t* arg_userNames)
 
2962
            {
 
2963
                void *element = NULL;
 
2964
                int size = 0;
 
2965
                int j;
 
2966
                int k;
 
2967
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
2968
 
 
2969
                
 
2970
 
 
2971
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
2972
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
2973
                
 
2974
                if( _networkRule->is_valid_userNames &&
 
2975
                    _networkRule->property_userNames &&
 
2976
                
 
2977
                    arg_userNames == (axis2_char_t*)axutil_array_list_get(_networkRule->property_userNames, env, i))
 
2978
                  
 
2979
                {
 
2980
                    
 
2981
                    return AXIS2_SUCCESS; 
 
2982
                }
 
2983
 
 
2984
                
 
2985
                    if(NULL == arg_userNames)
 
2986
                    {
 
2987
                        if(_networkRule->property_userNames != NULL)
 
2988
                        {
 
2989
                            size = axutil_array_list_size(_networkRule->property_userNames, env);
 
2990
                            for(j = 0, k = 0; j < size; j ++ )
 
2991
                            {
 
2992
                                if(i == j) continue; 
 
2993
                                if(NULL != axutil_array_list_get(_networkRule->property_userNames, env, i))
 
2994
                                {
 
2995
                                    k ++;
 
2996
                                    non_nil_exists = AXIS2_TRUE;
 
2997
                                    if(k >= 0)
 
2998
                                    {
 
2999
                                        break;
 
3000
                                    }
 
3001
                                }
 
3002
                            }
 
3003
                        }
 
3004
                    }
 
3005
                    else
 
3006
                    {
 
3007
                        non_nil_exists = AXIS2_TRUE;
 
3008
                    }
 
3009
                  
 
3010
                if( k < 0)
 
3011
                {
 
3012
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of userNames is beinng set to be smaller than the specificed number of minOccurs(0)");
 
3013
                       return AXIS2_FAILURE;
 
3014
                }
 
3015
 
 
3016
                if(_networkRule->property_userNames == NULL)
 
3017
                {
 
3018
                    _networkRule->property_userNames = axutil_array_list_create(env, 10);
 
3019
                }
 
3020
                
 
3021
                /* check whether there already exist an element */
 
3022
                element = axutil_array_list_get(_networkRule->property_userNames, env, i);
 
3023
                if(NULL != element)
 
3024
                {
 
3025
                  
 
3026
                  
 
3027
                  
 
3028
                       /* This is an unknown type or a primitive. Please free this manually*/
 
3029
                     
 
3030
                }
 
3031
 
 
3032
                
 
3033
                    if(!non_nil_exists)
 
3034
                    {
 
3035
                        
 
3036
                        _networkRule->is_valid_userNames = AXIS2_FALSE;
 
3037
                        axutil_array_list_set(_networkRule->property_userNames , env, i, NULL);
 
3038
                        
 
3039
                        return AXIS2_SUCCESS;
 
3040
                    }
 
3041
                
 
3042
                   axutil_array_list_set(_networkRule->property_userNames , env, i, axutil_strdup(env, arg_userNames));
 
3043
                  _networkRule->is_valid_userNames = AXIS2_TRUE;
 
3044
                
 
3045
                return AXIS2_SUCCESS;
 
3046
            }
 
3047
 
 
3048
            /**
 
3049
             * Add to userNames.
 
3050
             */
 
3051
            axis2_status_t AXIS2_CALL
 
3052
            adb_networkRule_add_userNames(
 
3053
                    adb_networkRule_t* _networkRule,
 
3054
                    const axutil_env_t *env,
 
3055
                    const axis2_char_t* arg_userNames)
 
3056
             {
 
3057
                
 
3058
 
 
3059
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3060
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3061
 
 
3062
                
 
3063
                    if(NULL == arg_userNames)
 
3064
                    {
 
3065
                      
 
3066
                           return AXIS2_SUCCESS; 
 
3067
                        
 
3068
                    }
 
3069
                  
 
3070
 
 
3071
                if(_networkRule->property_userNames == NULL)
 
3072
                {
 
3073
                    _networkRule->property_userNames = axutil_array_list_create(env, 10);
 
3074
                }
 
3075
                if(_networkRule->property_userNames == NULL)
 
3076
                {
 
3077
                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for userNames");
 
3078
                    return AXIS2_FAILURE;
 
3079
                    
 
3080
                }
 
3081
                
 
3082
                   axutil_array_list_add(_networkRule->property_userNames , env, axutil_strdup(env, arg_userNames));
 
3083
                  _networkRule->is_valid_userNames = AXIS2_TRUE;
 
3084
                return AXIS2_SUCCESS;
 
3085
             }
 
3086
 
 
3087
            /**
 
3088
             * Get the size of the userNames array.
 
3089
             */
 
3090
            int AXIS2_CALL
 
3091
            adb_networkRule_sizeof_userNames(
 
3092
                    adb_networkRule_t* _networkRule,
 
3093
                    const axutil_env_t *env)
 
3094
            {
 
3095
                AXIS2_ENV_CHECK(env, -1);
 
3096
                AXIS2_PARAM_CHECK(env->error, _networkRule, -1);
 
3097
                if(_networkRule->property_userNames == NULL)
 
3098
                {
 
3099
                    return 0;
 
3100
                }
 
3101
                return axutil_array_list_size(_networkRule->property_userNames, env);
 
3102
            }
 
3103
 
 
3104
            /**
 
3105
             * remove the ith element, same as set_nil_at.
 
3106
             */
 
3107
            axis2_status_t AXIS2_CALL
 
3108
            adb_networkRule_remove_userNames_at(
 
3109
                    adb_networkRule_t* _networkRule,
 
3110
                    const axutil_env_t *env, int i)
 
3111
            {
 
3112
                return adb_networkRule_set_userNames_nil_at(_networkRule, env, i);
 
3113
            }
 
3114
 
 
3115
            
 
3116
 
 
3117
           /**
 
3118
            * resetter for userNames
 
3119
            */
 
3120
           axis2_status_t AXIS2_CALL
 
3121
           adb_networkRule_reset_userNames(
 
3122
                   adb_networkRule_t* _networkRule,
 
3123
                   const axutil_env_t *env)
 
3124
           {
 
3125
               int i = 0;
 
3126
               int count = 0;
 
3127
               void *element = NULL;
 
3128
 
 
3129
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3130
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3131
               
 
3132
 
 
3133
               
 
3134
                  if (_networkRule->property_userNames != NULL)
 
3135
                  {
 
3136
                      count = axutil_array_list_size(_networkRule->property_userNames, env);
 
3137
                      for(i = 0; i < count; i ++)
 
3138
                      {
 
3139
                         element = axutil_array_list_get(_networkRule->property_userNames, env, i);
 
3140
                
 
3141
            
 
3142
                
 
3143
                if(element != NULL)
 
3144
                {
 
3145
                   
 
3146
                   
 
3147
                        AXIS2_FREE(env-> allocator, (axis2_char_t*)element);
 
3148
                     element = NULL;
 
3149
                }
 
3150
            
 
3151
                
 
3152
                
 
3153
                
 
3154
                      }
 
3155
                      axutil_array_list_free(_networkRule->property_userNames, env);
 
3156
                  }
 
3157
                _networkRule->is_valid_userNames = AXIS2_FALSE; 
 
3158
               return AXIS2_SUCCESS;
 
3159
           }
 
3160
 
 
3161
           /**
 
3162
            * Check whether userNames is nill
 
3163
            */
 
3164
           axis2_bool_t AXIS2_CALL
 
3165
           adb_networkRule_is_userNames_nil(
 
3166
                   adb_networkRule_t* _networkRule,
 
3167
                   const axutil_env_t *env)
 
3168
           {
 
3169
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
3170
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
3171
               
 
3172
               return !_networkRule->is_valid_userNames;
 
3173
           }
 
3174
 
 
3175
           /**
 
3176
            * Set userNames to nill (currently the same as reset)
 
3177
            */
 
3178
           axis2_status_t AXIS2_CALL
 
3179
           adb_networkRule_set_userNames_nil(
 
3180
                   adb_networkRule_t* _networkRule,
 
3181
                   const axutil_env_t *env)
 
3182
           {
 
3183
               return adb_networkRule_reset_userNames(_networkRule, env);
 
3184
           }
 
3185
 
 
3186
           
 
3187
           /**
 
3188
            * Check whether userNames is nill at i
 
3189
            */
 
3190
           axis2_bool_t AXIS2_CALL
 
3191
           adb_networkRule_is_userNames_nil_at(
 
3192
                   adb_networkRule_t* _networkRule,
 
3193
                   const axutil_env_t *env, int i)
 
3194
           {
 
3195
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
3196
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
3197
               
 
3198
               return (_networkRule->is_valid_userNames == AXIS2_FALSE ||
 
3199
                        NULL == _networkRule->property_userNames || 
 
3200
                        NULL == axutil_array_list_get(_networkRule->property_userNames, env, i));
 
3201
           }
 
3202
 
 
3203
           /**
 
3204
            * Set userNames to nill at i
 
3205
            */
 
3206
           axis2_status_t AXIS2_CALL
 
3207
           adb_networkRule_set_userNames_nil_at(
 
3208
                   adb_networkRule_t* _networkRule,
 
3209
                   const axutil_env_t *env, int i)
 
3210
           {
 
3211
                void *element = NULL;
 
3212
                int size = 0;
 
3213
                int j;
 
3214
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
3215
 
 
3216
                int k = 0;
 
3217
 
 
3218
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3219
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3220
 
 
3221
                if(_networkRule->property_userNames == NULL ||
 
3222
                            _networkRule->is_valid_userNames == AXIS2_FALSE)
 
3223
                {
 
3224
                    
 
3225
                    non_nil_exists = AXIS2_FALSE;
 
3226
                }
 
3227
                else
 
3228
                {
 
3229
                    size = axutil_array_list_size(_networkRule->property_userNames, env);
 
3230
                    for(j = 0, k = 0; j < size; j ++ )
 
3231
                    {
 
3232
                        if(i == j) continue; 
 
3233
                        if(NULL != axutil_array_list_get(_networkRule->property_userNames, env, i))
 
3234
                        {
 
3235
                            k ++;
 
3236
                            non_nil_exists = AXIS2_TRUE;
 
3237
                            if( k >= 0)
 
3238
                            {
 
3239
                                break;
 
3240
                            }
 
3241
                        }
 
3242
                    }
 
3243
                }
 
3244
                
 
3245
 
 
3246
                if( k < 0)
 
3247
                {
 
3248
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of userNames is beinng set to be smaller than the specificed number of minOccurs(0)");
 
3249
                       return AXIS2_FAILURE;
 
3250
                }
 
3251
 
 
3252
                if(_networkRule->property_userNames == NULL)
 
3253
                {
 
3254
                    _networkRule->is_valid_userNames = AXIS2_FALSE;
 
3255
                    
 
3256
                    return AXIS2_SUCCESS;
 
3257
                }
 
3258
 
 
3259
                /* check whether there already exist an element */
 
3260
                element = axutil_array_list_get(_networkRule->property_userNames, env, i);
 
3261
                if(NULL != element)
 
3262
                {
 
3263
                  
 
3264
                  
 
3265
                  
 
3266
                       /* This is an unknown type or a primitive. Please free this manually*/
 
3267
                     
 
3268
                }
 
3269
 
 
3270
                
 
3271
                    if(!non_nil_exists)
 
3272
                    {
 
3273
                        
 
3274
                        _networkRule->is_valid_userNames = AXIS2_FALSE;
 
3275
                        axutil_array_list_set(_networkRule->property_userNames , env, i, NULL);
 
3276
                        return AXIS2_SUCCESS;
 
3277
                    }
 
3278
                
 
3279
 
 
3280
                
 
3281
                axutil_array_list_set(_networkRule->property_userNames , env, i, NULL);
 
3282
                
 
3283
                return AXIS2_SUCCESS;
 
3284
 
 
3285
           }
 
3286
 
 
3287
           
 
3288
 
 
3289
            /**
 
3290
             * getter for sourceNets.
 
3291
             */
 
3292
            axutil_array_list_t* AXIS2_CALL
 
3293
            adb_networkRule_get_sourceNets(
 
3294
                    adb_networkRule_t* _networkRule,
 
3295
                    const axutil_env_t *env)
 
3296
             {
 
3297
                
 
3298
                    AXIS2_ENV_CHECK(env, NULL);
 
3299
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
3300
                  
 
3301
 
 
3302
                return _networkRule->property_sourceNets;
 
3303
             }
 
3304
 
 
3305
            /**
 
3306
             * setter for sourceNets
 
3307
             */
 
3308
            axis2_status_t AXIS2_CALL
 
3309
            adb_networkRule_set_sourceNets(
 
3310
                    adb_networkRule_t* _networkRule,
 
3311
                    const axutil_env_t *env,
 
3312
                    axutil_array_list_t*  arg_sourceNets)
 
3313
             {
 
3314
                
 
3315
                 int size = 0;
 
3316
                 int i = 0;
 
3317
                 axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
3318
                
 
3319
 
 
3320
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3321
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3322
                
 
3323
                if(_networkRule->is_valid_sourceNets &&
 
3324
                        arg_sourceNets == _networkRule->property_sourceNets)
 
3325
                {
 
3326
                    
 
3327
                    return AXIS2_SUCCESS; 
 
3328
                }
 
3329
 
 
3330
                
 
3331
                 size = axutil_array_list_size(arg_sourceNets, env);
 
3332
                 
 
3333
                 if (size < 0)
 
3334
                 {
 
3335
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sourceNets has less than minOccurs(0)");
 
3336
                     return AXIS2_FAILURE;
 
3337
                 }
 
3338
                 for(i = 0; i < size; i ++ )
 
3339
                 {
 
3340
                     if(NULL != axutil_array_list_get(arg_sourceNets, env, i))
 
3341
                     {
 
3342
                         non_nil_exists = AXIS2_TRUE;
 
3343
                         break;
 
3344
                     }
 
3345
                 }
 
3346
 
 
3347
                 adb_networkRule_reset_sourceNets(_networkRule, env);
 
3348
 
 
3349
                
 
3350
                if(NULL == arg_sourceNets)
 
3351
                {
 
3352
                    /* We are already done */
 
3353
                    return AXIS2_SUCCESS;
 
3354
                }
 
3355
                _networkRule->property_sourceNets = arg_sourceNets;
 
3356
                        if(non_nil_exists)
 
3357
                        {
 
3358
                            _networkRule->is_valid_sourceNets = AXIS2_TRUE;
 
3359
                        }
 
3360
                        
 
3361
                    
 
3362
                return AXIS2_SUCCESS;
 
3363
             }
 
3364
 
 
3365
            
 
3366
            /**
 
3367
             * Get ith element of sourceNets.
 
3368
             */
 
3369
            axis2_char_t* AXIS2_CALL
 
3370
            adb_networkRule_get_sourceNets_at(
 
3371
                    adb_networkRule_t* _networkRule,
 
3372
                    const axutil_env_t *env, int i)
 
3373
            {
 
3374
                axis2_char_t* ret_val;
 
3375
 
 
3376
                
 
3377
                    AXIS2_ENV_CHECK(env, NULL);
 
3378
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
3379
                  
 
3380
 
 
3381
                if(_networkRule->property_sourceNets == NULL)
 
3382
                {
 
3383
                    return (axis2_char_t*)0;
 
3384
                }
 
3385
                ret_val = (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNets, env, i);
 
3386
                
 
3387
                    return ret_val;
 
3388
                  
 
3389
            }
 
3390
 
 
3391
            /**
 
3392
             * Set the ith element of sourceNets.
 
3393
             */
 
3394
            axis2_status_t AXIS2_CALL
 
3395
            adb_networkRule_set_sourceNets_at(
 
3396
                    adb_networkRule_t* _networkRule,
 
3397
                    const axutil_env_t *env, int i,
 
3398
                    const axis2_char_t* arg_sourceNets)
 
3399
            {
 
3400
                void *element = NULL;
 
3401
                int size = 0;
 
3402
                int j;
 
3403
                int k;
 
3404
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
3405
 
 
3406
                
 
3407
 
 
3408
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3409
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3410
                
 
3411
                if( _networkRule->is_valid_sourceNets &&
 
3412
                    _networkRule->property_sourceNets &&
 
3413
                
 
3414
                    arg_sourceNets == (axis2_char_t*)axutil_array_list_get(_networkRule->property_sourceNets, env, i))
 
3415
                  
 
3416
                {
 
3417
                    
 
3418
                    return AXIS2_SUCCESS; 
 
3419
                }
 
3420
 
 
3421
                
 
3422
                    if(NULL == arg_sourceNets)
 
3423
                    {
 
3424
                        if(_networkRule->property_sourceNets != NULL)
 
3425
                        {
 
3426
                            size = axutil_array_list_size(_networkRule->property_sourceNets, env);
 
3427
                            for(j = 0, k = 0; j < size; j ++ )
 
3428
                            {
 
3429
                                if(i == j) continue; 
 
3430
                                if(NULL != axutil_array_list_get(_networkRule->property_sourceNets, env, i))
 
3431
                                {
 
3432
                                    k ++;
 
3433
                                    non_nil_exists = AXIS2_TRUE;
 
3434
                                    if(k >= 0)
 
3435
                                    {
 
3436
                                        break;
 
3437
                                    }
 
3438
                                }
 
3439
                            }
 
3440
                        }
 
3441
                    }
 
3442
                    else
 
3443
                    {
 
3444
                        non_nil_exists = AXIS2_TRUE;
 
3445
                    }
 
3446
                  
 
3447
                if( k < 0)
 
3448
                {
 
3449
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNets is beinng set to be smaller than the specificed number of minOccurs(0)");
 
3450
                       return AXIS2_FAILURE;
 
3451
                }
 
3452
 
 
3453
                if(_networkRule->property_sourceNets == NULL)
 
3454
                {
 
3455
                    _networkRule->property_sourceNets = axutil_array_list_create(env, 10);
 
3456
                }
 
3457
                
 
3458
                /* check whether there already exist an element */
 
3459
                element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
 
3460
                if(NULL != element)
 
3461
                {
 
3462
                  
 
3463
                  
 
3464
                  
 
3465
                       /* This is an unknown type or a primitive. Please free this manually*/
 
3466
                     
 
3467
                }
 
3468
 
 
3469
                
 
3470
                    if(!non_nil_exists)
 
3471
                    {
 
3472
                        
 
3473
                        _networkRule->is_valid_sourceNets = AXIS2_FALSE;
 
3474
                        axutil_array_list_set(_networkRule->property_sourceNets , env, i, NULL);
 
3475
                        
 
3476
                        return AXIS2_SUCCESS;
 
3477
                    }
 
3478
                
 
3479
                   axutil_array_list_set(_networkRule->property_sourceNets , env, i, axutil_strdup(env, arg_sourceNets));
 
3480
                  _networkRule->is_valid_sourceNets = AXIS2_TRUE;
 
3481
                
 
3482
                return AXIS2_SUCCESS;
 
3483
            }
 
3484
 
 
3485
            /**
 
3486
             * Add to sourceNets.
 
3487
             */
 
3488
            axis2_status_t AXIS2_CALL
 
3489
            adb_networkRule_add_sourceNets(
 
3490
                    adb_networkRule_t* _networkRule,
 
3491
                    const axutil_env_t *env,
 
3492
                    const axis2_char_t* arg_sourceNets)
 
3493
             {
 
3494
                
 
3495
 
 
3496
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3497
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3498
 
 
3499
                
 
3500
                    if(NULL == arg_sourceNets)
 
3501
                    {
 
3502
                      
 
3503
                           return AXIS2_SUCCESS; 
 
3504
                        
 
3505
                    }
 
3506
                  
 
3507
 
 
3508
                if(_networkRule->property_sourceNets == NULL)
 
3509
                {
 
3510
                    _networkRule->property_sourceNets = axutil_array_list_create(env, 10);
 
3511
                }
 
3512
                if(_networkRule->property_sourceNets == NULL)
 
3513
                {
 
3514
                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in allocatting memory for sourceNets");
 
3515
                    return AXIS2_FAILURE;
 
3516
                    
 
3517
                }
 
3518
                
 
3519
                   axutil_array_list_add(_networkRule->property_sourceNets , env, axutil_strdup(env, arg_sourceNets));
 
3520
                  _networkRule->is_valid_sourceNets = AXIS2_TRUE;
 
3521
                return AXIS2_SUCCESS;
 
3522
             }
 
3523
 
 
3524
            /**
 
3525
             * Get the size of the sourceNets array.
 
3526
             */
 
3527
            int AXIS2_CALL
 
3528
            adb_networkRule_sizeof_sourceNets(
 
3529
                    adb_networkRule_t* _networkRule,
 
3530
                    const axutil_env_t *env)
 
3531
            {
 
3532
                AXIS2_ENV_CHECK(env, -1);
 
3533
                AXIS2_PARAM_CHECK(env->error, _networkRule, -1);
 
3534
                if(_networkRule->property_sourceNets == NULL)
 
3535
                {
 
3536
                    return 0;
 
3537
                }
 
3538
                return axutil_array_list_size(_networkRule->property_sourceNets, env);
 
3539
            }
 
3540
 
 
3541
            /**
 
3542
             * remove the ith element, same as set_nil_at.
 
3543
             */
 
3544
            axis2_status_t AXIS2_CALL
 
3545
            adb_networkRule_remove_sourceNets_at(
 
3546
                    adb_networkRule_t* _networkRule,
 
3547
                    const axutil_env_t *env, int i)
 
3548
            {
 
3549
                return adb_networkRule_set_sourceNets_nil_at(_networkRule, env, i);
 
3550
            }
 
3551
 
 
3552
            
 
3553
 
 
3554
           /**
 
3555
            * resetter for sourceNets
 
3556
            */
 
3557
           axis2_status_t AXIS2_CALL
 
3558
           adb_networkRule_reset_sourceNets(
 
3559
                   adb_networkRule_t* _networkRule,
 
3560
                   const axutil_env_t *env)
 
3561
           {
 
3562
               int i = 0;
 
3563
               int count = 0;
 
3564
               void *element = NULL;
 
3565
 
 
3566
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3567
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3568
               
 
3569
 
 
3570
               
 
3571
                  if (_networkRule->property_sourceNets != NULL)
 
3572
                  {
 
3573
                      count = axutil_array_list_size(_networkRule->property_sourceNets, env);
 
3574
                      for(i = 0; i < count; i ++)
 
3575
                      {
 
3576
                         element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
 
3577
                
 
3578
            
 
3579
                
 
3580
                if(element != NULL)
 
3581
                {
 
3582
                   
 
3583
                   
 
3584
                        AXIS2_FREE(env-> allocator, (axis2_char_t*)element);
 
3585
                     element = NULL;
 
3586
                }
 
3587
            
 
3588
                
 
3589
                
 
3590
                
 
3591
                      }
 
3592
                      axutil_array_list_free(_networkRule->property_sourceNets, env);
 
3593
                  }
 
3594
                _networkRule->is_valid_sourceNets = AXIS2_FALSE; 
 
3595
               return AXIS2_SUCCESS;
 
3596
           }
 
3597
 
 
3598
           /**
 
3599
            * Check whether sourceNets is nill
 
3600
            */
 
3601
           axis2_bool_t AXIS2_CALL
 
3602
           adb_networkRule_is_sourceNets_nil(
 
3603
                   adb_networkRule_t* _networkRule,
 
3604
                   const axutil_env_t *env)
 
3605
           {
 
3606
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
3607
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
3608
               
 
3609
               return !_networkRule->is_valid_sourceNets;
 
3610
           }
 
3611
 
 
3612
           /**
 
3613
            * Set sourceNets to nill (currently the same as reset)
 
3614
            */
 
3615
           axis2_status_t AXIS2_CALL
 
3616
           adb_networkRule_set_sourceNets_nil(
 
3617
                   adb_networkRule_t* _networkRule,
 
3618
                   const axutil_env_t *env)
 
3619
           {
 
3620
               return adb_networkRule_reset_sourceNets(_networkRule, env);
 
3621
           }
 
3622
 
 
3623
           
 
3624
           /**
 
3625
            * Check whether sourceNets is nill at i
 
3626
            */
 
3627
           axis2_bool_t AXIS2_CALL
 
3628
           adb_networkRule_is_sourceNets_nil_at(
 
3629
                   adb_networkRule_t* _networkRule,
 
3630
                   const axutil_env_t *env, int i)
 
3631
           {
 
3632
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
3633
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
3634
               
 
3635
               return (_networkRule->is_valid_sourceNets == AXIS2_FALSE ||
 
3636
                        NULL == _networkRule->property_sourceNets || 
 
3637
                        NULL == axutil_array_list_get(_networkRule->property_sourceNets, env, i));
 
3638
           }
 
3639
 
 
3640
           /**
 
3641
            * Set sourceNets to nill at i
 
3642
            */
 
3643
           axis2_status_t AXIS2_CALL
 
3644
           adb_networkRule_set_sourceNets_nil_at(
 
3645
                   adb_networkRule_t* _networkRule,
 
3646
                   const axutil_env_t *env, int i)
 
3647
           {
 
3648
                void *element = NULL;
 
3649
                int size = 0;
 
3650
                int j;
 
3651
                axis2_bool_t non_nil_exists = AXIS2_FALSE;
 
3652
 
 
3653
                int k = 0;
 
3654
 
 
3655
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3656
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3657
 
 
3658
                if(_networkRule->property_sourceNets == NULL ||
 
3659
                            _networkRule->is_valid_sourceNets == AXIS2_FALSE)
 
3660
                {
 
3661
                    
 
3662
                    non_nil_exists = AXIS2_FALSE;
 
3663
                }
 
3664
                else
 
3665
                {
 
3666
                    size = axutil_array_list_size(_networkRule->property_sourceNets, env);
 
3667
                    for(j = 0, k = 0; j < size; j ++ )
 
3668
                    {
 
3669
                        if(i == j) continue; 
 
3670
                        if(NULL != axutil_array_list_get(_networkRule->property_sourceNets, env, i))
 
3671
                        {
 
3672
                            k ++;
 
3673
                            non_nil_exists = AXIS2_TRUE;
 
3674
                            if( k >= 0)
 
3675
                            {
 
3676
                                break;
 
3677
                            }
 
3678
                        }
 
3679
                    }
 
3680
                }
 
3681
                
 
3682
 
 
3683
                if( k < 0)
 
3684
                {
 
3685
                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of sourceNets is beinng set to be smaller than the specificed number of minOccurs(0)");
 
3686
                       return AXIS2_FAILURE;
 
3687
                }
 
3688
 
 
3689
                if(_networkRule->property_sourceNets == NULL)
 
3690
                {
 
3691
                    _networkRule->is_valid_sourceNets = AXIS2_FALSE;
 
3692
                    
 
3693
                    return AXIS2_SUCCESS;
 
3694
                }
 
3695
 
 
3696
                /* check whether there already exist an element */
 
3697
                element = axutil_array_list_get(_networkRule->property_sourceNets, env, i);
 
3698
                if(NULL != element)
 
3699
                {
 
3700
                  
 
3701
                  
 
3702
                  
 
3703
                       /* This is an unknown type or a primitive. Please free this manually*/
 
3704
                     
 
3705
                }
 
3706
 
 
3707
                
 
3708
                    if(!non_nil_exists)
 
3709
                    {
 
3710
                        
 
3711
                        _networkRule->is_valid_sourceNets = AXIS2_FALSE;
 
3712
                        axutil_array_list_set(_networkRule->property_sourceNets , env, i, NULL);
 
3713
                        return AXIS2_SUCCESS;
 
3714
                    }
 
3715
                
 
3716
 
 
3717
                
 
3718
                axutil_array_list_set(_networkRule->property_sourceNets , env, i, NULL);
 
3719
                
 
3720
                return AXIS2_SUCCESS;
 
3721
 
 
3722
           }
 
3723
 
 
3724
           
 
3725
 
 
3726
            /**
 
3727
             * getter for destUserName.
 
3728
             */
 
3729
            axis2_char_t* AXIS2_CALL
 
3730
            adb_networkRule_get_destUserName(
 
3731
                    adb_networkRule_t* _networkRule,
 
3732
                    const axutil_env_t *env)
 
3733
             {
 
3734
                
 
3735
                    AXIS2_ENV_CHECK(env, NULL);
 
3736
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
3737
                  
 
3738
 
 
3739
                return _networkRule->property_destUserName;
 
3740
             }
 
3741
 
 
3742
            /**
 
3743
             * setter for destUserName
 
3744
             */
 
3745
            axis2_status_t AXIS2_CALL
 
3746
            adb_networkRule_set_destUserName(
 
3747
                    adb_networkRule_t* _networkRule,
 
3748
                    const axutil_env_t *env,
 
3749
                    const axis2_char_t*  arg_destUserName)
 
3750
             {
 
3751
                
 
3752
 
 
3753
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3754
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3755
                
 
3756
                if(_networkRule->is_valid_destUserName &&
 
3757
                        arg_destUserName == _networkRule->property_destUserName)
 
3758
                {
 
3759
                    
 
3760
                    return AXIS2_SUCCESS; 
 
3761
                }
 
3762
 
 
3763
                adb_networkRule_reset_destUserName(_networkRule, env);
 
3764
 
 
3765
                
 
3766
                if(NULL == arg_destUserName)
 
3767
                {
 
3768
                    /* We are already done */
 
3769
                    return AXIS2_SUCCESS;
 
3770
                }
 
3771
                _networkRule->property_destUserName = (axis2_char_t *)axutil_strdup(env, arg_destUserName);
 
3772
                        if(NULL == _networkRule->property_destUserName)
 
3773
                        {
 
3774
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for destUserName");
 
3775
                            return AXIS2_FAILURE;
 
3776
                        }
 
3777
                        _networkRule->is_valid_destUserName = AXIS2_TRUE;
 
3778
                    
 
3779
                return AXIS2_SUCCESS;
 
3780
             }
 
3781
 
 
3782
             
 
3783
 
 
3784
           /**
 
3785
            * resetter for destUserName
 
3786
            */
 
3787
           axis2_status_t AXIS2_CALL
 
3788
           adb_networkRule_reset_destUserName(
 
3789
                   adb_networkRule_t* _networkRule,
 
3790
                   const axutil_env_t *env)
 
3791
           {
 
3792
               int i = 0;
 
3793
               int count = 0;
 
3794
               void *element = NULL;
 
3795
 
 
3796
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3797
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3798
               
 
3799
 
 
3800
               
 
3801
            
 
3802
                
 
3803
                if(_networkRule->property_destUserName != NULL)
 
3804
                {
 
3805
                   
 
3806
                   
 
3807
                        AXIS2_FREE(env-> allocator, _networkRule->property_destUserName);
 
3808
                     _networkRule->property_destUserName = NULL;
 
3809
                }
 
3810
            
 
3811
                
 
3812
                
 
3813
                _networkRule->is_valid_destUserName = AXIS2_FALSE; 
 
3814
               return AXIS2_SUCCESS;
 
3815
           }
 
3816
 
 
3817
           /**
 
3818
            * Check whether destUserName is nill
 
3819
            */
 
3820
           axis2_bool_t AXIS2_CALL
 
3821
           adb_networkRule_is_destUserName_nil(
 
3822
                   adb_networkRule_t* _networkRule,
 
3823
                   const axutil_env_t *env)
 
3824
           {
 
3825
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
3826
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
3827
               
 
3828
               return !_networkRule->is_valid_destUserName;
 
3829
           }
 
3830
 
 
3831
           /**
 
3832
            * Set destUserName to nill (currently the same as reset)
 
3833
            */
 
3834
           axis2_status_t AXIS2_CALL
 
3835
           adb_networkRule_set_destUserName_nil(
 
3836
                   adb_networkRule_t* _networkRule,
 
3837
                   const axutil_env_t *env)
 
3838
           {
 
3839
               return adb_networkRule_reset_destUserName(_networkRule, env);
 
3840
           }
 
3841
 
 
3842
           
 
3843
 
 
3844
            /**
 
3845
             * getter for destName.
 
3846
             */
 
3847
            axis2_char_t* AXIS2_CALL
 
3848
            adb_networkRule_get_destName(
 
3849
                    adb_networkRule_t* _networkRule,
 
3850
                    const axutil_env_t *env)
 
3851
             {
 
3852
                
 
3853
                    AXIS2_ENV_CHECK(env, NULL);
 
3854
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
3855
                  
 
3856
 
 
3857
                return _networkRule->property_destName;
 
3858
             }
 
3859
 
 
3860
            /**
 
3861
             * setter for destName
 
3862
             */
 
3863
            axis2_status_t AXIS2_CALL
 
3864
            adb_networkRule_set_destName(
 
3865
                    adb_networkRule_t* _networkRule,
 
3866
                    const axutil_env_t *env,
 
3867
                    const axis2_char_t*  arg_destName)
 
3868
             {
 
3869
                
 
3870
 
 
3871
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3872
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3873
                
 
3874
                if(_networkRule->is_valid_destName &&
 
3875
                        arg_destName == _networkRule->property_destName)
 
3876
                {
 
3877
                    
 
3878
                    return AXIS2_SUCCESS; 
 
3879
                }
 
3880
 
 
3881
                
 
3882
                  if(NULL == arg_destName)
 
3883
                  {
 
3884
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "destName is being set to NULL, but it is not a nullable element");
 
3885
                      return AXIS2_FAILURE;
 
3886
                  }
 
3887
                adb_networkRule_reset_destName(_networkRule, env);
 
3888
 
 
3889
                
 
3890
                if(NULL == arg_destName)
 
3891
                {
 
3892
                    /* We are already done */
 
3893
                    return AXIS2_SUCCESS;
 
3894
                }
 
3895
                _networkRule->property_destName = (axis2_char_t *)axutil_strdup(env, arg_destName);
 
3896
                        if(NULL == _networkRule->property_destName)
 
3897
                        {
 
3898
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for destName");
 
3899
                            return AXIS2_FAILURE;
 
3900
                        }
 
3901
                        _networkRule->is_valid_destName = AXIS2_TRUE;
 
3902
                    
 
3903
                return AXIS2_SUCCESS;
 
3904
             }
 
3905
 
 
3906
             
 
3907
 
 
3908
           /**
 
3909
            * resetter for destName
 
3910
            */
 
3911
           axis2_status_t AXIS2_CALL
 
3912
           adb_networkRule_reset_destName(
 
3913
                   adb_networkRule_t* _networkRule,
 
3914
                   const axutil_env_t *env)
 
3915
           {
 
3916
               int i = 0;
 
3917
               int count = 0;
 
3918
               void *element = NULL;
 
3919
 
 
3920
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3921
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3922
               
 
3923
 
 
3924
               
 
3925
            
 
3926
                
 
3927
                if(_networkRule->property_destName != NULL)
 
3928
                {
 
3929
                   
 
3930
                   
 
3931
                        AXIS2_FREE(env-> allocator, _networkRule->property_destName);
 
3932
                     _networkRule->property_destName = NULL;
 
3933
                }
 
3934
            
 
3935
                
 
3936
                
 
3937
                _networkRule->is_valid_destName = AXIS2_FALSE; 
 
3938
               return AXIS2_SUCCESS;
 
3939
           }
 
3940
 
 
3941
           /**
 
3942
            * Check whether destName is nill
 
3943
            */
 
3944
           axis2_bool_t AXIS2_CALL
 
3945
           adb_networkRule_is_destName_nil(
 
3946
                   adb_networkRule_t* _networkRule,
 
3947
                   const axutil_env_t *env)
 
3948
           {
 
3949
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
3950
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
3951
               
 
3952
               return !_networkRule->is_valid_destName;
 
3953
           }
 
3954
 
 
3955
           /**
 
3956
            * Set destName to nill (currently the same as reset)
 
3957
            */
 
3958
           axis2_status_t AXIS2_CALL
 
3959
           adb_networkRule_set_destName_nil(
 
3960
                   adb_networkRule_t* _networkRule,
 
3961
                   const axutil_env_t *env)
 
3962
           {
 
3963
               return adb_networkRule_reset_destName(_networkRule, env);
 
3964
           }
 
3965
 
 
3966
           
 
3967
 
 
3968
            /**
 
3969
             * getter for protocol.
 
3970
             */
 
3971
            axis2_char_t* AXIS2_CALL
 
3972
            adb_networkRule_get_protocol(
 
3973
                    adb_networkRule_t* _networkRule,
 
3974
                    const axutil_env_t *env)
 
3975
             {
 
3976
                
 
3977
                    AXIS2_ENV_CHECK(env, NULL);
 
3978
                    AXIS2_PARAM_CHECK(env->error, _networkRule, NULL);
 
3979
                  
 
3980
 
 
3981
                return _networkRule->property_protocol;
 
3982
             }
 
3983
 
 
3984
            /**
 
3985
             * setter for protocol
 
3986
             */
 
3987
            axis2_status_t AXIS2_CALL
 
3988
            adb_networkRule_set_protocol(
 
3989
                    adb_networkRule_t* _networkRule,
 
3990
                    const axutil_env_t *env,
 
3991
                    const axis2_char_t*  arg_protocol)
 
3992
             {
 
3993
                
 
3994
 
 
3995
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
3996
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
3997
                
 
3998
                if(_networkRule->is_valid_protocol &&
 
3999
                        arg_protocol == _networkRule->property_protocol)
 
4000
                {
 
4001
                    
 
4002
                    return AXIS2_SUCCESS; 
 
4003
                }
 
4004
 
 
4005
                
 
4006
                  if(NULL == arg_protocol)
 
4007
                  {
 
4008
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "protocol is being set to NULL, but it is not a nullable element");
 
4009
                      return AXIS2_FAILURE;
 
4010
                  }
 
4011
                adb_networkRule_reset_protocol(_networkRule, env);
 
4012
 
 
4013
                
 
4014
                if(NULL == arg_protocol)
 
4015
                {
 
4016
                    /* We are already done */
 
4017
                    return AXIS2_SUCCESS;
 
4018
                }
 
4019
                _networkRule->property_protocol = (axis2_char_t *)axutil_strdup(env, arg_protocol);
 
4020
                        if(NULL == _networkRule->property_protocol)
 
4021
                        {
 
4022
                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for protocol");
 
4023
                            return AXIS2_FAILURE;
 
4024
                        }
 
4025
                        _networkRule->is_valid_protocol = AXIS2_TRUE;
 
4026
                    
 
4027
                return AXIS2_SUCCESS;
 
4028
             }
 
4029
 
 
4030
             
 
4031
 
 
4032
           /**
 
4033
            * resetter for protocol
 
4034
            */
 
4035
           axis2_status_t AXIS2_CALL
 
4036
           adb_networkRule_reset_protocol(
 
4037
                   adb_networkRule_t* _networkRule,
 
4038
                   const axutil_env_t *env)
 
4039
           {
 
4040
               int i = 0;
 
4041
               int count = 0;
 
4042
               void *element = NULL;
 
4043
 
 
4044
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
4045
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
4046
               
 
4047
 
 
4048
               
 
4049
            
 
4050
                
 
4051
                if(_networkRule->property_protocol != NULL)
 
4052
                {
 
4053
                   
 
4054
                   
 
4055
                        AXIS2_FREE(env-> allocator, _networkRule->property_protocol);
 
4056
                     _networkRule->property_protocol = NULL;
 
4057
                }
 
4058
            
 
4059
                
 
4060
                
 
4061
                _networkRule->is_valid_protocol = AXIS2_FALSE; 
 
4062
               return AXIS2_SUCCESS;
 
4063
           }
 
4064
 
 
4065
           /**
 
4066
            * Check whether protocol is nill
 
4067
            */
 
4068
           axis2_bool_t AXIS2_CALL
 
4069
           adb_networkRule_is_protocol_nil(
 
4070
                   adb_networkRule_t* _networkRule,
 
4071
                   const axutil_env_t *env)
 
4072
           {
 
4073
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
4074
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
4075
               
 
4076
               return !_networkRule->is_valid_protocol;
 
4077
           }
 
4078
 
 
4079
           /**
 
4080
            * Set protocol to nill (currently the same as reset)
 
4081
            */
 
4082
           axis2_status_t AXIS2_CALL
 
4083
           adb_networkRule_set_protocol_nil(
 
4084
                   adb_networkRule_t* _networkRule,
 
4085
                   const axutil_env_t *env)
 
4086
           {
 
4087
               return adb_networkRule_reset_protocol(_networkRule, env);
 
4088
           }
 
4089
 
 
4090
           
 
4091
 
 
4092
            /**
 
4093
             * getter for portRangeMin.
 
4094
             */
 
4095
            int AXIS2_CALL
 
4096
            adb_networkRule_get_portRangeMin(
 
4097
                    adb_networkRule_t* _networkRule,
 
4098
                    const axutil_env_t *env)
 
4099
             {
 
4100
                
 
4101
                    AXIS2_ENV_CHECK(env, (int)0);
 
4102
                    AXIS2_PARAM_CHECK(env->error, _networkRule, (int)0);
 
4103
                  
 
4104
 
 
4105
                return _networkRule->property_portRangeMin;
 
4106
             }
 
4107
 
 
4108
            /**
 
4109
             * setter for portRangeMin
 
4110
             */
 
4111
            axis2_status_t AXIS2_CALL
 
4112
            adb_networkRule_set_portRangeMin(
 
4113
                    adb_networkRule_t* _networkRule,
 
4114
                    const axutil_env_t *env,
 
4115
                    const int  arg_portRangeMin)
 
4116
             {
 
4117
                
 
4118
 
 
4119
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
4120
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
4121
                
 
4122
                if(_networkRule->is_valid_portRangeMin &&
 
4123
                        arg_portRangeMin == _networkRule->property_portRangeMin)
 
4124
                {
 
4125
                    
 
4126
                    return AXIS2_SUCCESS; 
 
4127
                }
 
4128
 
 
4129
                adb_networkRule_reset_portRangeMin(_networkRule, env);
 
4130
 
 
4131
                _networkRule->property_portRangeMin = arg_portRangeMin;
 
4132
                        _networkRule->is_valid_portRangeMin = AXIS2_TRUE;
 
4133
                    
 
4134
                return AXIS2_SUCCESS;
 
4135
             }
 
4136
 
 
4137
             
 
4138
 
 
4139
           /**
 
4140
            * resetter for portRangeMin
 
4141
            */
 
4142
           axis2_status_t AXIS2_CALL
 
4143
           adb_networkRule_reset_portRangeMin(
 
4144
                   adb_networkRule_t* _networkRule,
 
4145
                   const axutil_env_t *env)
 
4146
           {
 
4147
               int i = 0;
 
4148
               int count = 0;
 
4149
               void *element = NULL;
 
4150
 
 
4151
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
4152
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
4153
               
 
4154
 
 
4155
               _networkRule->is_valid_portRangeMin = AXIS2_FALSE; 
 
4156
               return AXIS2_SUCCESS;
 
4157
           }
 
4158
 
 
4159
           /**
 
4160
            * Check whether portRangeMin is nill
 
4161
            */
 
4162
           axis2_bool_t AXIS2_CALL
 
4163
           adb_networkRule_is_portRangeMin_nil(
 
4164
                   adb_networkRule_t* _networkRule,
 
4165
                   const axutil_env_t *env)
 
4166
           {
 
4167
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
4168
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
4169
               
 
4170
               return !_networkRule->is_valid_portRangeMin;
 
4171
           }
 
4172
 
 
4173
           /**
 
4174
            * Set portRangeMin to nill (currently the same as reset)
 
4175
            */
 
4176
           axis2_status_t AXIS2_CALL
 
4177
           adb_networkRule_set_portRangeMin_nil(
 
4178
                   adb_networkRule_t* _networkRule,
 
4179
                   const axutil_env_t *env)
 
4180
           {
 
4181
               return adb_networkRule_reset_portRangeMin(_networkRule, env);
 
4182
           }
 
4183
 
 
4184
           
 
4185
 
 
4186
            /**
 
4187
             * getter for portRangeMax.
 
4188
             */
 
4189
            int AXIS2_CALL
 
4190
            adb_networkRule_get_portRangeMax(
 
4191
                    adb_networkRule_t* _networkRule,
 
4192
                    const axutil_env_t *env)
 
4193
             {
 
4194
                
 
4195
                    AXIS2_ENV_CHECK(env, (int)0);
 
4196
                    AXIS2_PARAM_CHECK(env->error, _networkRule, (int)0);
 
4197
                  
 
4198
 
 
4199
                return _networkRule->property_portRangeMax;
 
4200
             }
 
4201
 
 
4202
            /**
 
4203
             * setter for portRangeMax
 
4204
             */
 
4205
            axis2_status_t AXIS2_CALL
 
4206
            adb_networkRule_set_portRangeMax(
 
4207
                    adb_networkRule_t* _networkRule,
 
4208
                    const axutil_env_t *env,
 
4209
                    const int  arg_portRangeMax)
 
4210
             {
 
4211
                
 
4212
 
 
4213
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
4214
                AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
4215
                
 
4216
                if(_networkRule->is_valid_portRangeMax &&
 
4217
                        arg_portRangeMax == _networkRule->property_portRangeMax)
 
4218
                {
 
4219
                    
 
4220
                    return AXIS2_SUCCESS; 
 
4221
                }
 
4222
 
 
4223
                adb_networkRule_reset_portRangeMax(_networkRule, env);
 
4224
 
 
4225
                _networkRule->property_portRangeMax = arg_portRangeMax;
 
4226
                        _networkRule->is_valid_portRangeMax = AXIS2_TRUE;
 
4227
                    
 
4228
                return AXIS2_SUCCESS;
 
4229
             }
 
4230
 
 
4231
             
 
4232
 
 
4233
           /**
 
4234
            * resetter for portRangeMax
 
4235
            */
 
4236
           axis2_status_t AXIS2_CALL
 
4237
           adb_networkRule_reset_portRangeMax(
 
4238
                   adb_networkRule_t* _networkRule,
 
4239
                   const axutil_env_t *env)
 
4240
           {
 
4241
               int i = 0;
 
4242
               int count = 0;
 
4243
               void *element = NULL;
 
4244
 
 
4245
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
4246
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_FAILURE);
 
4247
               
 
4248
 
 
4249
               _networkRule->is_valid_portRangeMax = AXIS2_FALSE; 
 
4250
               return AXIS2_SUCCESS;
 
4251
           }
 
4252
 
 
4253
           /**
 
4254
            * Check whether portRangeMax is nill
 
4255
            */
 
4256
           axis2_bool_t AXIS2_CALL
 
4257
           adb_networkRule_is_portRangeMax_nil(
 
4258
                   adb_networkRule_t* _networkRule,
 
4259
                   const axutil_env_t *env)
 
4260
           {
 
4261
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
 
4262
               AXIS2_PARAM_CHECK(env->error, _networkRule, AXIS2_TRUE);
 
4263
               
 
4264
               return !_networkRule->is_valid_portRangeMax;
 
4265
           }
 
4266
 
 
4267
           /**
 
4268
            * Set portRangeMax to nill (currently the same as reset)
 
4269
            */
 
4270
           axis2_status_t AXIS2_CALL
 
4271
           adb_networkRule_set_portRangeMax_nil(
 
4272
                   adb_networkRule_t* _networkRule,
 
4273
                   const axutil_env_t *env)
 
4274
           {
 
4275
               return adb_networkRule_reset_portRangeMax(_networkRule, env);
 
4276
           }
 
4277
 
 
4278
           
 
4279