Interface QueryTemplate
-
- All Superinterfaces:
Element,EntityElement,IdentifiableElement,Serializable
- All Known Implementing Classes:
QueryTemplateImpl
@TypeMetadata(name="QueryTemplate", description="The type used to store Query Templates", version="1.0.0") @Change(version="1.0.0", description="First Version") public interface QueryTemplate extends EntityElement
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDESCRIPTION_PROPERTYstatic StringNAMEstatic StringNAME_PROPERTYstatic StringTEMPLATE_PROPERTYstatic StringTEMPLATE_VARIABLES_PROPERTY-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, TYPE_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTemplateVariable(TemplateVariable templateVariable)StringgetDescription()org.gcube.com.fasterxml.jackson.databind.JsonNodegetJsonQuery()org.gcube.com.fasterxml.jackson.databind.JsonNodegetJsonQuery(org.gcube.com.fasterxml.jackson.databind.JsonNode values)StringgetName()org.gcube.com.fasterxml.jackson.databind.node.ObjectNodegetParamsFromDefaultValues()Create an ObjectNode which can be used as parameters to obtain a JSON Query from the Query Template.org.gcube.com.fasterxml.jackson.databind.JsonNodegetTemplate()StringgetTemplateAsString()Map<String,TemplateVariable>getTemplateVariables()voidsetDescription(String description)voidsetName(String name)voidsetTemplate(String template)voidsetTemplate(org.gcube.com.fasterxml.jackson.databind.JsonNode template)-
Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
Methods inherited from interface org.gcube.informationsystem.base.reference.entities.EntityElement
getID, getMetadata, setID, setMetadata
-
-
-
-
Field Detail
-
NAME
static final String NAME
- See Also:
- Constant Field Values
-
NAME_PROPERTY
static final String NAME_PROPERTY
- See Also:
- Constant Field Values
-
DESCRIPTION_PROPERTY
static final String DESCRIPTION_PROPERTY
- See Also:
- Constant Field Values
-
TEMPLATE_PROPERTY
static final String TEMPLATE_PROPERTY
- See Also:
- Constant Field Values
-
TEMPLATE_VARIABLES_PROPERTY
static final String TEMPLATE_VARIABLES_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
@ISProperty(name="name", description="The name of the Query Template. Among UUID univocally identifiy the Query Template.", readonly=true, mandatory=true, nullable=false) String getName()
-
setName
void setName(String name)
-
getDescription
@ISProperty(name="description", description="The description of the Query Template.", readonly=false, mandatory=true, nullable=false) String getDescription()
-
setDescription
void setDescription(String description)
-
getTemplateAsString
@ISProperty(name="template", description="The Query Template. It can contains query variables to be replaced to obtain a runnable query.", readonly=false, mandatory=true, nullable=false) String getTemplateAsString() throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
- Throws:
org.gcube.com.fasterxml.jackson.core.JsonProcessingException
-
setTemplate
void setTemplate(String template) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
- Throws:
org.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionIOException
-
setTemplate
void setTemplate(org.gcube.com.fasterxml.jackson.databind.JsonNode template)
-
getTemplate
org.gcube.com.fasterxml.jackson.databind.JsonNode getTemplate()
-
getTemplateVariables
@ISProperty(name="templateVariables", description="The Query Template Variables. It can contains Query Template Variable to be replaced to obtain a runnable query.", readonly=false, mandatory=true, nullable=false) Map<String,TemplateVariable> getTemplateVariables()
-
addTemplateVariable
void addTemplateVariable(TemplateVariable templateVariable)
-
getParamsFromDefaultValues
org.gcube.com.fasterxml.jackson.databind.node.ObjectNode getParamsFromDefaultValues()
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.- Returns:
- the created object node
-
getJsonQuery
org.gcube.com.fasterxml.jackson.databind.JsonNode getJsonQuery() throws Exception- Returns:
- the JsonQuery replacing the variables using the default values contained in TemplateVariables
- Throws:
Exception
-
-