Porting code to redesigned E/R format
This commit is contained in:
parent
5c3735d669
commit
55e6951557
6
pom.xml
6
pom.xml
|
@ -53,6 +53,12 @@
|
|||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>authorization-utils</artifactId>
|
||||
<version>[2.1.0, 3.0.0-SNAPSHOT)</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orientechnologies</groupId>
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.gcube.informationsystem.resourceregistry.queries.operators.QueryLogic
|
|||
import org.gcube.informationsystem.resourceregistry.utils.Utility;
|
||||
import org.gcube.informationsystem.serialization.ElementMapper;
|
||||
import org.gcube.informationsystem.types.reference.entities.EntityType;
|
||||
import org.gcube.informationsystem.utils.UUIDManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -233,7 +234,7 @@ public class ContextManagement extends EntityElementManagement<Context, EntityTy
|
|||
|
||||
checkContext(parentContextManagement);
|
||||
if (uuid == null) {
|
||||
uuid = UUID.randomUUID();
|
||||
uuid = UUIDManager.getInstance().generateValidRandomUUID();
|
||||
}
|
||||
|
||||
createVertex();
|
||||
|
|
|
@ -41,8 +41,8 @@ public class InvalidOperationTest extends ERManagementTest {
|
|||
|
||||
private static Logger logger = LoggerFactory.getLogger(InvalidOperationTest.class);
|
||||
|
||||
public static final String ACTIVATES = "{\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"propagate\",\"remove\":\"cascade\"},\"@class\":\"Activates\",\"source\":{\"header\":{\"@class\":\"Header\",\"uuid\":\"CONFIGURATION_UUID\"},\"@class\":\"Configuration\"},\"target\":{\"header\":{\"@class\":\"Header\",\"uuid\":\"ESERVICE_UUID\"},\"@class\":\"EService\"}}";
|
||||
public static final String ACTOR = "{\"@class\":\"Actor\",\"@metadata\":null,\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"@metadata\":null,\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"remove\":\"cascadeWhenOrphan\",\"add\":\"propagate\"},\"source\":{\"@class\":\"Actor\",\"header\":null},\"target\":{\"@class\":\"ContactFacet\",\"header\":null,\"title\":\"Dr.\",\"name\":\"Frosini\",\"middleName\":null,\"surname\":null,\"eMail\":\"luca.frosini@isti.cnr.it\"}}],\"isRelatedTo\":[]}";
|
||||
public static final String ACTIVATES = "{\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"propagate\",\"remove\":\"cascade\",\"delete\":\"cascade\"},\"@class\":\"Activates\",\"source\":{\"@class\":\"Configuration\",\"@uuid\":\"CONFIGURATION_UUID\"},\"target\":{\"@uuid\":\"ESERVICE_UUID\",\"@class\":\"EService\"}}";
|
||||
public static final String ACTOR = "{\"@class\":\"Actor\",\"@metadata\":null,\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"@metadata\":null,\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"remove\":\"cascade\",\"delete\":\"cascade\",\"add\":\"propagate\"},\"source\":{\"@class\":\"Actor\",\"@metadata\":null},\"target\":{\"@class\":\"ContactFacet\",\"@metadata\":null,\"title\":\"Dr.\",\"name\":\"Frosini\",\"middleName\":null,\"surname\":null,\"eMail\":\"luca.frosini@isti.cnr.it\"}}],\"isRelatedTo\":[]}";
|
||||
|
||||
@Test(expected = SchemaViolationException.class)
|
||||
public void createInvalidIsRealtedTo() throws Exception {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<logger name="org.gcube.informationsystem.resourceregistry.dbinitialization" level="INFO" />
|
||||
<logger name="org.gcube.informationsystem.utils.discovery" level="ERROR" />
|
||||
<logger name="org.gcube.informationsystem.resourceregistry.types" level="INFO" />
|
||||
<logger name="org.gcube.informationsystem.resourceregistry.instances" level="TRACE" />
|
||||
|
||||
<root level="WARN">
|
||||
<appender-ref ref="STDOUT" />
|
||||
|
|
|
@ -5,18 +5,16 @@
|
|||
"@class": "ConsistsOf",
|
||||
"source" : {
|
||||
"@class" : "EService",
|
||||
"header": {
|
||||
"$or": [
|
||||
{"$and": {
|
||||
"uuid" : "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925",
|
||||
"createdBy": {"$ne": "luca.frosini"}
|
||||
}},
|
||||
{"$and": {
|
||||
"uuid" : "0255b7ec-e3da-4071-b456-9a2907ece1db",
|
||||
"createdBy": "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"
|
||||
}}
|
||||
]
|
||||
}
|
||||
"$or": [
|
||||
{"$and": {
|
||||
"@uuid" : "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925",
|
||||
"@metadata" :{ "createdBy": {"$ne": "luca.frosini"} }
|
||||
}},
|
||||
{"$and": {
|
||||
"@uuid" : "0255b7ec-e3da-4071-b456-9a2907ece1db",
|
||||
"@metadata" : { "createdBy": "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080" }
|
||||
}}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((@uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND header.createdBy <> "luca.frosini") OR (header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"))))) WHERE value = "down"
|
||||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((@uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND @metadata.createdBy <> "luca.frosini") OR (@uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND @metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"))))) WHERE value = "down"
|
|
@ -31,14 +31,10 @@
|
|||
"isRelatedTo" : [
|
||||
{
|
||||
"@class": "Activates",
|
||||
"header": {
|
||||
"uuid": "d3f58e52-5346-47bc-b736-9d77a0b554ce"
|
||||
},
|
||||
"@uuid": "d3f58e52-5346-47bc-b736-9d77a0b554ce",
|
||||
"source": {
|
||||
"@class": "HostingNode",
|
||||
"header": {
|
||||
"uuid" : "5fbc1a56-d450-4f0f-85c1-9b1684581717"
|
||||
},
|
||||
"@uuid" : "5fbc1a56-d450-4f0f-85c1-9b1684581717",
|
||||
"consistsOf": [
|
||||
{
|
||||
"@class": "ConsistsOf",
|
||||
|
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE outV("EService") FROM ( SELECT FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("CPUFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("HostingNode") FROM ( SELECT FROM Activates WHERE @uuid = "d3f58e52-5346-47bc-b736-9d77a0b554ce")))) WHERE vendor = "GenuineIntel"))) WHERE header.uuid = "5fbc1a56-d450-4f0f-85c1-9b1684581717"))))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))) WHERE header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
||||
SELECT FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE outV("EService") FROM ( SELECT FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("CPUFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("HostingNode") FROM ( SELECT FROM Activates WHERE @uuid = "d3f58e52-5346-47bc-b736-9d77a0b554ce")))) WHERE vendor = "GenuineIntel"))) WHERE @uuid = "5fbc1a56-d450-4f0f-85c1-9b1684581717"))))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))) WHERE @uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
|
@ -4,18 +4,16 @@
|
|||
"@class": "ConsistsOf",
|
||||
"source" : {
|
||||
"@class" : "EService",
|
||||
"header": {
|
||||
"$or": [
|
||||
{"$and": {
|
||||
"uuid" : "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925",
|
||||
"createdBy": {"$ne": "luca.frosini"}
|
||||
}},
|
||||
{"$and": {
|
||||
"uuid" : "0255b7ec-e3da-4071-b456-9a2907ece1db",
|
||||
"createdBy": "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"
|
||||
}}
|
||||
]
|
||||
}
|
||||
"$or": [
|
||||
{"$and": {
|
||||
"@uuid" : "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925",
|
||||
"@metadata" :{ "createdBy": {"$ne": "luca.frosini"} }
|
||||
}},
|
||||
{"$and": {
|
||||
"@uuid" : "0255b7ec-e3da-4071-b456-9a2907ece1db",
|
||||
"@metadata" : { "createdBy": "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080" }
|
||||
}}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((@uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND header.createdBy <> "luca.frosini") OR (@uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080")))))
|
||||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((@uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND @metadata.createdBy <> "luca.frosini") OR (@uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080")))))
|
Loading…
Reference in New Issue