public abstract class ElementManagement<El extends com.orientechnologies.orient.core.record.OElement> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.gcube.informationsystem.base.reference.AccessType |
accessType |
String |
AT |
static String |
DELETED |
protected El |
element |
protected Class<El> |
elementClass |
protected String |
elementType |
protected Set<String> |
ignoreKeys |
protected Set<String> |
ignoreStartWithKeys |
protected com.fasterxml.jackson.databind.JsonNode |
jsonNode |
protected org.slf4j.Logger |
logger |
protected com.orientechnologies.orient.core.metadata.schema.OClass |
oClass |
protected com.orientechnologies.orient.core.db.document.ODatabaseDocument |
oDatabaseDocument |
protected boolean |
reload |
String |
UNDERSCORE |
protected UUID |
uuid |
protected SecurityContext |
workingContext |
| Modifier | Constructor and Description |
|---|---|
protected |
ElementManagement(org.gcube.informationsystem.base.reference.AccessType accessType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToContext(UUID contextUUID) |
String |
all(boolean polymorphic) |
protected void |
checkERMatch() |
protected void |
checkJsonNode() |
protected void |
checkUUIDMatch() |
String |
create() |
String |
createOrUpdate() |
boolean |
delete() |
boolean |
exists() |
org.gcube.informationsystem.base.reference.AccessType |
getAccessType() |
static String |
getClassProperty(com.fasterxml.jackson.databind.JsonNode jsonNode) |
El |
getElement() |
static <E extends com.orientechnologies.orient.core.record.OElement> |
getElementFromOptional(Optional<E> optional) |
String |
getElementType() |
static Object |
getObjectFromElement(com.fasterxml.jackson.databind.JsonNode value) |
protected com.orientechnologies.orient.core.metadata.schema.OClass |
getOClass() |
static com.orientechnologies.orient.core.metadata.schema.OClass |
getOClass(com.orientechnologies.orient.core.record.OElement oElement) |
protected com.fasterxml.jackson.databind.JsonNode |
getPropertyForJson(String key,
Object object) |
static Map<String,Object> |
getPropertyMap(com.fasterxml.jackson.databind.JsonNode jsonNode,
Set<String> ignoreKeys,
Set<String> ignoreStartWith) |
protected abstract org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException |
getSpecificElementNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e) |
protected abstract org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException |
getSpecificERAlreadyPresentException(String message) |
protected abstract org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException |
getSpecificERAvailableInAnotherContextException(String message) |
protected Collection<String> |
getSuperclasses() |
UUID |
getUUID() |
protected SecurityContext |
getWorkingContext() |
boolean |
internalAddToContext(SecurityContext targetSecurityContext) |
El |
internalCreate() |
El |
internalCreateOrUdate() |
boolean |
internalDelete() |
boolean |
internalRemoveFromContext(SecurityContext targetSecurityContext) |
El |
internalUpdate() |
boolean |
isReload() |
String |
read() |
protected abstract boolean |
reallyAddToContext(SecurityContext targetSecurityContext) |
protected abstract El |
reallyCreate() |
protected abstract boolean |
reallyDelete() |
abstract String |
reallyGetAll(boolean polymorphic) |
protected abstract boolean |
reallyRemoveFromContext(SecurityContext targetSecurityContext) |
protected abstract El |
reallyUpdate() |
boolean |
removeFromContext(UUID contextUUID) |
El |
retrieveElement() |
El |
retrieveElementFromAnyContext() |
abstract String |
serialize() |
abstract com.fasterxml.jackson.databind.JsonNode |
serializeAsJson() |
com.fasterxml.jackson.databind.JsonNode |
serializeSelfOnly() |
void |
setElement(El element) |
void |
setElementType(String elementType) |
void |
setJson(String jsonRepresentation) |
void |
setJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode) |
void |
setOClass(com.orientechnologies.orient.core.metadata.schema.OClass oClass) |
void |
setReload(boolean reload) |
void |
setUUID(UUID uuid) |
void |
setWorkingContext(SecurityContext workingContext) |
com.fasterxml.jackson.databind.JsonNode |
toJsonNode() |
String |
update() |
static com.orientechnologies.orient.core.record.OElement |
updateProperties(com.orientechnologies.orient.core.metadata.schema.OClass oClass,
com.orientechnologies.orient.core.record.OElement element,
com.fasterxml.jackson.databind.JsonNode jsonNode,
Set<String> ignoreKeys,
Set<String> ignoreStartWithKeys) |
protected org.slf4j.Logger logger
public final String AT
public final String UNDERSCORE
public static final String DELETED
protected Class<El extends com.orientechnologies.orient.core.record.OElement> elementClass
protected final org.gcube.informationsystem.base.reference.AccessType accessType
protected com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument
protected UUID uuid
protected com.fasterxml.jackson.databind.JsonNode jsonNode
protected com.orientechnologies.orient.core.metadata.schema.OClass oClass
protected String elementType
protected El extends com.orientechnologies.orient.core.record.OElement element
protected boolean reload
protected SecurityContext workingContext
protected ElementManagement(org.gcube.informationsystem.base.reference.AccessType accessType)
public UUID getUUID()
public boolean isReload()
public void setReload(boolean reload)
public org.gcube.informationsystem.base.reference.AccessType getAccessType()
protected SecurityContext getWorkingContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic void setWorkingContext(SecurityContext workingContext)
public void setUUID(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic void setJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode)
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic void setJson(String jsonRepresentation) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic static <E extends com.orientechnologies.orient.core.record.OElement> E getElementFromOptional(Optional<E> optional) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic static com.orientechnologies.orient.core.metadata.schema.OClass getOClass(com.orientechnologies.orient.core.record.OElement oElement)
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic void setOClass(com.orientechnologies.orient.core.metadata.schema.OClass oClass)
protected com.orientechnologies.orient.core.metadata.schema.OClass getOClass()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException,
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic void setElementType(String elementType) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic String getElementType()
protected void checkJsonNode()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected void checkERMatch()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected void checkUUIDMatch()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic com.fasterxml.jackson.databind.JsonNode serializeSelfOnly()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic abstract String serialize() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic abstract com.fasterxml.jackson.databind.JsonNode serializeAsJson()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected abstract El reallyCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic El internalCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected abstract El reallyUpdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic El internalUpdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic El internalCreateOrUdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected abstract boolean reallyDelete()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean internalDelete()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected abstract boolean reallyAddToContext(SecurityContext targetSecurityContext) throws org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean internalAddToContext(SecurityContext targetSecurityContext) throws org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected abstract boolean reallyRemoveFromContext(SecurityContext targetSecurityContext) throws org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean internalRemoveFromContext(SecurityContext targetSecurityContext) throws org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic void setElement(El element) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected abstract org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException getSpecificElementNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e)
protected abstract org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException getSpecificERAvailableInAnotherContextException(String message)
protected abstract org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException getSpecificERAlreadyPresentException(String message)
public El getElement() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic El retrieveElement() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic El retrieveElementFromAnyContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic abstract String reallyGetAll(boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic String all(boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean exists()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException,
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic String createOrUpdate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic String create() throws org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic String read() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic String update() throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean delete()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException,
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean addToContext(UUID contextUUID) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic boolean removeFromContext(UUID contextUUID) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic static String getClassProperty(com.fasterxml.jackson.databind.JsonNode jsonNode)
public static Object getObjectFromElement(com.fasterxml.jackson.databind.JsonNode value) throws UnsupportedDataTypeException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
UnsupportedDataTypeExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic static Map<String,Object> getPropertyMap(com.fasterxml.jackson.databind.JsonNode jsonNode, Set<String> ignoreKeys, Set<String> ignoreStartWith) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
com.fasterxml.jackson.core.JsonProcessingExceptionIOExceptionpublic static com.orientechnologies.orient.core.record.OElement updateProperties(com.orientechnologies.orient.core.metadata.schema.OClass oClass,
com.orientechnologies.orient.core.record.OElement element,
com.fasterxml.jackson.databind.JsonNode jsonNode,
Set<String> ignoreKeys,
Set<String> ignoreStartWithKeys)
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected com.fasterxml.jackson.databind.JsonNode getPropertyForJson(String key, Object object) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionprotected Collection<String> getSuperclasses() throws org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionpublic com.fasterxml.jackson.databind.JsonNode toJsonNode()
throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionCopyright © 2020. All Rights Reserved.