This commit is contained in:
Lucio Lelii 2008-09-15 14:51:26 +00:00
parent b64c8a8a59
commit c31a9c0ca8
8 changed files with 27 additions and 130 deletions

View File

@ -8,19 +8,7 @@
<service name="gcube/informationsystem/registry/Registry" provider="Handler" use="literal" style="document">
<parameter name="className" value="org.gcube.informationsystem.registry.impl.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="allowedMethods" value="*"/>
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
<parameter name="scope" value="Application"/>
<parameter name="providers" value="GCUBEProvider SubscribeProvider DestroyProvider GetCurrentMessageProvider "/>
@ -33,20 +21,7 @@
<service name="gcube/informationsystem/registry/RegistryFactory" provider="Handler" use="literal" style="document">
<parameter name="className" value="org.gcube.informationsystem.registry.impl.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="allowedMethods" value="*"/>
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
<parameter name="scope" value="Application"/>
<parameter name="instance" value="gcube/informationsystem/registry/Registry"/>

View File

@ -28,7 +28,7 @@
<agg:ResourcePropertyNames>registry:gLiteService</agg:ResourcePropertyNames>
<agg:ResourcePropertyNames>registry:VRE</agg:ResourcePropertyNames>
<agg:ResourcePropertyNames>registry:MetadataCollection</agg:ResourcePropertyNames>
<agg:ResourcePropertyNames>registry:TransformationProgram</agg:ResourcePropertyNames>
<agg:ResourcePropertyNames>registry:GenericResource</agg:ResourcePropertyNames>
</agg:GetMultipleResourcePropertiesPollType>
</agg:AggregatorConfig>

View File

@ -166,7 +166,7 @@
<xsd:element name="MetadataCollection" type="tns:RegistryProperty"/>
<xsd:element name="TransformationProgram" type="tns:RegistryProperty"/>
<xsd:element name="GenericResource" type="tns:RegistryProperty"/>
<xsd:element name="RegistryFactoryResourceProperties">
<xsd:complexType>
@ -184,7 +184,7 @@
<xsd:element ref="tns:gLiteService" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="tns:VRE" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="tns:MetadataCollection" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="tns:TransformationProgram" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="tns:GenericResource" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

View File

@ -8,26 +8,11 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import org.apache.axis.components.uuid.UUIDGen;
import org.apache.axis.components.uuid.UUIDGenFactory;
import org.apache.axis.utils.XMLUtils;
import org.gcube.common.core.contexts.GCUBEServiceContext;
import org.gcube.common.core.contexts.GHNContext;
import org.gcube.common.core.faults.GCUBEFault;
import org.gcube.common.core.porttypes.GCUBEStartupPortType;
import org.gcube.common.core.resources.GCUBECS;
import org.gcube.common.core.resources.GCUBECSInstance;
import org.gcube.common.core.resources.GCUBECollection;
import org.gcube.common.core.resources.GCUBEExternalRunningInstance;
import org.gcube.common.core.resources.GCUBEGenericResource;
import org.gcube.common.core.resources.GCUBEHostingNode;
import org.gcube.common.core.resources.GCUBEMCollection;
import org.gcube.common.core.resources.GCUBEResource;
import org.gcube.common.core.resources.GCUBERunningInstance;
import org.gcube.common.core.resources.GCUBEService;
import org.gcube.common.core.resources.GCUBETransformationProgram;
import org.gcube.common.core.resources.GCUBEVRE;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.core.state.GCUBEWSResourceKey;
import org.gcube.common.core.utils.logging.GCUBELog;
@ -40,7 +25,6 @@ import org.gcube.informationsystem.registry.impl.util.ProfileManager;
import org.gcube.informationsystem.registry.impl.util.RegistryUtil;
import org.gcube.informationsystem.registry.stubs.CreateResourceMessage;
import org.gcube.informationsystem.registry.stubs.ProfileAlreadyRegisteredFault;
import org.gcube.informationsystem.registry.stubs.RegistryPortType;
import org.gcube.informationsystem.registry.stubs.RegistryProperty;
import org.gcube.informationsystem.registry.stubs.RemoveResourceMessage;
import org.gcube.informationsystem.registry.stubs.RemoveResourceResponse;
@ -52,10 +36,7 @@ import org.gcube.informationsystem.registry.stubs.UpdateResourceMessage;
import org.gcube.informationsystem.registry.stubs.UpdateResourceResponse;
import org.gcube.informationsystem.registry.stubs.UpdateScopeInProfileMessage;
import org.gcube.informationsystem.registry.stubs.UpdateStateMessage;
import org.gcube.informationsystem.registry.stubs.service.RegistryServiceAddressingLocator;
import org.globus.wsrf.security.SecurityManager;
import org.oasis.wsrf.lifetime.Destroy;
import static org.gcube.informationsystem.registry.impl.core.RegistryConfiguration.ResourceType;
@ -65,7 +46,7 @@ import static org.gcube.informationsystem.registry.impl.core.RegistryConfigurati
* @author Andrea Manzi, Manuele Simi (ISTI-CNR)
*
*/
public class RegistryFactory extends GCUBEStartupPortType{
public class RegistryFactory{
@ -95,13 +76,8 @@ public class RegistryFactory extends GCUBEStartupPortType{
/** the key used to label the Factory Resource */
public static final String NOTIFICATOR_RESOURCE_KEY = "RegistryResource";
@Override
protected GCUBEServiceContext getServiceContext() {
return ServiceContext.getContext();
}
/**
/**
* Use to Load from Disk persistence profiles and registers it into the IS-IC ( in case the IS-IC is empty)
*
*

View File

@ -97,7 +97,7 @@ public class ServiceContext extends GCUBEServiceContext {
//switch to the production mode if needed
if (GHNContext.getContext().getMode() == Mode.ROOT)
GHNContext.getContext().setMode(Mode.PRODUCTION);
GHNContext.getContext().setMode(Mode.CONNECTED);
//creates the single RegistryResource used to raise notifications about profiles' changes
logger.info("Scheduling IS-Registry notification resource...");
@ -106,18 +106,7 @@ public class ServiceContext extends GCUBEServiceContext {
scheduler.setHandled(new GCUBEHandler(){
public void run() throws Exception {
//TODO: to remove for gcore 0.4.0
TypeMappingRegistry registry = ContainerConfig.getContext().getTypeMappingRegistry();
javax.xml.rpc.encoding.TypeMapping mapping = registry.createTypeMapping();
QName qname = new QName("http://mds.globus.org/aggregator/types","AggregatorContent");
mapping.register(AggregatorContent.class, qname,
new BeanSerializerFactory(AggregatorContent.class, qname),
new BeanDeserializerFactory(AggregatorContent.class,qname));
registry.register("", mapping);
//-- to remove --
List<String> pt = GHNContext.getContext().getActivePortTypes();
List<String> pt = GHNContext.getContext().getActivePortTypes();
if ( (pt == null) || (pt.size() < 1))
throw new Exception();
@ -154,13 +143,6 @@ 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.queryRI = this.client.getQuery(GCUBERIQuery.class);
//this.queryGHN = this.client.getQuery(GCUBEResourceXPathQuery.class);
@ -259,49 +241,5 @@ 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);
}
}

View File

@ -10,6 +10,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.axis.utils.XMLUtils;
import org.gcube.common.core.informationsystem.notifier.ISNotifier;
import org.gcube.common.core.informationsystem.publisher.ISPublisher;
import org.gcube.common.core.informationsystem.publisher.ISPublisherException;
import org.gcube.common.core.contexts.GHNContext;
@ -36,6 +37,8 @@ public class ProfileResource extends GCUBEWSResource {
private ISPublisher publisher = null;
private ISNotifier notifier= null;
ArrayList<QName> listQname = new ArrayList<QName>();
protected static final String NotificationProfileRP="NotificationProfile";
@ -102,6 +105,7 @@ public class ProfileResource extends GCUBEWSResource {
if (!(RegistryFactory.notificationMap.contains(this.getID()))) {
try {
publisher = GHNContext.getImplementation(ISPublisher.class);
notifier = GHNContext.getImplementation(ISNotifier.class);
//publisher.registerToISNotification(this.getEPR(), listQname, GHNContext.getContext().getDefaultScope(), ServiceContext.getContext());
} catch (Exception e){
e.printStackTrace();
@ -183,7 +187,7 @@ public class ProfileResource extends GCUBEWSResource {
{
try {
publisher.unregisterFromISNotification(this.getEPR(),listQname,GHNContext.getContext().getDefaultScope(),ServiceContext.getContext());
notifier.unregisterFromISNotification(this.getEPR(),listQname,ServiceContext.getContext());
} catch (ISPublisherException e) {
e.printStackTrace();
} catch (Exception e) {

View File

@ -9,6 +9,7 @@ import org.gcube.common.core.state.GCUBEWSResource;
import org.gcube.informationsystem.registry.impl.util.RegistrationThread;
import org.gcube.informationsystem.registry.stubs.RegistryProperty;
import org.globus.wsrf.ResourceException;
import org.globus.wsrf.impl.SimpleTopic;
/**
*
@ -82,7 +83,7 @@ public class RegistryFactoryResource extends GCUBEWSResource {
/**
*
*/
private ArrayList<QName> listQname;
private ArrayList<SimpleTopic> listQname;
/**
*
@ -97,9 +98,9 @@ public class RegistryFactoryResource extends GCUBEWSResource {
try {
//Topic List creation for registration to IS-Notifier
listQname = new ArrayList<QName>();
for (String rpName : RPNames)
listQname.add(new QName(this.getPorttypeContext().getNamespace(),rpName));
listQname = new ArrayList<SimpleTopic>();
for (String rpName : RPNames)
listQname.add(new SimpleTopic(new QName(this.getPorttypeContext().getNamespace(),rpName)));
try {
RegistrationThread thread = new RegistrationThread(listQname);
Thread t = new Thread(thread);

View File

@ -1,14 +1,17 @@
package org.gcube.informationsystem.registry.impl.util;
import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
import org.gcube.common.core.informationsystem.notifier.ISNotifier;
import org.gcube.common.core.informationsystem.publisher.ISPublisher;
import org.gcube.common.core.contexts.GHNContext;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.registry.impl.contexts.FactoryContext;
import org.gcube.informationsystem.registry.impl.contexts.ServiceContext;
import org.globus.wsrf.Topic;
/**
* Registration Thread class
@ -25,7 +28,7 @@ public class RegistrationThread implements Runnable{
/**
*
*/
private ArrayList<QName> topics;
private List<? extends Topic> topics;
/**
*
*/
@ -35,8 +38,8 @@ public class RegistrationThread implements Runnable{
* @param qname an Array list of RP qname
* @throws Exception Exception
*/
public RegistrationThread ( ArrayList<QName> qname) throws Exception{
this.topics = qname;
public RegistrationThread ( List<? extends Topic> topics) throws Exception{
this.topics = topics;
}
/**
*
@ -51,8 +54,8 @@ public class RegistrationThread implements Runnable{
catch(InterruptedException e){
}
try {
ISPublisher publisher = GHNContext.getImplementation(ISPublisher.class);
publisher.registerToISNotification(FactoryContext.getContext().getEPR(),topics, GHNContext.getContext().getDefaultScope(), ServiceContext.getContext() );
ISNotifier notifier = GHNContext.getImplementation(ISNotifier.class);
notifier.registerISNotification(FactoryContext.getContext().getEPR(),topics, ServiceContext.getContext());
return;
} catch (Exception e) {