/condor-7.9.0/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummary.cpp

# · C++ · 1163 lines · 701 code · 356 blank · 106 comment · 118 complexity · a28f5dfabb023a9ba858b5a9b5d8d3e5 MD5 · raw file

  1. /**
  2. * GetSubmissionSummary.cpp
  3. *
  4. * This file was auto-generated from WSDL
  5. * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00)
  6. */
  7. #include "AviaryQuery_GetSubmissionSummary.h"
  8. #include <Environment.h>
  9. #include <WSFError.h>
  10. using namespace wso2wsf;
  11. using namespace std;
  12. using namespace AviaryQuery;
  13. /*
  14. * Implementation of the GetSubmissionSummary|http://query.aviary.grid.redhat.com Element
  15. */
  16. AviaryQuery::GetSubmissionSummary::GetSubmissionSummary()
  17. {
  18. qname = NULL;
  19. property_Ids = NULL;
  20. isValidIds = false;
  21. isValidPartialMatches = false;
  22. isValidIncludeJobSummaries = false;
  23. qname = axutil_qname_create (Environment::getEnv(),
  24. "GetSubmissionSummary",
  25. "http://query.aviary.grid.redhat.com",
  26. NULL);
  27. }
  28. AviaryQuery::GetSubmissionSummary::GetSubmissionSummary(std::vector<AviaryCommon::SubmissionID*>* arg_Ids,bool arg_PartialMatches,bool arg_IncludeJobSummaries)
  29. {
  30. qname = NULL;
  31. property_Ids = NULL;
  32. isValidIds = true;
  33. isValidPartialMatches = true;
  34. isValidIncludeJobSummaries = true;
  35. qname = axutil_qname_create (Environment::getEnv(),
  36. "GetSubmissionSummary",
  37. "http://query.aviary.grid.redhat.com",
  38. NULL);
  39. property_Ids = arg_Ids;
  40. property_PartialMatches = arg_PartialMatches;
  41. property_IncludeJobSummaries = arg_IncludeJobSummaries;
  42. }
  43. AviaryQuery::GetSubmissionSummary::~GetSubmissionSummary()
  44. {
  45. }
  46. bool WSF_CALL
  47. AviaryQuery::GetSubmissionSummary::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs)
  48. {
  49. axiom_node_t *parent = *dp_parent;
  50. bool status = AXIS2_SUCCESS;
  51. axiom_attribute_t *parent_attri = NULL;
  52. axiom_element_t *parent_element = NULL;
  53. axis2_char_t *attrib_text = NULL;
  54. axutil_hash_t *attribute_hash = NULL;
  55. const axis2_char_t* text_value = NULL;
  56. axutil_qname_t *mqname = NULL;
  57. int i = 0;
  58. int sequence_broken = 0;
  59. axiom_node_t *tmp_node = NULL;
  60. axutil_qname_t *element_qname = NULL;
  61. axiom_node_t *first_node = NULL;
  62. bool is_early_node_valid = true;
  63. axiom_node_t *current_node = NULL;
  64. axiom_element_t *current_element = NULL;
  65. while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT)
  66. {
  67. parent = axiom_node_get_next_sibling(parent, Environment::getEnv());
  68. }
  69. if (NULL == parent)
  70. {
  71. return AXIS2_FAILURE;
  72. }
  73. current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv());
  74. mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent);
  75. if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname))
  76. {
  77. first_node = axiom_node_get_first_child(parent, Environment::getEnv());
  78. }
  79. else
  80. {
  81. WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI,
  82. "Failed in building adb object for GetSubmissionSummary : "
  83. "Expected %s but returned %s",
  84. axutil_qname_to_string(qname, Environment::getEnv()),
  85. axutil_qname_to_string(mqname, Environment::getEnv()));
  86. return AXIS2_FAILURE;
  87. }
  88. parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv());
  89. attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv());
  90. {
  91. /*
  92. * building Ids array
  93. */
  94. std::vector<AviaryCommon::SubmissionID*>* arr_list =new std::vector<AviaryCommon::SubmissionID*>();
  95. /*
  96. * building ids element
  97. */
  98. element_qname = axutil_qname_create(Environment::getEnv(), "ids", NULL, NULL);
  99. for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;)
  100. {
  101. if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT)
  102. {
  103. current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv());
  104. is_early_node_valid = false;
  105. continue;
  106. }
  107. current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv());
  108. mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node);
  109. if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("ids", axiom_element_get_localname(current_element, Environment::getEnv())))
  110. {
  111. is_early_node_valid = true;
  112. AviaryCommon::SubmissionID* element = new AviaryCommon::SubmissionID();
  113. status = element->deserialize(&current_node, &is_early_node_valid, false);
  114. if(AXIS2_FAILURE == status)
  115. {
  116. WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element ids ");
  117. }
  118. else
  119. {
  120. arr_list->push_back(element);
  121. }
  122. if(AXIS2_FAILURE == status)
  123. {
  124. WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for ids ");
  125. if(element_qname)
  126. {
  127. axutil_qname_free(element_qname, Environment::getEnv());
  128. }
  129. if(arr_list)
  130. {
  131. delete arr_list;
  132. }
  133. return false;
  134. }
  135. i++;
  136. current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv());
  137. }
  138. else
  139. {
  140. is_early_node_valid = false;
  141. sequence_broken = 1;
  142. }
  143. }
  144. if (i < 0)
  145. {
  146. /* found element out of order */
  147. WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids (@minOccurs = '0') only have %d elements", i);
  148. if(element_qname)
  149. {
  150. axutil_qname_free(element_qname, Environment::getEnv());
  151. }
  152. if(arr_list)
  153. {
  154. delete arr_list;
  155. }
  156. return false;
  157. }
  158. if(0 == arr_list->size())
  159. {
  160. delete arr_list;
  161. }
  162. else
  163. {
  164. status = setIds(arr_list);
  165. }
  166. }
  167. if(element_qname)
  168. {
  169. axutil_qname_free(element_qname, Environment::getEnv());
  170. element_qname = NULL;
  171. }
  172. parent_attri = NULL;
  173. attrib_text = NULL;
  174. if(attribute_hash)
  175. {
  176. axutil_hash_index_t *hi;
  177. void *val;
  178. const void *key;
  179. for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi))
  180. {
  181. axutil_hash_this(hi, &key, NULL, &val);
  182. if(!strcmp((axis2_char_t*)key, "partialMatches"))
  183. {
  184. parent_attri = (axiom_attribute_t*)val;
  185. break;
  186. }
  187. }
  188. }
  189. if(parent_attri)
  190. {
  191. attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv());
  192. }
  193. else
  194. {
  195. /* this is hoping that attribute is stored in "partialMatches", this happnes when name is in default namespace */
  196. attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "partialMatches");
  197. }
  198. if(attrib_text != NULL)
  199. {
  200. if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true"))
  201. {
  202. setPartialMatches(true);
  203. }
  204. else
  205. {
  206. setPartialMatches(false);
  207. }
  208. }
  209. if(element_qname)
  210. {
  211. axutil_qname_free(element_qname, Environment::getEnv());
  212. element_qname = NULL;
  213. }
  214. parent_attri = NULL;
  215. attrib_text = NULL;
  216. if(attribute_hash)
  217. {
  218. axutil_hash_index_t *hi;
  219. void *val;
  220. const void *key;
  221. for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi))
  222. {
  223. axutil_hash_this(hi, &key, NULL, &val);
  224. if(!strcmp((axis2_char_t*)key, "includeJobSummaries"))
  225. {
  226. parent_attri = (axiom_attribute_t*)val;
  227. break;
  228. }
  229. }
  230. }
  231. if(parent_attri)
  232. {
  233. attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv());
  234. }
  235. else
  236. {
  237. /* this is hoping that attribute is stored in "includeJobSummaries", this happnes when name is in default namespace */
  238. attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "includeJobSummaries");
  239. }
  240. if(attrib_text != NULL)
  241. {
  242. if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true"))
  243. {
  244. setIncludeJobSummaries(true);
  245. }
  246. else
  247. {
  248. setIncludeJobSummaries(false);
  249. }
  250. }
  251. if(element_qname)
  252. {
  253. axutil_qname_free(element_qname, Environment::getEnv());
  254. element_qname = NULL;
  255. }
  256. return status;
  257. }
  258. bool WSF_CALL
  259. AviaryQuery::GetSubmissionSummary::isParticle()
  260. {
  261. return false;
  262. }
  263. void WSF_CALL
  264. AviaryQuery::GetSubmissionSummary::declareParentNamespaces(
  265. axiom_element_t *parent_element,
  266. axutil_hash_t *namespaces, int *next_ns_index)
  267. {
  268. /* Here this is an empty function, Nothing to declare */
  269. }
  270. axiom_node_t* WSF_CALL
  271. AviaryQuery::GetSubmissionSummary::serialize(axiom_node_t *parent,
  272. axiom_element_t *parent_element,
  273. int parent_tag_closed,
  274. axutil_hash_t *namespaces,
  275. int *next_ns_index)
  276. {
  277. axiom_attribute_t *text_attri = NULL;
  278. axis2_char_t *string_to_stream;
  279. axiom_node_t *current_node = NULL;
  280. int tag_closed = 0;
  281. axiom_namespace_t *ns1 = NULL;
  282. axis2_char_t *qname_uri = NULL;
  283. axis2_char_t *qname_prefix = NULL;
  284. axis2_char_t *p_prefix = NULL;
  285. int i = 0;
  286. int count = 0;
  287. void *element = NULL;
  288. axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT];
  289. axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT];
  290. axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT];
  291. axis2_char_t *text_value = NULL;
  292. axis2_char_t *start_input_str = NULL;
  293. axis2_char_t *end_input_str = NULL;
  294. unsigned int start_input_str_len = 0;
  295. unsigned int end_input_str_len = 0;
  296. axiom_data_source_t *data_source = NULL;
  297. axutil_stream_t *stream = NULL;
  298. int next_ns_index_value = 0;
  299. namespaces = axutil_hash_make(Environment::getEnv());
  300. next_ns_index = &next_ns_index_value;
  301. ns1 = axiom_namespace_create (Environment::getEnv(),
  302. "http://query.aviary.grid.redhat.com",
  303. "n");
  304. axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n"));
  305. parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetSubmissionSummary", ns1 , &parent);
  306. axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent);
  307. data_source = axiom_data_source_create(Environment::getEnv(), parent, &current_node);
  308. stream = axiom_data_source_get_stream(data_source, Environment::getEnv());
  309. if(!parent_tag_closed)
  310. {
  311. if(isValidPartialMatches)
  312. {
  313. p_prefix = NULL;
  314. text_value = (axis2_char_t*)((property_PartialMatches)?"true":"false");
  315. string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) *
  316. (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT +
  317. axutil_strlen(text_value) +
  318. axutil_strlen("partialMatches")));
  319. sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"",
  320. "partialMatches", text_value);
  321. axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream));
  322. AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream);
  323. }
  324. if(isValidIncludeJobSummaries)
  325. {
  326. p_prefix = NULL;
  327. text_value = (axis2_char_t*)((property_IncludeJobSummaries)?"true":"false");
  328. string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) *
  329. (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT +
  330. axutil_strlen(text_value) +
  331. axutil_strlen("includeJobSummaries")));
  332. sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"",
  333. "includeJobSummaries", text_value);
  334. axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream));
  335. AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream);
  336. }
  337. }
  338. p_prefix = NULL;
  339. if (!isValidIds)
  340. {
  341. /* no need to complain for minoccurs=0 element */
  342. }
  343. else
  344. {
  345. start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) *
  346. (4 + axutil_strlen(p_prefix) +
  347. axutil_strlen("ids")));
  348. /* axutil_strlen("<:>") + 1 = 4 */
  349. end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) *
  350. (5 + axutil_strlen(p_prefix) + axutil_strlen("ids")));
  351. /* axutil_strlen("</:>") + 1 = 5 */
  352. /*
  353. * Parsing Ids array
  354. */
  355. if (property_Ids != NULL)
  356. {
  357. sprintf(start_input_str, "<%s%sids",
  358. p_prefix?p_prefix:"",
  359. (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
  360. start_input_str_len = axutil_strlen(start_input_str);
  361. sprintf(end_input_str, "</%s%sids>",
  362. p_prefix?p_prefix:"",
  363. (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
  364. end_input_str_len = axutil_strlen(end_input_str);
  365. count = property_Ids->size();
  366. for(i = 0; i < count; i++)
  367. {
  368. AviaryCommon::SubmissionID* element = (*property_Ids)[i];
  369. if(NULL == element)
  370. {
  371. continue;
  372. }
  373. /*
  374. * parsing ids element
  375. */
  376. if(!element->isParticle())
  377. {
  378. axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len);
  379. }
  380. element->serialize(current_node, parent_element,
  381. element->isParticle() || false, namespaces, next_ns_index);
  382. if(!element->isParticle())
  383. {
  384. axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len);
  385. }
  386. }
  387. }
  388. AXIS2_FREE(Environment::getEnv()->allocator,start_input_str);
  389. AXIS2_FREE(Environment::getEnv()->allocator,end_input_str);
  390. }
  391. if(parent_tag_closed)
  392. {
  393. if(isValidPartialMatches)
  394. {
  395. p_prefix = NULL;
  396. ns1 = NULL;
  397. text_value = (axis2_char_t*)((property_PartialMatches)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false"));
  398. text_attri = axiom_attribute_create (Environment::getEnv(), "partialMatches", text_value, ns1);
  399. axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent);
  400. AXIS2_FREE(Environment::getEnv()->allocator, text_value);
  401. }
  402. }
  403. if(parent_tag_closed)
  404. {
  405. if(isValidIncludeJobSummaries)
  406. {
  407. p_prefix = NULL;
  408. ns1 = NULL;
  409. text_value = (axis2_char_t*)((property_IncludeJobSummaries)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false"));
  410. text_attri = axiom_attribute_create (Environment::getEnv(), "includeJobSummaries", text_value, ns1);
  411. axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent);
  412. AXIS2_FREE(Environment::getEnv()->allocator, text_value);
  413. }
  414. }
  415. if(namespaces)
  416. {
  417. axutil_hash_index_t *hi;
  418. void *val;
  419. for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi))
  420. {
  421. axutil_hash_this(hi, NULL, NULL, &val);
  422. AXIS2_FREE(Environment::getEnv()->allocator, val);
  423. }
  424. axutil_hash_free(namespaces, Environment::getEnv());
  425. }
  426. return parent;
  427. }
  428. /**
  429. * Getter for ids by Property Number 1
  430. */
  431. std::vector<AviaryCommon::SubmissionID*>* WSF_CALL
  432. AviaryQuery::GetSubmissionSummary::getProperty1()
  433. {
  434. return getIds();
  435. }
  436. /**
  437. * getter for ids.
  438. */
  439. std::vector<AviaryCommon::SubmissionID*>* WSF_CALL
  440. AviaryQuery::GetSubmissionSummary::getIds()
  441. {
  442. return property_Ids;
  443. }
  444. /**
  445. * setter for ids
  446. */
  447. bool WSF_CALL
  448. AviaryQuery::GetSubmissionSummary::setIds(
  449. std::vector<AviaryCommon::SubmissionID*>* arg_Ids)
  450. {
  451. int size = 0;
  452. int i = 0;
  453. bool non_nil_exists = false;
  454. if(isValidIds &&
  455. arg_Ids == property_Ids)
  456. {
  457. return true;
  458. }
  459. size = arg_Ids->size();
  460. if (size < 0)
  461. {
  462. WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids has less than minOccurs(0)");
  463. return false;
  464. }
  465. for(i = 0; i < size; i ++ )
  466. {
  467. if(NULL != (*arg_Ids)[i])
  468. {
  469. non_nil_exists = true;
  470. break;
  471. }
  472. }
  473. resetIds();
  474. if(NULL == arg_Ids)
  475. {
  476. /* We are already done */
  477. return true;
  478. }
  479. property_Ids = arg_Ids;
  480. if(non_nil_exists)
  481. {
  482. isValidIds = true;
  483. }
  484. return true;
  485. }
  486. /**
  487. * Get ith element of ids.
  488. */
  489. AviaryCommon::SubmissionID* WSF_CALL
  490. AviaryQuery::GetSubmissionSummary::getIdsAt(int i)
  491. {
  492. AviaryCommon::SubmissionID* ret_val;
  493. if(property_Ids == NULL)
  494. {
  495. return (AviaryCommon::SubmissionID*)0;
  496. }
  497. ret_val = (*property_Ids)[i];
  498. return ret_val;
  499. }
  500. /**
  501. * Set the ith element of ids.
  502. */
  503. bool WSF_CALL
  504. AviaryQuery::GetSubmissionSummary::setIdsAt(int i,
  505. AviaryCommon::SubmissionID* arg_Ids)
  506. {
  507. AviaryCommon::SubmissionID* element;
  508. int size = 0;
  509. int non_nil_count;
  510. bool non_nil_exists = false;
  511. if( isValidIds &&
  512. property_Ids &&
  513. arg_Ids == (*property_Ids)[i])
  514. {
  515. return AXIS2_SUCCESS;
  516. }
  517. non_nil_exists = true;
  518. if(property_Ids == NULL)
  519. {
  520. property_Ids = new std::vector<AviaryCommon::SubmissionID*>();
  521. }
  522. else{
  523. /* check whether there already exist an element */
  524. element = (*property_Ids)[i];
  525. }
  526. if(NULL != element)
  527. {
  528. delete element;
  529. }
  530. if(!non_nil_exists)
  531. {
  532. isValidIds = true;
  533. (*property_Ids)[i]= NULL;
  534. return AXIS2_SUCCESS;
  535. }
  536. (*property_Ids)[i] = arg_Ids;
  537. isValidIds = true;
  538. return AXIS2_SUCCESS;
  539. }
  540. /**
  541. * Add to ids.
  542. */
  543. bool WSF_CALL
  544. AviaryQuery::GetSubmissionSummary::addIds(
  545. AviaryCommon::SubmissionID* arg_Ids)
  546. {
  547. if( NULL == arg_Ids
  548. )
  549. {
  550. return true;
  551. }
  552. if(property_Ids == NULL)
  553. {
  554. property_Ids = new std::vector<AviaryCommon::SubmissionID*>();
  555. }
  556. property_Ids->push_back(arg_Ids);
  557. isValidIds = true;
  558. return true;
  559. }
  560. /**
  561. * Get the size of the ids array.
  562. */
  563. int WSF_CALL
  564. AviaryQuery::GetSubmissionSummary::sizeofIds()
  565. {
  566. if(property_Ids == NULL)
  567. {
  568. return 0;
  569. }
  570. return property_Ids->size();
  571. }
  572. /**
  573. * remove the ith element, same as set_nil_at.
  574. */
  575. bool WSF_CALL
  576. AviaryQuery::GetSubmissionSummary::removeIdsAt(int i)
  577. {
  578. return setIdsNilAt(i);
  579. }
  580. /**
  581. * resetter for ids
  582. */
  583. bool WSF_CALL
  584. AviaryQuery::GetSubmissionSummary::resetIds()
  585. {
  586. int i = 0;
  587. int count = 0;
  588. if (property_Ids != NULL)
  589. {
  590. std::vector<AviaryCommon::SubmissionID*>::iterator it = property_Ids->begin();
  591. for( ; it < property_Ids->end() ; ++it)
  592. {
  593. AviaryCommon::SubmissionID* element = *it;
  594. if(element != NULL)
  595. {
  596. delete element;
  597. }
  598. }
  599. }
  600. if(NULL != property_Ids)
  601. delete property_Ids;
  602. isValidIds = false;
  603. return true;
  604. }
  605. /**
  606. * Check whether ids is nill
  607. */
  608. bool WSF_CALL
  609. AviaryQuery::GetSubmissionSummary::isIdsNil()
  610. {
  611. return !isValidIds;
  612. }
  613. /**
  614. * Set ids to nill (currently the same as reset)
  615. */
  616. bool WSF_CALL
  617. AviaryQuery::GetSubmissionSummary::setIdsNil()
  618. {
  619. return resetIds();
  620. }
  621. /**
  622. * Check whether ids is nill at i
  623. */
  624. bool WSF_CALL
  625. AviaryQuery::GetSubmissionSummary::isIdsNilAt(int i)
  626. {
  627. return (isValidIds == false ||
  628. NULL == property_Ids ||
  629. NULL == (*property_Ids)[i]);
  630. }
  631. /**
  632. * Set ids to nil at i
  633. */
  634. bool WSF_CALL
  635. AviaryQuery::GetSubmissionSummary::setIdsNilAt(int i)
  636. {
  637. int size = 0;
  638. int j;
  639. bool non_nil_exists = false;
  640. int k = 0;
  641. if(property_Ids == NULL ||
  642. isValidIds == false)
  643. {
  644. non_nil_exists = false;
  645. }
  646. else
  647. {
  648. size = property_Ids->size();
  649. for(j = 0, k = 0; j < size; j ++ )
  650. {
  651. if(i == j) continue;
  652. if(NULL != (*property_Ids)[i])
  653. {
  654. k++;
  655. non_nil_exists = true;
  656. if( k >= 0)
  657. {
  658. break;
  659. }
  660. }
  661. }
  662. }
  663. if( k < 0)
  664. {
  665. WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of ids is beinng set to be smaller than the specificed number of minOccurs(0)");
  666. return AXIS2_FAILURE;
  667. }
  668. if(property_Ids == NULL)
  669. {
  670. isValidIds = false;
  671. return true;
  672. }
  673. /* check whether there already exist an element */
  674. AviaryCommon::SubmissionID* element = (*property_Ids)[i];
  675. if(NULL != element)
  676. {
  677. delete element;
  678. }
  679. if(!non_nil_exists)
  680. {
  681. isValidIds = false;
  682. (*property_Ids)[i] = NULL;
  683. return AXIS2_SUCCESS;
  684. }
  685. (*property_Ids)[i] = NULL;
  686. return AXIS2_SUCCESS;
  687. }
  688. /**
  689. * Getter for partialMatches by Property Number 2
  690. */
  691. bool WSF_CALL
  692. AviaryQuery::GetSubmissionSummary::getProperty2()
  693. {
  694. return getPartialMatches();
  695. }
  696. /**
  697. * getter for partialMatches.
  698. */
  699. bool WSF_CALL
  700. AviaryQuery::GetSubmissionSummary::getPartialMatches()
  701. {
  702. return property_PartialMatches;
  703. }
  704. /**
  705. * setter for partialMatches
  706. */
  707. bool WSF_CALL
  708. AviaryQuery::GetSubmissionSummary::setPartialMatches(
  709. bool arg_PartialMatches)
  710. {
  711. if(isValidPartialMatches &&
  712. arg_PartialMatches == property_PartialMatches)
  713. {
  714. return true;
  715. }
  716. resetPartialMatches();
  717. property_PartialMatches = arg_PartialMatches;
  718. isValidPartialMatches = true;
  719. return true;
  720. }
  721. /**
  722. * resetter for partialMatches
  723. */
  724. bool WSF_CALL
  725. AviaryQuery::GetSubmissionSummary::resetPartialMatches()
  726. {
  727. int i = 0;
  728. int count = 0;
  729. isValidPartialMatches = false;
  730. return true;
  731. }
  732. /**
  733. * Check whether partialMatches is nill
  734. */
  735. bool WSF_CALL
  736. AviaryQuery::GetSubmissionSummary::isPartialMatchesNil()
  737. {
  738. return !isValidPartialMatches;
  739. }
  740. /**
  741. * Set partialMatches to nill (currently the same as reset)
  742. */
  743. bool WSF_CALL
  744. AviaryQuery::GetSubmissionSummary::setPartialMatchesNil()
  745. {
  746. return resetPartialMatches();
  747. }
  748. /**
  749. * Getter for includeJobSummaries by Property Number 3
  750. */
  751. bool WSF_CALL
  752. AviaryQuery::GetSubmissionSummary::getProperty3()
  753. {
  754. return getIncludeJobSummaries();
  755. }
  756. /**
  757. * getter for includeJobSummaries.
  758. */
  759. bool WSF_CALL
  760. AviaryQuery::GetSubmissionSummary::getIncludeJobSummaries()
  761. {
  762. return property_IncludeJobSummaries;
  763. }
  764. /**
  765. * setter for includeJobSummaries
  766. */
  767. bool WSF_CALL
  768. AviaryQuery::GetSubmissionSummary::setIncludeJobSummaries(
  769. bool arg_IncludeJobSummaries)
  770. {
  771. if(isValidIncludeJobSummaries &&
  772. arg_IncludeJobSummaries == property_IncludeJobSummaries)
  773. {
  774. return true;
  775. }
  776. resetIncludeJobSummaries();
  777. property_IncludeJobSummaries = arg_IncludeJobSummaries;
  778. isValidIncludeJobSummaries = true;
  779. return true;
  780. }
  781. /**
  782. * resetter for includeJobSummaries
  783. */
  784. bool WSF_CALL
  785. AviaryQuery::GetSubmissionSummary::resetIncludeJobSummaries()
  786. {
  787. int i = 0;
  788. int count = 0;
  789. isValidIncludeJobSummaries = false;
  790. return true;
  791. }
  792. /**
  793. * Check whether includeJobSummaries is nill
  794. */
  795. bool WSF_CALL
  796. AviaryQuery::GetSubmissionSummary::isIncludeJobSummariesNil()
  797. {
  798. return !isValidIncludeJobSummaries;
  799. }
  800. /**
  801. * Set includeJobSummaries to nill (currently the same as reset)
  802. */
  803. bool WSF_CALL
  804. AviaryQuery::GetSubmissionSummary::setIncludeJobSummariesNil()
  805. {
  806. return resetIncludeJobSummaries();
  807. }