java.lang.Object
org.gcube.informationsystem.resourceregistry.statistics.ContextStatistics

public class ContextStatistics extends Object
Computes the contexts group of the public statistics from the Context tree.
Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • ContextStatistics

      public ContextStatistics() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Reads the live and the deleted Contexts.
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if the Contexts cannot be read
  • Method Details

    • depthOf

      public static int depthOf(String path)
      The depth of a Context in the tree: 1 for a root.
      Parameters:
      path - the path of the Context
      Returns:
      its depth
    • liveDepths

      public Map<String,Integer> liveDepths()
      The live Contexts, keyed by UUID, with their depth.
      Returns:
      the depth of each live Context
    • compute

      public org.gcube.com.fasterxml.jackson.databind.node.ObjectNode compute()
      Computes the group.
      Returns:
      the figures of the contexts group