From fe1843f6d906433d114a591b01c9761eb18726c3 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Tue, 16 Sep 2008 12:24:16 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@3223 82a268e6-3cf1-43bd-a215-b396298e98cf --- etc/profile.xml | 8 +++---- .../registry/impl/state/ProfileResource.java | 21 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/etc/profile.xml b/etc/profile.xml index 37ed3ba..16e8dcd 100644 --- a/etc/profile.xml +++ b/etc/profile.xml @@ -6,11 +6,11 @@ IS-Registry: validate, register and unregister GCUBE resources to/from the IS. It also publishes Topics for notifications about GCUBE resource events InformationSystem IS-Registry - 1.0 + 1.0.0
IS-Registry-service - 1.0 + 1.0.0 @@ -23,7 +23,7 @@ IS-Registry IS-Registry-stubs - 1.0 + 1.0.0 false @@ -42,7 +42,7 @@
IS-Registry-stubs - 1.0 + 1.0.0 diff --git a/src/org/gcube/informationsystem/registry/impl/state/ProfileResource.java b/src/org/gcube/informationsystem/registry/impl/state/ProfileResource.java index 8ebd411..ee4a1a6 100644 --- a/src/org/gcube/informationsystem/registry/impl/state/ProfileResource.java +++ b/src/org/gcube/informationsystem/registry/impl/state/ProfileResource.java @@ -23,6 +23,7 @@ import org.gcube.common.core.utils.logging.GCUBELog; import org.gcube.informationsystem.registry.impl.RegistryFactory; import org.gcube.informationsystem.registry.impl.contexts.ServiceContext; import org.globus.wsrf.ResourceException; +import org.globus.wsrf.impl.SimpleTopic; import org.w3c.dom.Document; import org.xml.sax.InputSource; @@ -39,7 +40,7 @@ public class ProfileResource extends GCUBEWSResource { private ISNotifier notifier= null; - ArrayList listQname = new ArrayList(); + ArrayList listQname = new ArrayList(); protected static final String NotificationProfileRP="NotificationProfile"; @@ -82,15 +83,7 @@ public class ProfileResource extends GCUBEWSResource { throw new ResourceException(e1); } - /* - StringWriter sw= new StringWriter(); - try { - resource.store(sw); - } catch (Exception e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - */ + this.setProfile(dom); this.setNotificationProfile(dom); this.setGCubeResource(resource); @@ -100,13 +93,13 @@ public class ProfileResource extends GCUBEWSResource { if (hasToLive(resource)) { //registration of Topic To IS-Notifier - listQname.add(this.generateQName()); + listQname.add(new SimpleTopic(this.generateQName())); synchronized(RegistryFactory.notificationMap) { 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()); + notifier.registerISNotification(this.getEPR(), listQname, ServiceContext.getContext()); } catch (Exception e){ e.printStackTrace(); throw new ResourceException(e); @@ -187,7 +180,7 @@ public class ProfileResource extends GCUBEWSResource { { try { - notifier.unregisterFromISNotification(this.getEPR(),listQname,ServiceContext.getContext()); + notifier.unregisterISNotification(this.getEPR(),listQname,ServiceContext.getContext()); } catch (ISPublisherException e) { e.printStackTrace(); } catch (Exception e) { @@ -200,7 +193,7 @@ public class ProfileResource extends GCUBEWSResource { } try { - publisher.removeWSResource(this,GHNContext.getContext().getDefaultScope()); + publisher.removeWSResource(this,ServiceContext.getContext().getScope()); } catch (ISPublisherException e) { e.printStackTrace(); }