Interface TopologyCountByClasses

All Superinterfaces:
Serializable

@NotFinalAPI public interface TopologyCountByClasses extends Serializable
Result count of a topology query execution.
You can retrieve CIs and relations counts from this by query node name.

Example: Return the number of hosts in uCMDB with breakdown by class name

 QueryDefinition queryDefinition = factory.createQueryDefinition("Get all hosts");
 queryDefinition.addNode("Hosts").ofType("host").linkedTo(queryDefinition.addNode("Ips").ofType("ip"));
 TopologyCountByClasses topologyCountByClass =
     topologyQueryService.evaluateQueryByClasses(queryDefinition, Arrays.asList("host"));
 System.out.println("Hosts breakdown by class:" + topologyCountByClass.getClassesCount("Hosts"));
 }
 

Since:
UCMDB 9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    getClassesCount(String elementName)
    Returns the classes count map (class name -> class count) for the given query element (QueryNode or QueryLink) name.
    Returns the full count map of available classes.
  • Method Details

    • getClassesCount

      Map<String,Integer> getClassesCount(String elementName)
      Returns the classes count map (class name -> class count) for the given query element (QueryNode or QueryLink) name.
      Parameters:
      elementName - the query element name.
      Returns:
      the map of class names to count, or empty map if the element name was not found.
    • getFullMap

      Map<String,Map<String,Integer>> getFullMap()
      Returns the full count map of available classes. Map is element name -> class name -> class count.

      Note: this map might not have all entries requested, do not assume key existence.

      Returns:
      the map.