Class ConsistsOfManagement
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<SET,TET>>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement<ResourceManagement,T,org.gcube.informationsystem.types.reference.entities.ResourceSchema,TET>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.instances.relations.RelationManagement<FacetManagement,org.gcube.informationsystem.types.reference.entities.FacetSchema>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.instances.relations.ConsistsOfManagement
- All Implemented Interfaces:
ERManagement
public class ConsistsOfManagement
extends RelationManagement<FacetManagement,org.gcube.informationsystem.types.reference.entities.FacetSchema>
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.gcube.informationsystem.model.reference.properties.PropagationConstraintThe default propagation constraint for ConsistsOf relations.Fields inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.instances.relations.RelationManagement
activeOnlyHierarchical, addedToContext, contextsPolicy, defaultPropagationConstraint, forceAddToContext, hierarchical, orphanCandidates, propagationConstraint, propagationMode, removalFromTarget, skipped, sourceInstanceEnvironment, targetInstanceEnvironment, visitedFields inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement
IN, includeSource, includeTarget, OUT, sourceEntityClass, sourceEntityManagement, targetEntityClass, targetEntityManagementFields inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement
accessType, affectedInstances, AT, cachedType, complete, DELETED, DOLLAR, dryRun, element, elementClass, entryPoint, ignoredFields, ignoreKeys, ignoreStartWithKeys, jsonNode, limit, logger, maskMetadata, metadataPolicy, oClass, oDatabaseDocument, offset, operation, polymorphic, preservePassedMetadata, reload, sanityCheckDeferred, self, typeName, UNDERSCORE, updateMode, uuid, workingEnvironment -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newConsistsOfManagementinstance with default propagation constraints. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThe modification of a ConsistsOf is a modification of its source Resource.protected voidValidates the topological sanity constraints of the associated resource.protected org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.consistsof.ConsistsOfAlreadyPresentExceptiongetSpecificAlreadyPresentException(String message) Converts a generic AlreadyPresentException into a subclass-specific AlreadyPresentException.org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.consistsof.ConsistsOfAvailableInAnotherContextExceptionReturns the subclass-specific AvailableInAnotherContextException instance.protected org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.consistsof.ConsistsOfNotFoundExceptiongetSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e) Converts a generic NotFoundException into a subclass-specific NotFoundException.protected FacetManagementCreates a new management instance for the target entity of the relation (subclass hook).protected com.orientechnologies.orient.core.record.OEdgePersists a new element in the database (subclass hook).voidPerforms runtime validation of mandatory and not-null schema constraints that cannot be enforced directly by OrientDB in distributed mode.protected voidwriteTarget(org.gcube.com.fasterxml.jackson.databind.JsonNode target) The target of a ConsistsOf being created is always a new Facet, created with it: a Facet already has its own ConsistsOf and cannot have another one, so a target whose UUID is already in use is a conflict, whether it is a reference or a complete representation.Methods inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.instances.relations.RelationManagement
addToContext, checkPropagationConstraint, checksourceAndTargetEntityCompliancy, forcedAddToContext, fullSerialize, getContexts, getContextsAsObjectNode, getContextsPolicy, getContextsSet, getElement, getEntityTypeNotValidErrroMessage, getMembershipView, getOrphanCandidates, getPropagationConstraint, getPropagationMode, getSourceInstanceEnvironment, getTargetInstanceEnvironment, getVisited, getWorkingEnvironment, giveMeSourceEntityManagementAsIs, internalAddToContext, internalDelete, internalRemoveFromContext, isActiveOnlyHierarchical, isAddedToContext, isAvailableOnContext, isForceAddToContext, isHierarchical, newSourceEntityManagement, reallyAddToContext, reallyGetAll, reallyRemoveFromContext, reallyUpdate, removeFromContext, serializeAsAffectedInstance, serializeJsonNodeCollectionAsString, setActiveOnlyHierarchical, setContextsPolicy, setForceAddToContext, setHierarchical, setMembershipView, setOrphanCandidates, setPropagationMode, setRemovalFromTarget, setSourceInstanceEnvironment, setTargetInstanceEnvironment, setVisitedMethods inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement
carriesContent, createCompleteJsonNode, getSourceEntityManagement, getSubmittedEndpoint, getSubmittedSourceReference, getTargetEntityManagement, includeSource, includeTarget, reallyDelete, setSourceEntityManagement, setTargetEntityManagementMethods inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement
addIgnoredFields, all, applyPrivacyMask, applyPrivacyMask, checkERMatch, checkJsonNode, checkUUIDMatch, checkUUIDNotAlreadyInUse, cleanCachedSerialization, concludeTransaction, create, createOrUpdate, createOrUpdateElementWithResult, delete, exists, getAccessType, getAffectedInstances, getAllProperties, getCachedType, getCurrentODatabaseDocumentFromThreadLocal, getIgnoredFields, getLimit, getMandatoryErrorMessage, getMandatoryErrorMessage, getMetadataPolicy, getOClass, getOffset, getPropertyForJson, getPropertyMap, getTypeName, getUpdateMode, getUUID, internalCreate, internalCreateOrUdate, internalUpdate, isBackendLinkFieldName, isDryRun, isMaskMetadata, isPolymorphic, isPreservePassedMetadata, isReload, isSanityCheckDeferred, read, recordModification, requireExplicitUUID, retrieveElement, retrieveElementFromAnyContext, serializeAsEndpointReference, serializeAsJsonNode, serializeSelfAsJsonNode, setAsEntryPoint, setDryRun, setElement, setElementType, setIgnoredFields, setJson, setJsonNode, setLimit, setMaskMetadata, setMetadataPolicy, setOClass, setODatabaseDocument, setOffset, setOperation, setPolymorphic, setPreservePassedMetadata, setProperty, setReload, setRequireExplicitUUID, setSanityCheckDeferred, setUpdateMode, setUUID, setWorkingEnvironment, typeSatified, update, updatePropertiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gcube.informationsystem.resourceregistry.persistence.ERManagement
getAffectedInstances
-
Field Details
-
DEFAULT_CONSISTS_OF_PC
public static final org.gcube.informationsystem.model.reference.properties.PropagationConstraint DEFAULT_CONSISTS_OF_PCThe default propagation constraint for ConsistsOf relations.
-
-
Constructor Details
-
ConsistsOfManagement
public ConsistsOfManagement()Creates a newConsistsOfManagementinstance with default propagation constraints.
-
-
Method Details
-
getSpecificNotFoundException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.consistsof.ConsistsOfNotFoundException getSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e) Description copied from class:ElementManagementConverts a generic NotFoundException into a subclass-specific NotFoundException.- Specified by:
getSpecificNotFoundExceptionin classElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.FacetSchema>> - Parameters:
e- the generic exception- Returns:
- the specific NotFoundException
-
getSpecificAvailableInAnotherContextException
public org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.consistsof.ConsistsOfAvailableInAnotherContextException getSpecificAvailableInAnotherContextException(String message) Description copied from interface:ERManagementReturns the subclass-specific AvailableInAnotherContextException instance.- Parameters:
message- the exception message- Returns:
- the specific AvailableInAnotherContextException
-
getSpecificAlreadyPresentException
protected org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.consistsof.ConsistsOfAlreadyPresentException getSpecificAlreadyPresentException(String message) Description copied from class:ElementManagementConverts a generic AlreadyPresentException into a subclass-specific AlreadyPresentException.- Specified by:
getSpecificAlreadyPresentExceptionin classElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.FacetSchema>> - Parameters:
message- the exception message- Returns:
- the specific AlreadyPresentException
-
newTargetEntityManagement
protected FacetManagement newTargetEntityManagement() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionDescription copied from class:RelationElementManagementCreates a new management instance for the target entity of the relation (subclass hook).- Specified by:
newTargetEntityManagementin classRelationElementManagement<ResourceManagement,FacetManagement, org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.FacetSchema> - Returns:
- the target entity management instance
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database or lookup error
-
writeTarget
protected void writeTarget(org.gcube.com.fasterxml.jackson.databind.JsonNode target) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException The target of a ConsistsOf being created is always a new Facet, created with it: a Facet already has its own ConsistsOf and cannot have another one, so a target whose UUID is already in use is a conflict, whether it is a reference or a complete representation.- Overrides:
writeTargetin classRelationElementManagement<ResourceManagement,FacetManagement, org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.FacetSchema> - Parameters:
target- the submitted target- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the target cannot be resolved or written
-
reallyCreate
protected com.orientechnologies.orient.core.record.OEdge reallyCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionDescription copied from class:ElementManagementPersists a new element in the database (subclass hook).- Overrides:
reallyCreatein classRelationManagement<FacetManagement,org.gcube.informationsystem.types.reference.entities.FacetSchema> - Returns:
- the persisted OrientDB vertex
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException- if the element already exists in the databaseorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on any database error
-
afterModification
protected void afterModification() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionThe modification of a ConsistsOf is a modification of its source Resource.- Overrides:
afterModificationin classElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.FacetSchema>> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the modification cannot be recorded
-
checkResource
protected void checkResource() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionValidates the topological sanity constraints of the associated resource.- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException- if topological validation failsorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database lookup failure
-
sanityCheck
public void sanityCheck() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionDescription copied from class:ElementManagementPerforms runtime validation of mandatory and not-null schema constraints that cannot be enforced directly by OrientDB in distributed mode.- Overrides:
sanityCheckin classElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.FacetSchema>> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException- if a schema constraint is violatedorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database lookup failure
-