Class QueryTemplateVersionClassifier

java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.templates.QueryTemplateVersionClassifier

public class QueryTemplateVersionClassifier extends Object
Classifies the difference between a persisted and a submitted Query Template definition and derives the minimum version advancement it requires: the Version Advancement rules of PUT /query-templates/{name}. Both definitions are in the comparable form produced by QueryTemplateDefinitionValidator.comparable(JsonNode).
Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

  • Method Details

    • classify

      public QueryTemplateVersionClassifier.Advancement classify(org.gcube.com.fasterxml.jackson.databind.JsonNode persisted, org.gcube.com.fasterxml.jackson.databind.JsonNode submitted)
      Returns the minimum advancement the difference between two definitions requires: the highest one required by any of their differences, at least QueryTemplateVersionClassifier.Advancement.PATCH.
      Parameters:
      persisted - the comparable persisted definition
      submitted - the comparable submitted definition
      Returns:
      the minimum advancement
    • lowestAccepted

      public org.gcube.informationsystem.utils.Version lowestAccepted(org.gcube.informationsystem.utils.Version persisted, QueryTemplateVersionClassifier.Advancement advancement)
      Returns the lowest version that satisfies an advancement from the persisted version.
      Parameters:
      persisted - the persisted version
      advancement - the required advancement
      Returns:
      the lowest accepted version