Class QueryTemplateManagement
java.lang.Object
org.gcube.informationsystem.resourceregistry.base.ElementManagement<com.orientechnologies.orient.core.record.OVertex,ET>
org.gcube.informationsystem.resourceregistry.base.entities.EntityElementManagement<org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate,org.gcube.informationsystem.types.reference.entities.EntityType>
org.gcube.informationsystem.resourceregistry.queries.templates.QueryTemplateManagement
public class QueryTemplateManagement
extends EntityElementManagement<org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate,org.gcube.informationsystem.types.reference.entities.EntityType>
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected org.gcube.com.fasterxml.jackson.databind.JsonNodeFields inherited from class org.gcube.informationsystem.resourceregistry.base.entities.EntityElementManagement
IN_PREFIX, OUT_PREFIX, relationManagementsFields inherited from class org.gcube.informationsystem.resourceregistry.base.ElementManagement
accessType, affectedInstances, AT, cachedType, complete, DELETED, DOLLAR, dryRun, element, elementClass, entryPoint, forceIncludeAllMeta, forceIncludeMeta, ignoreKeys, ignoreStartWithKeys, jsonNode, oClass, oDatabaseDocument, operation, reload, self, typeName, UNDERSCORE, uuid, workingEnvironment -
Constructor Summary
ConstructorsConstructorDescriptionQueryTemplateManagement(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprotected voidprotected org.gcube.com.fasterxml.jackson.databind.JsonNodegetName()protected StringBufferprotected org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentExceptiongetSpecificAlreadyPresentException(String message) protected org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptiongetSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e) protected Environmentprotected com.orientechnologies.orient.core.record.OVertexprotected voidreallyGetAll(boolean polymorphic) protected com.orientechnologies.orient.core.record.OVertexcom.orientechnologies.orient.core.record.OVertexrun()Run the query after having replaced query parameter with the provided valuesvoidvoidvoidvoidsetParams(org.gcube.com.fasterxml.jackson.databind.JsonNode params) protected voidMethods inherited from class org.gcube.informationsystem.resourceregistry.base.entities.EntityElementManagement
addRelation, addToRelationManagement, createVertex, getBaseRelationManagementMethods inherited from class org.gcube.informationsystem.resourceregistry.base.ElementManagement
all, checkUUIDMatch, cleanCachedSerialization, create, delete, exists, getAccessType, getAffectedInstances, getAllProperties, getCachedType, getContexts, getContextsAsObjectNode, getContextsSet, getElement, getMandatoryErrorMessage, getNotNullErrorMessage, getOClass, getPropertyForJson, getPropertyMap, getTypeName, getUUID, internalCreate, internalCreateOrUdate, internalDelete, internalUpdate, isDryRun, isForceIncludeAllMeta, isForceIncludeMeta, isReload, isUserAllowedToGetPrivacyMeta, read, retrieveElementFromAnyContext, serializeAsAffectedInstance, serializeAsJsonNode, serializeSelfAsJsonNode, setAsEntryPoint, setDryRun, setElement, setElementType, setForceIncludeAllMeta, setForceIncludeMeta, setJson, setJsonNode, setOClass, setODatabaseDocument, setOperation, setProperty, setReload, setUUID, setWorkingEnvironment, typeSatified, update, updateProperties
-
Field Details
-
name
-
params
protected org.gcube.com.fasterxml.jackson.databind.JsonNode params
-
-
Constructor Details
-
QueryTemplateManagement
public QueryTemplateManagement() -
QueryTemplateManagement
public QueryTemplateManagement(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
-
Method Details
-
checkERMatch
protected void checkERMatch() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Overrides:
checkERMatchin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
checkNameMatch
protected void checkNameMatch() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
setName
public void setName(String name) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
checkJsonNode
protected void checkJsonNode() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Overrides:
checkJsonNodein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getName
-
getWorkingEnvironment
protected Environment getWorkingEnvironment() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
getWorkingEnvironmentin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
createCompleteJsonNode
protected org.gcube.com.fasterxml.jackson.databind.JsonNode createCompleteJsonNode() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
createCompleteJsonNodein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getSelectQuery
-
checkIfNameAlreadyExists
protected void checkIfNameAlreadyExists() throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateAlreadyPresentException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateAlreadyPresentException
-
tryTemplate
- Throws:
Exception
-
retrieveElement
public com.orientechnologies.orient.core.record.OVertex retrieveElement() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Overrides:
retrieveElementin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
createOrUpdate
public String createOrUpdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Overrides:
createOrUpdatein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyCreate
protected com.orientechnologies.orient.core.record.OVertex reallyCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
reallyCreatein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyUpdate
protected com.orientechnologies.orient.core.record.OVertex reallyUpdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
reallyUpdatein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyDelete
protected void reallyDelete() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
reallyDeletein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getSpecificNotFoundException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException getSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e) - Specified by:
getSpecificNotFoundExceptionin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType>
-
getSpecificAlreadyPresentException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException getSpecificAlreadyPresentException(String message) - Specified by:
getSpecificAlreadyPresentExceptionin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType>
-
reallyGetAll
public String reallyGetAll(boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - Specified by:
reallyGetAllin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
setParams
public void setParams(String params) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
setParams
public void setParams(org.gcube.com.fasterxml.jackson.databind.JsonNode params) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
run
public String run() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionRun the query after having replaced query parameter with the provided values- Returns:
- the result as JSON string
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if an error occurs during query execution
-
sanityCheck
public void sanityCheck() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Overrides:
sanityCheckin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-