Class ContextManagement
- 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.contexts.reference.entities.Context,org.gcube.informationsystem.types.reference.entities.EntityType>
-
- org.gcube.informationsystem.resourceregistry.contexts.entities.ContextManagement
-
public class ContextManagement extends EntityElementManagement<org.gcube.informationsystem.contexts.reference.entities.Context,org.gcube.informationsystem.types.reference.entities.EntityType>
- Author:
- Luca Frosini (ISTI - CNR) TODO the result returned to the client should be get from ServerContextCache
-
-
Field Summary
Fields Modifier and Type Field Description protected IntegerforceLimitprotected IntegerforceOffsetprotected Stringname-
Fields inherited from class org.gcube.informationsystem.resourceregistry.base.entities.EntityElementManagement
IN_PREFIX, OUT_PREFIX, relationManagements
-
Fields 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
Constructors Constructor Description ContextManagement()ContextManagement(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringall(boolean polymorphic)StringallFromDatabase(boolean polymorphic)protected voidcheckContext(ContextManagement parentContext)protected voidcheckStateChange(org.gcube.informationsystem.contexts.reference.ContextState newContextstate)protected org.gcube.com.fasterxml.jackson.databind.JsonNodecreateCompleteJsonNode()Map<UUID,org.gcube.com.fasterxml.jackson.databind.JsonNode>getAffectedInstances()StringgetName()protected org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentExceptiongetSpecificAlreadyPresentException(String message)protected org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptiongetSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e)protected EnvironmentgetWorkingEnvironment()protected voidlogFullPath()TODO The full path of the context is added for every non safe action - At creation time - At rename time (see #25139) - At parent change time (see #26544) In this way we are sure to track context fullpath changes.StringreadAsString()StringreadFromServer()protected com.orientechnologies.orient.core.record.OVertexreallyCreate()protected voidreallyDelete()StringreallyGetAll(boolean polymorphic)protected com.orientechnologies.orient.core.record.OVertexreallyUpdate()voidsanityCheck()voidsetForceLimit(Integer forceLimit)voidsetForceOffset(Integer forceOffset)-
Methods inherited from class org.gcube.informationsystem.resourceregistry.base.entities.EntityElementManagement
addRelation, addToRelationManagement, createVertex, getBaseRelationManagement
-
Methods inherited from class org.gcube.informationsystem.resourceregistry.base.ElementManagement
checkERMatch, checkJsonNode, checkUUIDMatch, cleanCachedSerialization, create, createOrUpdate, delete, exists, getAccessType, getAllProperties, getCachedType, getContexts, getContextsAsObjectNode, getContextsSet, getElement, getMandatoryErrorMessage, getNotNullErrorMessage, getOClass, getPropertyForJson, getPropertyMap, getTypeName, getUUID, internalCreate, internalCreateOrUdate, internalDelete, internalUpdate, isDryRun, isForceIncludeAllMeta, isForceIncludeMeta, isReload, isUserAllowedToGetPrivacyMeta, read, retrieveElement, retrieveElementFromAnyContext, serializeAsAffectedInstance, serializeAsJsonNode, serializeSelfAsJsonNode, setAsEntryPoint, setDryRun, setElement, setElementType, setForceIncludeAllMeta, setForceIncludeMeta, setJson, setJsonNode, setOClass, setODatabaseDocument, setOperation, setProperty, setReload, setUUID, setWorkingEnvironment, typeSatified, update, updateProperties
-
-
-
-
Constructor Detail
-
ContextManagement
public ContextManagement()
-
ContextManagement
public ContextManagement(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 Detail
-
setForceOffset
public void setForceOffset(Integer forceOffset)
-
setForceLimit
public void setForceLimit(Integer forceLimit)
-
getAffectedInstances
public Map<UUID,org.gcube.com.fasterxml.jackson.databind.JsonNode> getAffectedInstances()
- Overrides:
getAffectedInstancesin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType>
-
getName
public String 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
-
getSpecificNotFoundException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException 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.contexts.ContextAlreadyPresentException getSpecificAlreadyPresentException(String message)
- Specified by:
getSpecificAlreadyPresentExceptionin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType>
-
checkContext
protected void checkContext(ContextManagement parentContext) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentExceptionorg.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
-
reallyCreate
protected com.orientechnologies.orient.core.record.OVertex reallyCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException, 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.ResourceRegistryException
-
logFullPath
protected void logFullPath()
TODO The full path of the context is added for every non safe action - At creation time - At rename time (see #25139) - At parent change time (see #26544) In this way we are sure to track context fullpath changes. Furthermore when a context is deleted is moved to the cemetery i.e. ShadowContextEnvironment (see #19428) we do not have to do nothing with the fullpath just move the vertex representing the Context in the cemetery
-
checkStateChange
protected void checkStateChange(org.gcube.informationsystem.contexts.reference.ContextState newContextstate)
-
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
-
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
-
allFromDatabase
public String allFromDatabase(boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
all
public String all(boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Overrides:
allin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.EntityType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
readFromServer
public String readFromServer() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
readAsString
public String readAsString() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
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
-
-