Reorganized model as following

Element
 - EntityElement
   - Entity
     - Resource
     - Facet
   - Context
   - EntityType
     - ResourceType (3 lists of PropertyDefinition, LinkedFacet,
LinkedResource)
     - FacetType (1 list of PropertyDefinition)
 - RelationElement
   - Relation
     - IsRelatedTo
     - ConsistsOf
   - IsParentOf
   - RelationType
     - IsRelatedTo (1 list of PropertyDefinition)
     - ConsistsOf (1 list of PropertyDefinition)
 - PropertyElement
   - Property
     - Header
     - PropagationConstraint
     - Encrypted
   - PropertyType (1 list of PropertyDefinition)
     - PropertyDefinition
     - LinkedEntity
       - LinkedFacet
       - LinkedResource
This commit is contained in:
Luca Frosini 2020-01-30 11:04:25 +01:00
parent 3b9da964d7
commit 81785941f2
3 changed files with 10 additions and 10 deletions

View File

@ -3,14 +3,14 @@
*/
package org.gcube.informationsystem.resourceregistry.api.exceptions;
import org.gcube.informationsystem.base.reference.ISManageable;
import org.gcube.informationsystem.base.reference.Element;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
/**
* @author Luca Frosini (ISTI - CNR)
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = ISManageable.CLASS_PROPERTY)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = Element.CLASS_PROPERTY)
public class ResourceRegistryException extends Exception {
/**

View File

@ -7,7 +7,7 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import org.gcube.common.gxhttp.reference.GXConnection.HTTPMETHOD;
import org.gcube.informationsystem.base.reference.ISManageable;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.relations.Relation;
@ -111,8 +111,8 @@ public class HTTPUtility {
if(Boolean.class.isAssignableFrom(clz)) {
return (C) ((Boolean) Boolean.valueOf(res));
} else if(ISManageable.class.isAssignableFrom(clz)) {
return (C) ISMapper.unmarshal((Class<ISManageable>) clz, res);
} else if(Element.class.isAssignableFrom(clz)) {
return (C) ISMapper.unmarshal((Class<Element>) clz, res);
}
return (C) res;

View File

@ -4,7 +4,7 @@ import java.io.IOException;
import java.util.UUID;
import org.gcube.informationsystem.base.reference.ER;
import org.gcube.informationsystem.base.reference.ISManageable;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.types.TypeBinder;
import org.gcube.informationsystem.utils.ISMapper;
@ -15,7 +15,7 @@ import com.fasterxml.jackson.databind.JsonNode;
public abstract class Utility {
public static String getClassFromJsonNode(JsonNode jsonNode){
return jsonNode.get(ISManageable.CLASS_PROPERTY).asText();
return jsonNode.get(Element.CLASS_PROPERTY).asText();
}
public static String getClassFromJsonString(String json) throws JsonProcessingException, IOException{
@ -24,7 +24,7 @@ public abstract class Utility {
}
public static String getUUIDStringFromJsonNode(JsonNode jsonNode){
return jsonNode.get(ER.HEADER_PROPERTY).get(ISManageable.CLASS_PROPERTY).asText();
return jsonNode.get(ER.HEADER_PROPERTY).get(Element.CLASS_PROPERTY).asText();
}
public static UUID getUUIDFromJsonNode(JsonNode jsonNode){
String uuidString = getUUIDStringFromJsonNode(jsonNode);
@ -41,11 +41,11 @@ public abstract class Utility {
return getUUIDFromJsonNode(jsonNode);
}
public static String getType(ISManageable isManageable){
public static String getType(Element isManageable){
return getType(isManageable.getClass());
}
public static String getType(Class<? extends ISManageable> clz){
public static String getType(Class<? extends Element> clz){
if(!clz.isInterface()){
return clz.getAnnotation(JsonTypeName.class).value();
}else {