From dc2e16777ecbb3f65ff7962012096971e6b98dd4 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Thu, 27 Oct 2016 16:30:19 +0000 Subject: [PATCH] Fixing log git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@133668 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../resources/impl/ContextManagementImpl.java | 2 +- .../resources/impl/SchemaManagementImpl.java | 31 ++++++++++--------- src/test/resources/logback-test.xml | 1 + 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/ContextManagementImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/ContextManagementImpl.java index b067672..13c4665 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/ContextManagementImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/ContextManagementImpl.java @@ -159,7 +159,7 @@ public class ContextManagementImpl implements ContextManagement { orientGraph.commit(); Vertex readContext = getContext(orientGraph, uuid); - logger.info("Context {} created", + logger.info("Context created {}", Utility.toJsonString((OrientVertex) readContext, true)); return Utility.toJsonString((OrientVertex) readContext, false); diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/SchemaManagementImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/SchemaManagementImpl.java index 777ff05..26c4c78 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/SchemaManagementImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/resources/impl/SchemaManagementImpl.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; +import org.gcube.informationsystem.model.embedded.Embedded; import org.gcube.informationsystem.model.entity.Entity; import org.gcube.informationsystem.model.entity.Facet; import org.gcube.informationsystem.model.entity.Resource; @@ -231,11 +232,11 @@ public class SchemaManagementImpl implements SchemaManagement { } } - // orientGraphNoTx.commit(); - OClass oClass = getTypeSchema(typeDefinition.getName(), null); - return serializeOClass(oClass); - + String ret = serializeOClass(oClass); + logger.info("{} type registered successfully: {}", baseType, jsonSchema); + return ret; + } catch (Exception e) { throw new SchemaException(e); } finally { @@ -254,7 +255,7 @@ public class SchemaManagementImpl implements SchemaManagement { OrientGraphNoTx orientGraphNoTx = null; try { - logger.info("Trying to register {} {}", baseType, jsonSchema); + logger.info("Trying to register {} type : {}", baseType, jsonSchema); ObjectMapper mapper = new ObjectMapper(); TypeDefinition typeDefinition = mapper.readValue(jsonSchema, @@ -313,10 +314,11 @@ public class SchemaManagementImpl implements SchemaManagement { } } - // orientGraphNoTx.commit(); - OClass oClass = getTypeSchema(typeDefinition.getName(), null); - return serializeOClass(oClass); + String ret = serializeOClass(oClass); + logger.info("{} type registered successfully: {}", baseType, jsonSchema); + return ret; + } catch (Exception e) { throw new SchemaException(e); } finally { @@ -335,7 +337,7 @@ public class SchemaManagementImpl implements SchemaManagement { OrientGraphNoTx orientGraphNoTx = null; try { - logger.info("Trying to register {}", jsonSchema); + logger.info("Trying to register {} type : {}", Embedded.NAME, jsonSchema); ObjectMapper mapper = new ObjectMapper(); TypeDefinition typeDefinition = mapper.readValue(jsonSchema, @@ -393,11 +395,12 @@ public class SchemaManagementImpl implements SchemaManagement { ovp.setLinkedClass(linkedClass); } } - - // orientGraphNoTx.commit(); - - return serializeOClass(oClass); - + oDatabaseDocumentTx.commit(); + + String ret = serializeOClass(oClass); + logger.info("{} type registered successfully: {}", Embedded.NAME, jsonSchema); + return ret; + } catch (Exception e) { throw new SchemaException(e); } finally { diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 271987e..1642b53 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -8,6 +8,7 @@ +