Class QueryTemplateImpl

    • Field Detail

      • description

        protected String description
      • objectMapper

        protected org.gcube.com.fasterxml.jackson.databind.ObjectMapper objectMapper
      • template

        protected org.gcube.com.fasterxml.jackson.databind.JsonNode template
      • params

        protected org.gcube.com.fasterxml.jackson.databind.JsonNode params
    • Constructor Detail

      • QueryTemplateImpl

        public QueryTemplateImpl()
    • Method Detail

      • getTemplateAsString

        public String getTemplateAsString()
                                   throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
        Specified by:
        getTemplateAsString in interface QueryTemplate
        Throws:
        org.gcube.com.fasterxml.jackson.core.JsonProcessingException
      • setTemplate

        public void setTemplate​(String template)
                         throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException,
                                IOException
        Specified by:
        setTemplate in interface QueryTemplate
        Throws:
        org.gcube.com.fasterxml.jackson.core.JsonProcessingException
        IOException
      • getTemplate

        public org.gcube.com.fasterxml.jackson.databind.JsonNode getTemplate()
        Specified by:
        getTemplate in interface QueryTemplate
      • setTemplate

        public void setTemplate​(org.gcube.com.fasterxml.jackson.databind.JsonNode template)
        Specified by:
        setTemplate in interface QueryTemplate
      • getParamsFromDefaultValues

        public org.gcube.com.fasterxml.jackson.databind.node.ObjectNode getParamsFromDefaultValues()
        Description copied from interface: QueryTemplate
        Create an ObjectNode which can be used as parameters to obtain a JSON Query from the Query Template. It uses the default values provided in TemplateVariables.
        Specified by:
        getParamsFromDefaultValues in interface QueryTemplate
        Returns:
        the created object node
      • getJsonQuery

        public org.gcube.com.fasterxml.jackson.databind.JsonNode getJsonQuery()
                                                                       throws Exception
        Specified by:
        getJsonQuery in interface QueryTemplate
        Returns:
        the JsonQuery replacing the variables using the default values contained in TemplateVariables
        Throws:
        Exception
      • replaceVariables

        protected org.gcube.com.fasterxml.jackson.databind.JsonNode replaceVariables​(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
                                                                              throws Exception
        Throws:
        Exception
      • getJsonQuery

        public org.gcube.com.fasterxml.jackson.databind.JsonNode getJsonQuery​(org.gcube.com.fasterxml.jackson.databind.JsonNode values)
                                                                       throws Exception
        Specified by:
        getJsonQuery in interface QueryTemplate
        Returns:
        the JsonQuery replacing the variables using the provided values
        Throws:
        Exception