diff --git a/src/org/gcube/informationsystem/registry/impl/RegistryFactory.java b/src/org/gcube/informationsystem/registry/impl/RegistryFactory.java index 619edf2..bc90e16 100644 --- a/src/org/gcube/informationsystem/registry/impl/RegistryFactory.java +++ b/src/org/gcube/informationsystem/registry/impl/RegistryFactory.java @@ -117,10 +117,8 @@ public class RegistryFactory{ * @throws ProfileAlreadyRegisteredFault */ public String createResource(CreateResourceMessage mess) throws SchemaValidationFault,RemoteException,ProfileAlreadyRegisteredFault { - GCUBEResource resource; - try { - resource = GHNContext.getImplementation(GCUBEResource.class); - }catch(Exception e) {throw new RemoteException("Error in GHNContext");} + GCUBEResource resource=null; + logger.info("CreateResource operation invoked"); logSecurityInfo("createResource"); @@ -133,13 +131,15 @@ public class RegistryFactory{ throw new RemoteException(msg); } - System.out.println("profile:" +profile); + try { - ResourceType.valueOf(mess.getType()).getResourceClass().getClass().cast(resource); + resource=ResourceType.valueOf(mess.getType()).getResourceClass(); resource.load(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(profile.getBytes("UTF-8")), "UTF-8"))); if (mess.getType().compareTo(GCUBEGenericResource.TYPE)==0){ + System.out.println("profile:" +profile); + System.out.println("------------"); System.out.println(((GCUBEGenericResource) resource).getBody()); } //the parse Profile class allows to extract from profiles information about type/SCOPE/UniqueID