Class ResourceManagement
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement<com.orientechnologies.orient.core.record.OVertex,ET>
-
- org.gcube.informationsystem.resourceregistry.instances.base.entities.EntityElementManagement<E,ET>
-
- org.gcube.informationsystem.resourceregistry.instances.model.entities.EntityManagement<org.gcube.informationsystem.model.reference.entities.Resource,org.gcube.informationsystem.types.reference.entities.ResourceType>
-
- org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement
-
- All Implemented Interfaces:
ERManagement
public class ResourceManagement extends EntityManagement<org.gcube.informationsystem.model.reference.entities.Resource,org.gcube.informationsystem.types.reference.entities.ResourceType>
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
-
Fields inherited from class org.gcube.informationsystem.resourceregistry.instances.model.entities.EntityManagement
forceAddToContext, honourPropagationConstraintsInContextSharing, relationManagements, skipped, sourceSecurityContext, targetSecurityContext
-
Fields inherited from class org.gcube.informationsystem.resourceregistry.instances.base.entities.EntityElementManagement
IN_PREFIX, OUT_PREFIX
-
Fields inherited from class org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement
accessType, affectedInstances, AT, cachedType, complete, DELETED, dryRun, element, elementClass, entryPoint, forceIncludeAllMeta, forceIncludeMeta, ignoreKeys, ignoreStartWithKeys, jsonNode, logger, oClass, oDatabaseDocument, operation, reload, self, typeName, UNDERSCORE, uuid, workingContext
-
-
Constructor Summary
Constructors Constructor Description ResourceManagement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.gcube.com.fasterxml.jackson.databind.JsonNodeaddConsistsOf(org.gcube.com.fasterxml.jackson.databind.JsonNode sourceResource, org.gcube.com.fasterxml.jackson.databind.JsonNode consistsOf)static org.gcube.com.fasterxml.jackson.databind.JsonNodeaddIsRelatedTo(org.gcube.com.fasterxml.jackson.databind.JsonNode sourceResource, org.gcube.com.fasterxml.jackson.databind.JsonNode isRelatedTo)Stringall(boolean polymorphic)protected booleanconstraintSatisfied(TypesCache typesCache, org.gcube.informationsystem.types.reference.properties.LinkedEntity constraint, String consistsOfType, String facetType)org.gcube.com.fasterxml.jackson.databind.JsonNodecreateCompleteJsonNode()protected Set<org.gcube.informationsystem.types.reference.properties.LinkedEntity>getResourceTypeConstraint()protected org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceAlreadyPresentExceptiongetSpecificAlreadyPresentException(String message)org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceAvailableInAnotherContextExceptiongetSpecificAvailableInAnotherContextException(String message)protected org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundExceptiongetSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e)protected voidreallyAddToContext()protected com.orientechnologies.orient.core.record.OVertexreallyCreate()protected voidreallyDelete()protected com.orientechnologies.orient.core.record.OVertexreallyUpdate()voidsanityCheck()The default sanity check is not valid for resources which do not have properties and instead must be validated in terms of facets.voidsetSanityCheckNotRequired()-
Methods inherited from class org.gcube.informationsystem.resourceregistry.instances.model.entities.EntityManagement
addRelation, addToContext, addToRelationManagements, createVertex, getElement, getRelationManagement, getSourceSecurityContext, getTargetSecurityContext, internalAddToContext, internalRemoveFromContext, isHonourPropagationConstraintsInContextSharing, propertyMatchRequestedValue, query, reallyGetAll, reallyQuery, reallyQueryTraversal, reallyRemoveFromContext, removeFromContext, setForceAddToContext, setHonourPropagationConstraintsInContextSharing, setSourceSecurityContext, setTargetSecurityContext
-
Methods inherited from class org.gcube.informationsystem.resourceregistry.instances.base.entities.EntityElementManagement
addToRelationManagement, getBaseRelationManagement
-
Methods inherited from class org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement
checkERMatch, checkJsonNode, checkUUIDMatch, cleanCachedSerialization, create, createOrUpdate, delete, exists, getAccessType, getAffectedInstances, getAllProperties, getCachedType, getContexts, getContextsAsObjectNode, getContextsSet, getMandatoryErrorMessage, getNotNullErrorMessage, getObjectFromJsonNode, getOClass, getPropertyForJson, getPropertyMap, getTypeName, getUUID, getWorkingContext, 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, setWorkingContext, typeSatified, update, updateProperties
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gcube.informationsystem.resourceregistry.instances.model.ERManagement
getAffectedInstances
-
-
-
-
Method Detail
-
setSanityCheckNotRequired
public void setSanityCheckNotRequired()
-
getSpecificNotFoundException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException 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.ResourceType>
-
getSpecificAvailableInAnotherContextException
public org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceAvailableInAnotherContextException getSpecificAvailableInAnotherContextException(String message)
-
getSpecificAlreadyPresentException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceAlreadyPresentException getSpecificAlreadyPresentException(String message)
- Specified by:
getSpecificAlreadyPresentExceptionin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.ResourceType>
-
createCompleteJsonNode
public 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.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
addConsistsOf
public static org.gcube.com.fasterxml.jackson.databind.JsonNode addConsistsOf(org.gcube.com.fasterxml.jackson.databind.JsonNode sourceResource, org.gcube.com.fasterxml.jackson.databind.JsonNode consistsOf) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
addIsRelatedTo
public static org.gcube.com.fasterxml.jackson.databind.JsonNode addIsRelatedTo(org.gcube.com.fasterxml.jackson.databind.JsonNode sourceResource, org.gcube.com.fasterxml.jackson.databind.JsonNode isRelatedTo) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyCreate
protected com.orientechnologies.orient.core.record.OVertex reallyCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
reallyCreatein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceAlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyUpdate
protected com.orientechnologies.orient.core.record.OVertex reallyUpdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
reallyUpdatein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyDelete
protected void reallyDelete() throws org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
reallyDeletein classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
reallyAddToContext
protected void reallyAddToContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Overrides:
reallyAddToContextin classEntityManagement<org.gcube.informationsystem.model.reference.entities.Resource,org.gcube.informationsystem.types.reference.entities.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextExceptionorg.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.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getResourceTypeConstraint
protected Set<org.gcube.informationsystem.types.reference.properties.LinkedEntity> getResourceTypeConstraint() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
constraintSatisfied
protected boolean constraintSatisfied(TypesCache typesCache, org.gcube.informationsystem.types.reference.properties.LinkedEntity constraint, String consistsOfType, String facetType) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaExceptionorg.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.ResourceRegistryExceptionThe default sanity check is not valid for resources which do not have properties and instead must be validated in terms of facets. The Resource Metadata is managed with dedicated code for all instaces.- Overrides:
sanityCheckin classElementManagement<com.orientechnologies.orient.core.record.OVertex,org.gcube.informationsystem.types.reference.entities.ResourceType>- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
-