Interface TopologyCount

All Superinterfaces:
Serializable

public interface TopologyCount 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

 QueryDefinition queryDefinition = factory.createQueryDefinition("Get all hosts");
 queryDefinition.addNode("Hosts").ofType("host");
 TopologyCount topologyCount = topologyQueryService.evaluateQuery(queryDefinition);
 System.out.println("Number of hosts:" + topologyCount.getCIsNumberByName("Hosts) ;
 }
 

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the total number of CIs in the query's result.
    int
    getCIsNumber(String nodeName)
    Returns the number of CIs associated with the specified node.
    int
    Returns the total number of relations in the query's result.
    int
    Returns the number of relations associated with the specified link.
  • Method Details

    • getCIsNumber

      int getCIsNumber()
      Returns the total number of CIs in the query's result.
      Returns:
      total number of CIs
    • getRelationsNumber

      int getRelationsNumber()
      Returns the total number of relations in the query's result.
      Returns:
      total number of relations
    • getCIsNumber

      int getCIsNumber(String nodeName)
      Returns the number of CIs associated with the specified node.
      Returns:
      number of CIs
    • getRelationsNumber

      int getRelationsNumber(String linkName)
      Returns the number of relations associated with the specified link.
      Returns:
      number of relations