Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-1085

Whiteboard 

Image Added

Proposed solution

Code Block
languagejava
titlepseudo code solution
linenumberstrue
anchorNamesFilter = null

if (hasModuleCondition) {
  anchorNamesFilter[] = ... // execute current query to get just cm handle names!
}

if (hasPropertyConditons) {
   cmHandleObjects[] = ... //execute current code to get cm handle objects based on property conditions
   if (anchorNamesFilter != null) {
      cmHandleObjects.removeAll(cmHandlObject.id not in anchorNameFilter)
   }
   return cmHandleObjects[]
}

if (justIds) {
  return convertAnchorNamesToEmptyCmHandleObject(anchorNamesFilter[])  //similar to code you have in your latest patch
} else  {
  cmHandleObjects[] = new collection
  for each anchorName in anchorNameFilter[] {
     cmHandleObject = get /dmi-registry/cm-handlehandles[@id=anchorName]   // use GET with absolute path NOT a query!!!!
     cmHandleObjects[].add(cmHandleObject)
  }
  return cmHandleObjects[]
}

...