From c29c5c9bcacee5a77970fcd1f1beb63d0f84751f Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Mon, 23 Jan 2017 16:41:11 +0000 Subject: [PATCH] Import changes due to refactor in is-model git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@141708 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../dbinitialization/SchemaActionImpl.java | 2 +- .../resourceregistry/er/AccessType.java | 63 ------------------- .../resourceregistry/er/ERManagement.java | 10 +-- .../er/EmbeddedMangement.java | 4 +- .../er/entity/ResourceManagement.java | 2 +- .../resourceregistry/rest/SchemaManager.java | 2 +- .../schema/SchemaManagement.java | 2 +- .../schema/SchemaManagementImpl.java | 2 +- .../er/SmartgearResourcesTest.java | 27 -------- 9 files changed, 13 insertions(+), 101 deletions(-) delete mode 100644 src/main/java/org/gcube/informationsystem/resourceregistry/er/AccessType.java diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/dbinitialization/SchemaActionImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/dbinitialization/SchemaActionImpl.java index 319c551..5ddb148 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/dbinitialization/SchemaActionImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/dbinitialization/SchemaActionImpl.java @@ -4,6 +4,7 @@ package org.gcube.informationsystem.resourceregistry.dbinitialization; import org.gcube.informationsystem.impl.utils.discovery.SchemaAction; +import org.gcube.informationsystem.model.AccessType; import org.gcube.informationsystem.model.embedded.Embedded; import org.gcube.informationsystem.model.entity.Entity; import org.gcube.informationsystem.model.entity.Facet; @@ -11,7 +12,6 @@ import org.gcube.informationsystem.model.entity.Resource; import org.gcube.informationsystem.model.relation.ConsistsOf; import org.gcube.informationsystem.model.relation.IsRelatedTo; import org.gcube.informationsystem.model.relation.Relation; -import org.gcube.informationsystem.resourceregistry.er.AccessType; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl; import org.gcube.informationsystem.types.TypeBinder; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/er/AccessType.java b/src/main/java/org/gcube/informationsystem/resourceregistry/er/AccessType.java deleted file mode 100644 index 03058d1..0000000 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/er/AccessType.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * - */ -package org.gcube.informationsystem.resourceregistry.er; - -import org.gcube.informationsystem.model.embedded.Embedded; -import org.gcube.informationsystem.model.entity.Context; -import org.gcube.informationsystem.model.entity.Entity; -import org.gcube.informationsystem.model.entity.Facet; -import org.gcube.informationsystem.model.entity.Resource; -import org.gcube.informationsystem.model.relation.ConsistsOf; -import org.gcube.informationsystem.model.relation.IsParentOf; -import org.gcube.informationsystem.model.relation.IsRelatedTo; -import org.gcube.informationsystem.model.relation.Relation; - -/** - * @author Luca Frosini (ISTI - CNR) - * - * Enumerates the basic type names. - */ -public enum AccessType { - - EMBEDDED(Embedded.class, Embedded.NAME), - CONTEXT(Context.class, Context.NAME), - IS_PARENT_OF(IsParentOf.class, IsParentOf.NAME), - - ENTITY(Entity.class, Entity.NAME), - RESOURCE(Resource.class, Resource.NAME), - FACET(Facet.class, Facet.NAME), - - RELATION(Relation.class, Relation.NAME), - IS_RELATED_TO(IsRelatedTo.class, IsRelatedTo.NAME), - CONSISTS_OF(ConsistsOf.class, ConsistsOf.NAME); - - - private final Class clz; - private final String name; - private final String lowerCaseFirstCharacter; - - AccessType(Class clz, String name){ - this.clz = clz; - this.name = name; - this.lowerCaseFirstCharacter = name.substring(0, 1).toLowerCase() + name.substring(1); - } - - public String lowerCaseFirstCharacter() { - return lowerCaseFirstCharacter; - } - - public Class getTypeClass(){ - return clz; - } - - public String getName(){ - return name; - } - - @Override - public String toString(){ - return name; - } - -} diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java index ef60b6c..002da26 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java @@ -19,7 +19,9 @@ import java.util.UUID; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONObject; +import org.gcube.informationsystem.model.AccessType; import org.gcube.informationsystem.model.ER; +import org.gcube.informationsystem.model.ISManageable; import org.gcube.informationsystem.model.embedded.Header; import org.gcube.informationsystem.model.entity.Entity; import org.gcube.informationsystem.model.entity.Facet; @@ -536,8 +538,8 @@ public abstract class ERManagement { } public static String getClassProperty(JsonNode jsonNode) { - if (jsonNode.has(ER.CLASS_PROPERTY)) { - return jsonNode.get(ER.CLASS_PROPERTY).asText(); + if (jsonNode.has(ISManageable.CLASS_PROPERTY)) { + return jsonNode.get(ISManageable.CLASS_PROPERTY).asText(); } return null; } @@ -768,7 +770,7 @@ public abstract class ERManagement { JSONObject jsonObject = new JSONObject(properties); - jsonObject.put(ER.CLASS_PROPERTY, type); + jsonObject.put(ISManageable.CLASS_PROPERTY, type); @@ -787,7 +789,7 @@ public abstract class ERManagement { } JSONArray jsonArray = new JSONArray(superClasses); - jsonObject.put(ER.SUPERCLASSES_PROPERTY, jsonArray); + jsonObject.put(ISManageable.SUPERCLASSES_PROPERTY, jsonArray); return jsonObject; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/er/EmbeddedMangement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/er/EmbeddedMangement.java index 4d25825..04c2a88 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/er/EmbeddedMangement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/er/EmbeddedMangement.java @@ -6,7 +6,7 @@ package org.gcube.informationsystem.resourceregistry.er; import java.util.HashSet; import java.util.Set; -import org.gcube.informationsystem.model.ER; +import org.gcube.informationsystem.model.ISManageable; import org.gcube.informationsystem.model.embedded.Embedded; import org.gcube.informationsystem.model.embedded.Header; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; @@ -45,7 +45,7 @@ public class EmbeddedMangement { public static ODocument getEmbeddedType(JsonNode jsonNode) throws ResourceRegistryException { - if (jsonNode.has(ER.CLASS_PROPERTY)) { + if (jsonNode.has(ISManageable.CLASS_PROPERTY)) { // Complex type String type = ERManagement.getClassProperty(jsonNode); diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/er/entity/ResourceManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/er/entity/ResourceManagement.java index 800102f..6e64341 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/er/entity/ResourceManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/er/entity/ResourceManagement.java @@ -7,13 +7,13 @@ import java.util.Iterator; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONObject; +import org.gcube.informationsystem.model.AccessType; import org.gcube.informationsystem.model.entity.Resource; import org.gcube.informationsystem.model.relation.ConsistsOf; import org.gcube.informationsystem.model.relation.IsRelatedTo; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; -import org.gcube.informationsystem.resourceregistry.er.AccessType; import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement; import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement; import org.gcube.informationsystem.resourceregistry.er.relation.RelationManagement; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SchemaManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SchemaManager.java index 68e2a2a..3028fc2 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SchemaManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SchemaManager.java @@ -8,10 +8,10 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import org.gcube.informationsystem.model.AccessType; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException; import org.gcube.informationsystem.resourceregistry.api.rest.SchemaPath; -import org.gcube.informationsystem.resourceregistry.er.AccessType; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl; import org.slf4j.Logger; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagement.java index 0239b78..417e716 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagement.java @@ -1,8 +1,8 @@ package org.gcube.informationsystem.resourceregistry.schema; +import org.gcube.informationsystem.model.AccessType; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; -import org.gcube.informationsystem.resourceregistry.er.AccessType; /** * @author Luca Frosini (ISTI - CNR) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagementImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagementImpl.java index 339f161..6636031 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagementImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/schema/SchemaManagementImpl.java @@ -8,6 +8,7 @@ import java.util.Collection; import java.util.List; import java.util.Set; +import org.gcube.informationsystem.model.AccessType; import org.gcube.informationsystem.model.embedded.Embedded; import org.gcube.informationsystem.model.entity.Entity; import org.gcube.informationsystem.model.entity.Resource; @@ -17,7 +18,6 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper; import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode; -import org.gcube.informationsystem.resourceregistry.er.AccessType; import org.gcube.informationsystem.types.TypeBinder; import org.gcube.informationsystem.types.TypeBinder.Property; import org.gcube.informationsystem.types.TypeBinder.TypeDefinition; diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java index 8ef9ebf..8541399 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java @@ -77,33 +77,6 @@ public class SmartgearResourcesTest extends ScopedTest { public static final String HOSTING_NODE = "{\"@class\":\"HostingNode\",\"header\":{\"@class\":\"Header\",\"uuid\":\"f0460614-9ffb-4ecd-bf52-d91e8d81d604\",\"creator\":null,\"creationTime\":null,\"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"NetworkingFacet\",\"header\":null,\"hostName\":\"pc-frosini.isti.cnr.it\",\"domainName\":\"isti.cnr.it\",\"mask\":null,\"broadcastAddress\":null,\"ipaddress\":\"127.0.1.1\",\"Port\":8080}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"CPUFacet\",\"header\":null,\"model\":\"Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz\",\"vendor\":\"GenuineIntel\",\"clockSpeed\":\"2872.828\",\"cache_size\":\"6144 KB\",\"flags\":\"fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts\",\"bogomips\":\"6199.91\",\"fpu\":\"yes\",\"stepping\":\"9\",\"address_sizes\":\"36 bits physical, 48 bits virtual\",\"wp\":\"yes\",\"clflush_size\":\"64\",\"siblings\":\"4\",\"microcode\":\"0x17\",\"cpu_family\":\"6\",\"cpu_cores\":\"4\",\"physical_id\":\"0\",\"cpuid_level\":\"13\",\"fpu_exception\":\"yes\",\"apicid\":\"0\",\"cache_alignment\":\"64\",\"processor\":\"0\",\"core_id\":\"0\",\"initial_apicid\":\"0\",\"modelNumber\":\"58\"}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"CPUFacet\",\"header\":null,\"model\":\"Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz\",\"vendor\":\"GenuineIntel\",\"clockSpeed\":\"2617.199\",\"cache_size\":\"6144 KB\",\"flags\":\"fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts\",\"bogomips\":\"6199.91\",\"fpu\":\"yes\",\"stepping\":\"9\",\"address_sizes\":\"36 bits physical, 48 bits virtual\",\"wp\":\"yes\",\"clflush_size\":\"64\",\"siblings\":\"4\",\"microcode\":\"0x17\",\"cpu_family\":\"6\",\"cpu_cores\":\"4\",\"physical_id\":\"0\",\"cpuid_level\":\"13\",\"fpu_exception\":\"yes\",\"apicid\":\"2\",\"cache_alignment\":\"64\",\"processor\":\"1\",\"core_id\":\"1\",\"initial_apicid\":\"2\",\"modelNumber\":\"58\"}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"CPUFacet\",\"header\":null,\"model\":\"Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz\",\"vendor\":\"GenuineIntel\",\"clockSpeed\":\"2610.660\",\"cache_size\":\"6144 KB\",\"flags\":\"fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts\",\"bogomips\":\"6199.91\",\"fpu\":\"yes\",\"stepping\":\"9\",\"address_sizes\":\"36 bits physical, 48 bits virtual\",\"wp\":\"yes\",\"clflush_size\":\"64\",\"siblings\":\"4\",\"microcode\":\"0x17\",\"cpu_family\":\"6\",\"cpu_cores\":\"4\",\"physical_id\":\"0\",\"cpuid_level\":\"13\",\"fpu_exception\":\"yes\",\"apicid\":\"4\",\"cache_alignment\":\"64\",\"processor\":\"2\",\"core_id\":\"2\",\"initial_apicid\":\"4\",\"modelNumber\":\"58\"}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"CPUFacet\",\"header\":null,\"model\":\"Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz\",\"vendor\":\"GenuineIntel\",\"clockSpeed\":\"2712.257\",\"cache_size\":\"6144 KB\",\"flags\":\"fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts\",\"bogomips\":\"6199.91\",\"fpu\":\"yes\",\"stepping\":\"9\",\"address_sizes\":\"36 bits physical, 48 bits virtual\",\"wp\":\"yes\",\"clflush_size\":\"64\",\"siblings\":\"4\",\"microcode\":\"0x17\",\"cpu_family\":\"6\",\"cpu_cores\":\"4\",\"physical_id\":\"0\",\"cpuid_level\":\"13\",\"fpu_exception\":\"yes\",\"apicid\":\"6\",\"cache_alignment\":\"64\",\"processor\":\"3\",\"core_id\":\"3\",\"initial_apicid\":\"6\",\"modelNumber\":\"58\"}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"SoftwareFacet\",\"header\":null,\"name\":\"amd64\",\"group\":\"Linux\",\"version\":\"4.4.0-47-generic\",\"description\":null,\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"SimplePropertyFacet\",\"header\":null,\"name\":\"ENVIRONMENT_VARIABLES\",\"value\":\"\",\"TERM\":\"xterm\",\"XDG_SESSION_PATH\":\"/org/freedesktop/DisplayManager/Session0\",\"JAVA_HOME\":\"/usr/lib/jvm/java-7-oracle\",\"J2REDIR\":\"/usr/lib/jvm/java-7-oracle/jre\",\"LESSCLOSE\":\"/usr/bin/lesspipe %s %s\",\"UPSTART_SESSION\":\"unix:abstract=/com/ubuntu/upstart-session/1000/1613\",\"J2SDKDIR\":\"/usr/lib/jvm/java-7-oracle\",\"SESSION_MANAGER\":\"local/pc-frosini.isti.cnr.it:@/tmp/.ICE-unix/1849,unix/pc-frosini.isti.cnr.it:/tmp/.ICE-unix/1849\",\"LC_NUMERIC\":\"it_IT.UTF-8\",\"GNOME_DESKTOP_SESSION_ID\":\"this-is-deprecated\",\"Java\":\"1.7.0_80\",\"COMPIZ_CONFIG_PROFILE\":\"ubuntu\",\"GDMSESSION\":\"ubuntu\",\"IM_CONFIG_PHASE\":\"1\",\"MANDATORY_PATH\":\"/usr/share/gconf/ubuntu.mandatory.path\",\"SmartGearsDistributionBundle\":\"2.0.1-SNAPSHOT\",\"PWD\":\"/home/lucafrosini/Desktop/SmartGears-Bundle\",\"SESSIONTYPE\":\"gnome-session\",\"GIO_LAUNCHED_DESKTOP_FILE_PID\":\"7474\",\"GTK_IM_MODULE\":\"ibus\",\"XDG_GREETER_DATA_DIR\":\"/var/lib/lightdm-data/lucafrosini\",\"XDG_SESSION_TYPE\":\"x11\",\"NLSPATH\":\"/usr/dt/lib/nls/msg/%L/%N.cat\",\"TERMINATOR_UUID\":\"urn:uuid:7e1ff3e9-f2ca-4c64-b5db-922901ce32dc\",\"XDG_MENU_PREFIX\":\"gnome-\",\"LC_ADDRESS\":\"it_IT.UTF-8\",\"ghn-update-interval-in-secs\":\"60\",\"XDG_CONFIG_DIRS\":\"/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg\",\"XDG_CURRENT_DESKTOP\":\"Unity\",\"QT_LINUX_ACCESSIBILITY_ALWAYS_ON\":\"1\",\"GHN_HOME\":\"/home/lucafrosini/Desktop/SmartGears-Bundle/SmartGears\",\"XAUTHORITY\":\"/home/lucafrosini/.Xauthority\",\"GDM_LANG\":\"en_US\",\"XDG_SEAT\":\"seat0\",\"SmartGears\":\"2.2.0-SNAPSHOT\",\"CATALINA_PID\":\"/home/lucafrosini/Desktop/SmartGears-Bundle/tomcat.pid\",\"XDG_SESSION_ID\":\"c2\",\"XDG_SEAT_PATH\":\"/org/freedesktop/DisplayManager/Seat0\",\"XDG_VTNR\":\"7\",\"LC_TIME\":\"it_IT.UTF-8\",\"GNOME_KEYRING_CONTROL\":\"\",\"GTK_MODULES\":\"gail:atk-bridge:unity-gtk-module\",\"LC_TELEPHONE\":\"it_IT.UTF-8\",\"SHLVL\":\"2\",\"XFILESEARCHPATH\":\"/usr/dt/app-defaults/%L/Dt\",\"GTK2_MODULES\":\"overlay-scrollbar\",\"COMPIZ_BIN_PATH\":\"/usr/bin/\",\"COLORTERM\":\"gnome-terminal\",\"JOB\":\"unity-settings-daemon\",\"UPSTART_JOB\":\"unity7\",\"LC_NAME\":\"it_IT.UTF-8\",\"IBUS_DISABLE_SNOOPER\":\"1\",\"XDG_DATA_DIRS\":\"/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop\",\"QT_QPA_PLATFORMTHEME\":\"appmenu-qt5\",\"QT_IM_MODULE\":\"ibus\",\"GIO_LAUNCHED_DESKTOP_FILE\":\"/usr/share/applications/terminator.desktop\",\"UPSTART_INSTANCE\":\"\",\"LOGNAME\":\"lucafrosini\",\"WINDOWID\":\"81788932\",\"LC_PAPER\":\"it_IT.UTF-8\",\"SmartGearsDistribution\":\"2.0.0-SNAPSHOT\",\"SESSION\":\"ubuntu\",\"GPG_AGENT_INFO\":\"/home/lucafrosini/.gnupg/S.gpg-agent:0:1\",\"LC_IDENTIFICATION\":\"it_IT.UTF-8\",\"DERBY_HOME\":\"/usr/lib/jvm/java-7-oracle/db\",\"XMODIFIERS\":\"@im=ibus\",\"LD_LIBRARY_PATH\":\"/home/lucafrosini/MATLAB/MATLAB_Runtime/v90/runtime/glnxa64\",\"UPSTART_EVENTS\":\"xsession started\",\"OLDPWD\":\"/home/lucafrosini/Desktop/SmartGears-Bundle\",\"DBUS_SESSION_BUS_ADDRESS\":\"unix:abstract=/tmp/dbus-mf1KaSOYwP\",\"SHELL\":\"/bin/bash\",\"GNOME_KEYRING_PID\":\"\",\"LANGUAGE\":\"en_US\",\"QT_ACCESSIBILITY\":\"1\",\"DESKTOP_SESSION\":\"ubuntu\",\"INSTANCE\":\"\",\"DISPLAY\":\":0\",\"CLUTTER_IM_MODULE\":\"xim\",\"LC_MONETARY\":\"it_IT.UTF-8\",\"USER\":\"lucafrosini\",\"CATALINA_HOME\":\"/home/lucafrosini/Desktop/SmartGears-Bundle/tomcat\",\"HOME\":\"/home/lucafrosini\",\"LESSOPEN\":\"| /usr/bin/lesspipe %s\",\"QT4_IM_MODULE\":\"xim\",\"CATALINA_OPTS\":\"-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -Xmx2000m -Xms2000m\",\"DEFAULTS_PATH\":\"/usr/share/gconf/ubuntu.default.path\",\"ORBIT_SOCKETDIR\":\"/tmp/orbit-lucafrosini\",\"XDG_SESSION_DESKTOP\":\"ubuntu\",\"LC_MEASUREMENT\":\"it_IT.UTF-8\",\"BUNDLE_HOME\":\"/home/lucafrosini/Desktop/SmartGears-Bundle\",\"XDG_RUNTIME_DIR\":\"/run/user/1000\",\"LANG\":\"en_US.UTF-8\"}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"ContainerStateFacet\",\"header\":null,\"value\":\"started\"}},{\"@class\":\"HasVolatileMemory\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"MemoryFacet\",\"header\":null,\"size\":15736,\"used\":9042,\"unit\":\"MB\"},\"memoryType\":\"RAM\"},{\"@class\":\"HasVolatileMemory\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"MemoryFacet\",\"header\":null,\"size\":1917,\"used\":374,\"unit\":\"MB\",\"jvmMaxMemory\":1917},\"memoryType\":\"JVM\"},{\"@class\":\"HasPersistentMemory\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"MemoryFacet\",\"header\":null,\"size\":273894,\"used\":101270,\"unit\":\"MB\"}}],\"isRelatedTo\":[]}"; public static final String ESERVICE = "{\"@class\":\"EService\",\"header\":{\"@class\":\"Header\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"SoftwareFacet\",\"header\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; - public static final String NYESERVICE = "{\"@class\":\"EService\",\"header\":{\"@class\":\"Header\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"relationProperty\":null,\"target\":{\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"@class\":\"MySoftwareFacet\",\"header\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; - public static final String MYESERVICE = "{\"@class\":\"EService\",\"header\":{\"@class\":\"Header\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"header\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; - public static final String MYOTHERESERVICE = "{\"@class\":\"EService\",\"header\":{\"@class\":\"Header\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"header\":null,\"@superClasses\":[\"SoftwareFacet\", \"Facet\", \"Entity\"],\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; - public static final String MYANOTHERESERVICE = "{\"@class\":\"EService\",\"header\":{\"@class\":\"Header\",\"uuid\":\"3ace4bd0-e5cd-49a3-97a8-a0a9468ce6d4\",\"creator\":null, \"creationTime\":null, \"lastUpdateTime\":null},\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"MySoftwareFacet\",\"header\":null,\"name\":\"WhnManager\",\"group\":\"VREManagement\",\"version\":\"2.0.0-SNAPSHOT\",\"description\":\"Web Hosting Node Service\",\"qualifier\":null,\"optional\":false}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"whnmanager\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/vremanagement/ws/whnmanager\",\"protocol\":null,\"description\":null,\"authorization\": {\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}},{\"@class\":\"ConsistsOf\",\"header\":null,\"relationProperty\":null,\"target\":{\"@class\":\"AccessPointFacet\",\"header\":null,\"entryName\":\"WhnManager-remote-management\",\"endpoint\":\"http://pc-frosini.isti.cnr.it:8080/whn-manager/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"@class\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null},\"properties\":null}}],\"isRelatedTo\":[]}"; - - @Test - public void testER() throws JsonParseException, - JsonMappingException, IOException, ResourceRegistryException { - String[] eServices = new String[]{NYESERVICE, MYESERVICE, MYOTHERESERVICE, MYANOTHERESERVICE}; - for(String eService : eServices){ - Resource resource = Entities.unmarshal(Resource.class, eService); - logger.debug("{}", resource); - - List> consistsOfs = resource.getConsistsOf(); - for(ConsistsOf consistsOf : consistsOfs){ - logger.debug("{}", consistsOf); - Facet facet = consistsOf.getTarget(); - logger.debug("{} {}", facet.getClass().getSimpleName(), facet); - } - } - - - - - } - - @Test public void testHostingNode() throws JsonParseException, JsonMappingException, IOException, ResourceRegistryException {