diff --git a/etc/deploy-server.wsdd b/etc/deploy-server.wsdd index 2511118..fad18ff 100644 --- a/etc/deploy-server.wsdd +++ b/etc/deploy-server.wsdd @@ -2,11 +2,24 @@ + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:aggr="http://mds.globus.org/aggregator/types"> share/schema/org.gcube.informationsystem.registry/Registry_service.wsdl + + @@ -20,6 +33,19 @@ share/schema/org.gcube.informationsystem.registry/RegistryFactory_service.wsdl + + + diff --git a/etc/registration.xml b/etc/registration.xml index f18e9d4..04f3028 100644 --- a/etc/registration.xml +++ b/etc/registration.xml @@ -6,9 +6,13 @@ 600 - + - + 60000 registry:Profile @@ -17,3 +21,5 @@ + + diff --git a/schema/Registry.wsdl b/schema/Registry.wsdl index dce1d7d..daaa96b 100644 --- a/schema/Registry.wsdl +++ b/schema/Registry.wsdl @@ -44,7 +44,8 @@ - + + diff --git a/src/org/gcube/informationsystem/registry/impl/core/RegistryFactory.java b/src/org/gcube/informationsystem/registry/impl/core/RegistryFactory.java index 81a41b3..344a310 100644 --- a/src/org/gcube/informationsystem/registry/impl/core/RegistryFactory.java +++ b/src/org/gcube/informationsystem/registry/impl/core/RegistryFactory.java @@ -422,7 +422,7 @@ public class RegistryFactory extends GCUBEStartupPortType{ private RegistryFactoryResource getResource() throws RemoteException { Object resource = null; try { - resource = FactoryContext.getContext().getWSHome().find(FactoryContext.getContext().makeKey(NOTIFICATOR_RESOURCE_KEY)); + //resource = FactoryContext.getContext().getWSHome().find(FactoryContext.getContext().makeKey(NOTIFICATOR_RESOURCE_KEY)); } catch (Exception e) { logger.error(" Unable to access resource", e); } diff --git a/src/org/gcube/informationsystem/registry/impl/core/RegistryFactoryResource.java b/src/org/gcube/informationsystem/registry/impl/core/RegistryFactoryResource.java index fbdfc07..f35c3f0 100644 --- a/src/org/gcube/informationsystem/registry/impl/core/RegistryFactoryResource.java +++ b/src/org/gcube/informationsystem/registry/impl/core/RegistryFactoryResource.java @@ -1,7 +1,6 @@ package org.gcube.informationsystem.registry.impl.core; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; + import java.util.ArrayList; import javax.xml.namespace.QName; diff --git a/src/org/gcube/informationsystem/registry/impl/core/ServiceContext.java b/src/org/gcube/informationsystem/registry/impl/core/ServiceContext.java index 0755a7a..2370a79 100644 --- a/src/org/gcube/informationsystem/registry/impl/core/ServiceContext.java +++ b/src/org/gcube/informationsystem/registry/impl/core/ServiceContext.java @@ -1,5 +1,10 @@ package org.gcube.informationsystem.registry.impl.core; +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; + import org.gcube.common.core.contexts.GCUBEServiceContext; import org.gcube.common.core.contexts.GHNContext; import org.gcube.common.core.informationsystem.client.ISClient; @@ -14,6 +19,11 @@ import org.gcube.common.core.scope.GCUBEScope; import org.gcube.common.core.utils.handlers.GCUBEHandler; import org.gcube.common.core.utils.handlers.GCUBEScheduledHandler; import org.gcube.informationsystem.registry.impl.core.RegistryConfiguration.ROOT_SERVICES; +import org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters; +import org.globus.wsrf.encoding.ObjectDeserializer; +import org.globus.wsrf.utils.XmlUtils; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; /** * IS-Registry service context @@ -87,7 +97,7 @@ public class ServiceContext extends GCUBEServiceContext { //creates the single RegistryResource used to raise notifications about profiles' changes logger.info("Creating IS-Registry notification resource..."); - new Thread() { + /*new Thread() { public void run() { try { Thread.sleep(5000); @@ -98,7 +108,7 @@ public class ServiceContext extends GCUBEServiceContext { } catch (Exception e) { ServiceContext.this.logger.error("Failed to create the notification resource", e); } - }}.start(); + }}.start();*/ /*NotificationResourceScheduler scheduler = new NotificationResourceScheduler(10, GCUBEScheduledHandler.Mode.LAZY); scheduler.setHandled(new NotificationResource()); @@ -132,6 +142,13 @@ public class ServiceContext extends GCUBEServiceContext { @Override protected void onInitialisation() throws Exception { + + try { + this.checkTypeMappings(); + } catch (InterruptedException e1) { + logger.error("Unable to get parse reg file", e1); + } + //get the needed implementation classes this.client = GHNContext.getImplementation(ISClient.class); this.queryRI = this.client.getQuery(GCUBERIsFromClassAndName.class); @@ -227,4 +244,49 @@ public class ServiceContext extends GCUBEServiceContext { protected boolean isICCodeployed() { return isICCodeployed; } + + private void checkTypeMappings() throws Exception { + + logger.debug("Checking type mappings availability"); + + String reg = "" + + + "60"+ + + + ""+ + + ""+ + ""+ + + "60000"+ + "registry:Profile "+ + "wsrl:TerminationTime"+ + "wsrl:CurrentTime"+ + "provider:GHN"+ + "provider:RI"+ + "provider:ServiceClass"+ + "provider:Scope"+ + "provider:ServiceID"+ + "provider:ServiceName"+ + "provider:VO"+ + ""+ + " "+ + + ""+ + ""+ + + ""; + + byte[] bArray = reg.getBytes(); + ByteArrayInputStream bais = new ByteArrayInputStream(bArray); + Document doc = XmlUtils.newDocument(bais); + // loop on all the IS-ICs found to perform a registration on each of + // them + + // setting parameters for this registration + ServiceGroupRegistrationParameters params = (ServiceGroupRegistrationParameters) ObjectDeserializer + .toObject(doc.getDocumentElement(), ServiceGroupRegistrationParameters.class); + + } } \ No newline at end of file