~ubuntu-branches/ubuntu/maverick/eucalyptus/maverick

« back to all changes in this revision

Viewing changes to cluster/generated/adb_DescribeResources.c

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2010-07-21 17:27:10 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721172710-7xv07dmdqgivc3t9
Tags: 2.0~bzr1211-0ubuntu1
* New major upstream version merge, 2.0 (r1211).
* debian/patches/:
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 
  - 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:
8
8
         */
9
9
 
10
10
        #include "adb_DescribeResources.h"
11
 
 
 
11
        
12
12
               /*
13
13
                * implmentation of the DescribeResources|http://eucalyptus.ucsb.edu/ element
14
14
                */
15
 
 
 
15
           
16
16
 
17
17
 
18
18
        struct adb_DescribeResources
19
19
        {
20
 
 
 
20
            
21
21
                axutil_qname_t* qname;
22
22
            adb_describeResourcesType_t* property_DescribeResources;
23
23
 
24
 
 
 
24
                
25
25
                axis2_bool_t is_valid_DescribeResources;
26
26
 
27
27
 
28
 
 
 
28
            
29
29
        };
30
30
 
31
31
 
32
32
       /************************* Private Function prototypes ********************************/
33
 
 
 
33
        
34
34
 
35
35
 
36
36
       /************************* Function Implmentations ********************************/
39
39
            const axutil_env_t *env)
40
40
        {
41
41
            adb_DescribeResources_t *_DescribeResources = NULL;
42
 
 
 
42
            
43
43
                axutil_qname_t* qname = NULL;
44
 
 
 
44
            
45
45
            AXIS2_ENV_CHECK(env, NULL);
46
46
 
47
47
            _DescribeResources = (adb_DescribeResources_t *) AXIS2_MALLOC(env->
57
57
 
58
58
            _DescribeResources->property_DescribeResources  = NULL;
59
59
                  _DescribeResources->is_valid_DescribeResources  = AXIS2_FALSE;
60
 
 
 
60
            
61
61
                  qname =  axutil_qname_create (env,
62
62
                        "DescribeResources",
63
63
                        "http://eucalyptus.ucsb.edu/",
64
64
                        NULL);
65
65
                _DescribeResources->qname = qname;
66
 
 
 
66
            
67
67
 
68
68
            return _DescribeResources;
69
69
        }
73
73
                adb_DescribeResources_t* _DescribeResources,
74
74
                const axutil_env_t *env)
75
75
        {
76
 
 
 
76
            
77
77
 
78
78
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
79
79
            AXIS2_PARAM_CHECK(env->error, _DescribeResources, AXIS2_FAILURE);
80
80
 
81
81
            adb_DescribeResources_reset_DescribeResources(_DescribeResources, env);
82
 
 
 
82
            
83
83
              if(_DescribeResources->qname)
84
84
              {
85
85
                  axutil_qname_free (_DescribeResources->qname, env);
86
86
                  _DescribeResources->qname = NULL;
87
87
              }
88
 
 
 
88
            
89
89
 
90
90
            if(_DescribeResources)
91
91
            {
96
96
        }
97
97
 
98
98
 
99
 
 
 
99
        
100
100
 
101
101
        axis2_status_t AXIS2_CALL
102
102
        adb_DescribeResources_deserialize(
107
107
                axis2_bool_t dont_care_minoccurs)
108
108
        {
109
109
          axiom_node_t *parent = *dp_parent;
110
 
 
 
110
          
111
111
          axis2_status_t status = AXIS2_SUCCESS;
112
 
 
 
112
          
113
113
              void *element = NULL;
114
 
 
 
114
           
115
115
             axis2_char_t* text_value = NULL;
116
116
             axutil_qname_t *qname = NULL;
117
 
 
118
 
            axutil_qname_t *element_qname = NULL;
119
 
 
 
117
          
 
118
            axutil_qname_t *element_qname = NULL; 
 
119
            
120
120
               axiom_node_t *first_node = NULL;
121
121
               axis2_bool_t is_early_node_valid = AXIS2_TRUE;
122
122
               axiom_node_t *current_node = NULL;
123
123
               axiom_element_t *current_element = NULL;
124
 
 
 
124
            
125
125
            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
126
126
            AXIS2_PARAM_CHECK(env->error, _DescribeResources, AXIS2_FAILURE);
127
127
 
128
 
 
129
 
 
 
128
            
 
129
              
130
130
              while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT)
131
131
              {
132
132
                  parent = axiom_node_get_next_sibling(parent, env);
134
134
              if (NULL == parent)
135
135
              {
136
136
                /* This should be checked before everything */
137
 
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
 
137
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
138
138
                            "Failed in building adb object for DescribeResources : "
139
139
                            "NULL elemenet can not be passed to deserialize");
140
140
                return AXIS2_FAILURE;
141
141
              }
142
 
 
 
142
              
143
143
 
144
144
                    current_element = (axiom_element_t *)axiom_node_get_data_element(parent, env);
145
145
                    qname = axiom_element_get_qname(current_element, env, parent);
146
146
                    if (axutil_qname_equals(qname, env, _DescribeResources-> qname))
147
147
                    {
148
 
 
 
148
                        
149
149
                          first_node = parent;
150
 
 
 
150
                          
151
151
                    }
152
152
                    else
153
153
                    {
154
 
                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
 
154
                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
155
155
                              "Failed in building adb object for DescribeResources : "
156
156
                              "Expected %s but returned %s",
157
157
                              axutil_qname_to_string(_DescribeResources-> qname, env),
158
158
                              axutil_qname_to_string(qname, env));
159
 
 
 
159
                        
160
160
                        return AXIS2_FAILURE;
161
161
                    }
162
 
 
163
 
 
164
 
 
 
162
                    
 
163
 
 
164
                     
165
165
                     /*
166
166
                      * building DescribeResources element
167
167
                      */
168
 
 
169
 
 
170
 
 
 
168
                     
 
169
                     
 
170
                     
171
171
                                   current_node = first_node;
172
172
                                   is_early_node_valid = AXIS2_FALSE;
173
 
 
174
 
 
 
173
                                   
 
174
                                   
175
175
                                    while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
176
176
                                    {
177
177
                                        current_node = axiom_node_get_next_sibling(current_node, env);
181
181
                                        current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env);
182
182
                                        qname = axiom_element_get_qname(current_element, env, current_node);
183
183
                                    }
184
 
 
 
184
                                   
185
185
                                 element_qname = axutil_qname_create(env, "DescribeResources", "http://eucalyptus.ucsb.edu/", NULL);
186
 
 
187
 
 
188
 
                           if (adb_describeResourcesType_is_particle() ||
 
186
                                 
 
187
 
 
188
                           if (adb_describeResourcesType_is_particle() ||  
189
189
                                (current_node   && current_element && (axutil_qname_equals(element_qname, env, qname))))
190
190
                           {
191
191
                              if( current_node   && current_element && (axutil_qname_equals(element_qname, env, qname)))
192
192
                              {
193
193
                                is_early_node_valid = AXIS2_TRUE;
194
194
                              }
195
 
 
196
 
 
 
195
                              
 
196
                                 
197
197
                                      element = (void*)adb_describeResourcesType_create(env);
198
198
 
199
199
                                      status =  adb_describeResourcesType_deserialize((adb_describeResourcesType_t*)element,
207
207
                                          status = adb_DescribeResources_set_DescribeResources(_DescribeResources, env,
208
208
                                                                   (adb_describeResourcesType_t*)element);
209
209
                                      }
210
 
 
 
210
                                    
211
211
                                 if(AXIS2_FAILURE ==  status)
212
212
                                 {
213
213
                                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for DescribeResources ");
218
218
                                     return AXIS2_FAILURE;
219
219
                                 }
220
220
                              }
221
 
 
 
221
                           
222
222
                              else if(!dont_care_minoccurs)
223
223
                              {
224
224
                                  if(element_qname)
229
229
                                  AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "non nillable or minOuccrs != 0 element DescribeResources missing");
230
230
                                  return AXIS2_FAILURE;
231
231
                              }
232
 
 
 
232
                           
233
233
                  if(element_qname)
234
234
                  {
235
235
                     axutil_qname_free(element_qname, env);
236
236
                     element_qname = NULL;
237
237
                  }
238
 
 
 
238
                 
239
239
          return status;
240
240
       }
241
241
 
242
242
          axis2_bool_t AXIS2_CALL
243
243
          adb_DescribeResources_is_particle()
244
244
          {
245
 
 
 
245
            
246
246
                 return AXIS2_FALSE;
247
 
 
 
247
              
248
248
          }
249
249
 
250
250
 
254
254
                    const axutil_env_t *env, axiom_element_t *parent_element,
255
255
                    axutil_hash_t *namespaces, int *next_ns_index)
256
256
          {
257
 
 
 
257
            
258
258
                  /* Here this is an empty function, Nothing to declare */
259
 
 
 
259
                 
260
260
          }
261
261
 
262
 
 
263
 
 
 
262
        
 
263
        
264
264
        axiom_node_t* AXIS2_CALL
265
265
        adb_DescribeResources_serialize(
266
266
                adb_DescribeResources_t* _DescribeResources,
267
267
                const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index)
268
268
        {
269
 
 
270
 
 
271
 
 
 
269
            
 
270
            
 
271
         
272
272
         axiom_node_t *current_node = NULL;
273
273
         int tag_closed = 0;
274
274
 
275
 
 
276
 
 
 
275
         
 
276
         
277
277
                axiom_namespace_t *ns1 = NULL;
278
278
 
279
279
                axis2_char_t *qname_uri = NULL;
280
280
                axis2_char_t *qname_prefix = NULL;
281
281
                axis2_char_t *p_prefix = NULL;
282
282
                axis2_bool_t ns_already_defined;
283
 
 
 
283
            
284
284
                    axis2_char_t text_value_1[64];
285
 
 
 
285
                    
286
286
               axis2_char_t *start_input_str = NULL;
287
287
               axis2_char_t *end_input_str = NULL;
288
288
               unsigned int start_input_str_len = 0;
289
289
               unsigned int end_input_str_len = 0;
290
 
 
291
 
 
 
290
            
 
291
            
292
292
               axiom_data_source_t *data_source = NULL;
293
293
               axutil_stream_t *stream = NULL;
294
294
 
295
 
 
 
295
             
296
296
                int next_ns_index_value = 0;
297
 
 
 
297
            
298
298
 
299
299
            AXIS2_ENV_CHECK(env, NULL);
300
300
            AXIS2_PARAM_CHECK(env->error, _DescribeResources, NULL);
301
 
 
302
 
 
 
301
            
 
302
             
303
303
                    namespaces = axutil_hash_make(env);
304
304
                    next_ns_index = &next_ns_index_value;
305
 
 
 
305
                     
306
306
                           ns1 = axiom_namespace_create (env,
307
307
                                             "http://eucalyptus.ucsb.edu/",
308
 
                                             "n");
 
308
                                             "n"); 
309
309
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n"));
310
 
 
311
 
 
 
310
                       
 
311
                     
312
312
                    parent_element = axiom_element_create (env, NULL, "DescribeResources", ns1 , &parent);
313
 
 
314
 
 
 
313
                    
 
314
                    
315
315
                    axiom_element_set_namespace(parent_element, env, ns1, parent);
316
316
 
317
317
 
318
 
 
 
318
            
319
319
                    data_source = axiom_data_source_create(env, parent, &current_node);
320
320
                    stream = axiom_data_source_get_stream(data_source, env);
321
 
 
 
321
                  
322
322
                       if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING)))
323
323
                       {
324
324
                           p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
325
325
                           sprintf(p_prefix, "n%d", (*next_ns_index)++);
326
326
                           axutil_hash_set(namespaces, "http://eucalyptus.ucsb.edu/", AXIS2_HASH_KEY_STRING, p_prefix);
327
 
 
 
327
                           
328
328
                           axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env,
329
329
                                            "http://eucalyptus.ucsb.edu/",
330
330
                                            p_prefix));
331
331
                       }
332
 
 
 
332
                      
333
333
 
334
334
                   if (!_DescribeResources->is_valid_DescribeResources)
335
335
                   {
336
 
 
337
 
 
 
336
                      
 
337
                            
338
338
                            start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
339
 
                                        (5 + axutil_strlen(p_prefix) +
340
 
                                         axutil_strlen("DescribeResources") +
341
 
                                         axutil_strlen(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"1\"")));
342
 
 
343
 
 
 
339
                                        (5 + axutil_strlen(p_prefix) + 
 
340
                                         axutil_strlen("DescribeResources") + 
 
341
                                         axutil_strlen(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"1\""))); 
 
342
                                        
 
343
                            
344
344
                            sprintf(start_input_str, "<%s%sDescribeResources xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"1\"/>",
345
345
                                        p_prefix?p_prefix:"",
346
346
                                        (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
347
 
 
 
347
                                        
348
348
                            axutil_stream_write(stream, env, start_input_str, axutil_strlen(start_input_str));
349
349
                            AXIS2_FREE(env->allocator,start_input_str);
350
 
 
 
350
                          
351
351
                   }
352
352
                   else
353
353
                   {
354
354
                     start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
355
 
                                 (4 + axutil_strlen(p_prefix) +
356
 
                                  axutil_strlen("DescribeResources")));
357
 
 
 
355
                                 (4 + axutil_strlen(p_prefix) + 
 
356
                                  axutil_strlen("DescribeResources"))); 
 
357
                                 
358
358
                                 /* axutil_strlen("<:>") + 1 = 4 */
359
359
                     end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
360
360
                                 (5 + axutil_strlen(p_prefix) + axutil_strlen("DescribeResources")));
361
361
                                  /* axutil_strlen("</:>") + 1 = 5 */
362
 
 
363
 
 
364
 
 
365
 
 
366
 
 
367
 
 
 
362
                                  
 
363
                     
 
364
 
 
365
                   
 
366
                   
 
367
                     
368
368
                     /*
369
369
                      * parsing DescribeResources element
370
370
                      */
371
371
 
372
 
 
373
 
 
 
372
                    
 
373
                    
374
374
                            sprintf(start_input_str, "<%s%sDescribeResources",
375
375
                                 p_prefix?p_prefix:"",
376
 
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
377
 
 
 
376
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); 
 
377
                            
378
378
                        start_input_str_len = axutil_strlen(start_input_str);
379
379
                        sprintf(end_input_str, "</%s%sDescribeResources>",
380
380
                                 p_prefix?p_prefix:"",
381
381
                                 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
382
382
                        end_input_str_len = axutil_strlen(end_input_str);
383
 
 
384
 
                            adb_describeResourcesType_serialize(_DescribeResources->property_DescribeResources,
 
383
                    
 
384
                            adb_describeResourcesType_serialize(_DescribeResources->property_DescribeResources, 
385
385
                                                                                 env, current_node, parent_element,
386
386
                                                                                 adb_describeResourcesType_is_particle() || AXIS2_TRUE, namespaces, next_ns_index);
387
 
 
388
 
 
 
387
                            
 
388
                     
389
389
                     AXIS2_FREE(env->allocator,start_input_str);
390
390
                     AXIS2_FREE(env->allocator,end_input_str);
391
 
                 }
392
 
 
393
 
 
 
391
                 } 
 
392
 
 
393
                 
394
394
                   if(namespaces)
395
395
                   {
396
396
                       axutil_hash_index_t *hi;
397
397
                       void *val;
398
 
                       for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi))
 
398
                       for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) 
399
399
                       {
400
400
                           axutil_hash_this(hi, NULL, NULL, &val);
401
401
                           AXIS2_FREE(env->allocator, val);
402
402
                       }
403
403
                       axutil_hash_free(namespaces, env);
404
404
                   }
405
 
 
 
405
                
406
406
 
407
407
            return parent;
408
408
        }
409
409
 
410
410
 
411
 
 
 
411
        
412
412
 
413
413
            /**
414
414
             * getter for DescribeResources.
418
418
                    adb_DescribeResources_t* _DescribeResources,
419
419
                    const axutil_env_t *env)
420
420
             {
421
 
 
 
421
                
422
422
                    AXIS2_ENV_CHECK(env, NULL);
423
423
                    AXIS2_PARAM_CHECK(env->error, _DescribeResources, NULL);
424
 
 
 
424
                  
425
425
 
426
426
                return _DescribeResources->property_DescribeResources;
427
427
             }
435
435
                    const axutil_env_t *env,
436
436
                    adb_describeResourcesType_t*  arg_DescribeResources)
437
437
             {
438
 
 
 
438
                
439
439
 
440
440
                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
441
441
                AXIS2_PARAM_CHECK(env->error, _DescribeResources, AXIS2_FAILURE);
442
 
 
 
442
                
443
443
                if(_DescribeResources->is_valid_DescribeResources &&
444
444
                        arg_DescribeResources == _DescribeResources->property_DescribeResources)
445
445
                {
446
 
 
447
 
                    return AXIS2_SUCCESS;
 
446
                    
 
447
                    return AXIS2_SUCCESS; 
448
448
                }
449
449
 
450
450
                adb_DescribeResources_reset_DescribeResources(_DescribeResources, env);
451
451
 
452
 
 
 
452
                
453
453
                if(NULL == arg_DescribeResources)
454
454
                {
455
455
                    /* We are already done */
457
457
                }
458
458
                _DescribeResources->property_DescribeResources = arg_DescribeResources;
459
459
                        _DescribeResources->is_valid_DescribeResources = AXIS2_TRUE;
460
 
 
 
460
                    
461
461
                return AXIS2_SUCCESS;
462
462
             }
463
463
 
464
 
 
 
464
             
465
465
 
466
466
           /**
467
467
            * resetter for DescribeResources
477
477
 
478
478
               AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
479
479
               AXIS2_PARAM_CHECK(env->error, _DescribeResources, AXIS2_FAILURE);
480
 
 
481
 
 
482
 
 
483
 
 
484
 
 
 
480
               
 
481
 
 
482
               
 
483
            
 
484
                
485
485
                if(_DescribeResources->property_DescribeResources != NULL)
486
486
                {
487
 
 
488
 
 
 
487
                   
 
488
                   
489
489
                        adb_describeResourcesType_free(_DescribeResources->property_DescribeResources, env);
490
490
                     _DescribeResources->property_DescribeResources = NULL;
491
491
                }
492
 
 
493
 
 
494
 
 
495
 
                _DescribeResources->is_valid_DescribeResources = AXIS2_FALSE;
 
492
            
 
493
                
 
494
                
 
495
                _DescribeResources->is_valid_DescribeResources = AXIS2_FALSE; 
496
496
               return AXIS2_SUCCESS;
497
497
           }
498
498
 
506
506
           {
507
507
               AXIS2_ENV_CHECK(env, AXIS2_TRUE);
508
508
               AXIS2_PARAM_CHECK(env->error, _DescribeResources, AXIS2_TRUE);
509
 
 
 
509
               
510
510
               return !_DescribeResources->is_valid_DescribeResources;
511
511
           }
512
512
 
521
521
               return adb_DescribeResources_reset_DescribeResources(_DescribeResources, env);
522
522
           }
523
523
 
524
 
 
 
524
           
525
525