git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@511 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c7333927a7
commit
a67f863a86
|
@ -2,11 +2,24 @@
|
|||
<deployment name="defaultServerConfig"
|
||||
xmlns="http://xml.apache.org/axis/wsdd/"
|
||||
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:aggr="http://mds.globus.org/aggregator/types">
|
||||
|
||||
<service name="gcube/informationsystem/registry/Registry" provider="Handler" use="literal" style="document">
|
||||
<parameter name="className" value="org.gcube.informationsystem.registry.impl.core.Registry"/>
|
||||
<wsdlFile>share/schema/org.gcube.informationsystem.registry/Registry_service.wsdl</wsdlFile>
|
||||
<typeMapping
|
||||
deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
|
||||
encodingStyle=""
|
||||
qname="xsd:anyType"
|
||||
type="java:java.lang.Object" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
|
||||
<typeMapping
|
||||
name="AggregatorContent"
|
||||
qname="aggr:AggregatorContent"
|
||||
type="java:org.globus.mds.aggregator.types.AggregatorContent"
|
||||
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
|
||||
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
|
||||
encodingStyle="" />
|
||||
<parameter name="allowedMethods" value="*"/>
|
||||
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
|
||||
<parameter name="scope" value="Application"/>
|
||||
|
@ -20,6 +33,19 @@
|
|||
<service name="gcube/informationsystem/registry/RegistryFactory" provider="Handler" use="literal" style="document">
|
||||
<parameter name="className" value="org.gcube.informationsystem.registry.impl.core.RegistryFactory"/>
|
||||
<wsdlFile>share/schema/org.gcube.informationsystem.registry/RegistryFactory_service.wsdl</wsdlFile>
|
||||
<typeMapping
|
||||
deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
|
||||
encodingStyle=""
|
||||
qname="xsd:anyType"
|
||||
type="java:java.lang.Object" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
|
||||
<typeMapping
|
||||
name="AggregatorContent"
|
||||
qname="aggr:AggregatorContent"
|
||||
type="java:org.globus.mds.aggregator.types.AggregatorContent"
|
||||
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
|
||||
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
|
||||
encodingStyle="" />
|
||||
|
||||
<parameter name="allowedMethods" value="*"/>
|
||||
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
|
||||
<parameter name="scope" value="Application"/>
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
|
||||
<!-- renewal registration time -->
|
||||
<RefreshIntervalSecs>600</RefreshIntervalSecs>
|
||||
<Content>
|
||||
<Content xsi:type="agg:AggregatorContent"
|
||||
xmlns:agg="http://mds.globus.org/aggregator/types">
|
||||
<agg:AggregatorConfig xsi:type="agg:AggregatorConfig">
|
||||
<agg:GetMultipleResourcePropertiesPollType xmlns:registry="http://gcube-system.org/namespaces/informationsystem/registry">
|
||||
<agg:GetMultipleResourcePropertiesPollType
|
||||
xmlns:registry="http://gcube-system.org/namespaces/informationsystem/registry"
|
||||
xmlns:provider="http://gcube-system.org/namespaces/common/core/porttypes/GCUBEProvider"
|
||||
xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd">
|
||||
<agg:PollIntervalMillis>60000</agg:PollIntervalMillis>
|
||||
<agg:ResourcePropertyNames>registry:Profile</agg:ResourcePropertyNames>
|
||||
</agg:GetMultipleResourcePropertiesPollType>
|
||||
|
@ -17,3 +21,5 @@
|
|||
</Content>
|
||||
|
||||
</ServiceGroupRegistrationParameters>
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
<!-- RESOURCE PROPERTIES -->
|
||||
|
||||
|
||||
<xsd:element name="Profile" type="xsd:anyType"/>
|
||||
<!-- <xsd:element name="Profile" type="xsd:anyType"/> -->
|
||||
<xsd:element name="Profile" type="xsd:string"/>
|
||||
|
||||
<xsd:element name="NotificationProfile" type="xsd:string"/>
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 = "<ServiceGroupRegistrationParameters xmlns:sgc=\"http://mds.globus.org/servicegroup/client\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/03/addressing\" xmlns:agg=\"http://mds.globus.org/aggregator/types\" xmlns=\"http://mds.globus.org/servicegroup/client\" xmlns:provider=\"http://gcube-system.org/namespaces/common/core/porttypes/GCUBEProvider\" xmlns:wsrl=\"http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd\">"
|
||||
|
||||
+ "<RefreshIntervalSecs>60</RefreshIntervalSecs>"+
|
||||
|
||||
|
||||
"<Content xsi:type=\"agg:AggregatorContent\" xmlns:agg=\"http://mds.globus.org/aggregator/types\">"+
|
||||
|
||||
"<agg:AggregatorConfig>"+
|
||||
"<agg:GetMultipleResourcePropertiesPollType xmlns:registry=\"http://gcube-system.org/namespaces/informationsystem/registry\">"+
|
||||
|
||||
"<agg:PollIntervalMillis>60000</agg:PollIntervalMillis>"+
|
||||
"<agg:ResourcePropertyNames>registry:Profile</agg:ResourcePropertyNames> "+
|
||||
"<n0:ResourcePropertyNames xmlns:n0=\"http://mds.globus.org/aggregator/types\">wsrl:TerminationTime</n0:ResourcePropertyNames>"+
|
||||
"<n1:ResourcePropertyNames xmlns:n1=\"http://mds.globus.org/aggregator/types\">wsrl:CurrentTime</n1:ResourcePropertyNames>"+
|
||||
"<n2:ResourcePropertyNames xmlns:n2=\"http://mds.globus.org/aggregator/types\">provider:GHN</n2:ResourcePropertyNames>"+
|
||||
"<n3:ResourcePropertyNames xmlns:n3=\"http://mds.globus.org/aggregator/types\">provider:RI</n3:ResourcePropertyNames>"+
|
||||
"<n4:ResourcePropertyNames xmlns:n4=\"http://mds.globus.org/aggregator/types\">provider:ServiceClass</n4:ResourcePropertyNames>"+
|
||||
"<n5:ResourcePropertyNames xmlns:n5=\"http://mds.globus.org/aggregator/types\">provider:Scope</n5:ResourcePropertyNames>"+
|
||||
"<n6:ResourcePropertyNames xmlns:n6=\"http://mds.globus.org/aggregator/types\">provider:ServiceID</n6:ResourcePropertyNames>"+
|
||||
"<n7:ResourcePropertyNames xmlns:n7=\"http://mds.globus.org/aggregator/types\">provider:ServiceName</n7:ResourcePropertyNames>"+
|
||||
"<n8:ResourcePropertyNames xmlns:n8=\"http://mds.globus.org/aggregator/types\">provider:VO</n8:ResourcePropertyNames>"+
|
||||
"</agg:GetMultipleResourcePropertiesPollType>"+
|
||||
" </agg:AggregatorConfig>"+
|
||||
|
||||
"<agg:AggregatorData />"+
|
||||
"</Content>"+
|
||||
|
||||
"</ServiceGroupRegistrationParameters>";
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue