org.gcube.common.informationsystem.publisher.impl.local
Class GCUBELocalPublisher

java.lang.Object
  extended by org.gcube.common.informationsystem.publisher.impl.local.GCUBELocalPublisher
All Implemented Interfaces:
org.gcube.common.core.informationsystem.publisher.ISLocalPublisher

public final class GCUBELocalPublisher
extends Object
implements org.gcube.common.core.informationsystem.publisher.ISLocalPublisher

Manager for publishing GCUBEResource as local events

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.gcube.common.core.informationsystem.publisher.ISLocalPublisher
org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.GCUBEResourceMessage, org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileConsumer, org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileEvent, org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileTopic
 
Field Summary
protected static org.gcube.common.core.utils.events.GCUBEProducer<org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileTopic,Object> eventProducer
          Internal GCUBEProducer for LocalProfileEvent.
protected static org.gcube.common.core.utils.logging.GCUBELog logger
           
 
Constructor Summary
GCUBELocalPublisher()
           
 
Method Summary
static GCUBELocalPublisher getManager()
          Returns the local publisher
 boolean isEnabled(String resourceType, org.gcube.common.core.scope.GCUBEScope scope)
          Checks if the local publishing is enabled or not for the given scope
 void notifyResourceRegistered(org.gcube.common.core.resources.GCUBEResource resource, org.gcube.common.core.scope.GCUBEScope scope)
          Notifies that a @link GCUBEResource has been created
 void notifyResourceRemoved(String ID, String type, org.gcube.common.core.scope.GCUBEScope scope)
          Notifies that a @link GCUBEResource has been removed
 void notifyResourceUpdated(org.gcube.common.core.resources.GCUBEResource resource, org.gcube.common.core.scope.GCUBEScope scope)
          Notifies that a @link GCUBEResource has been updated
 void subscribeLocalProfileEvents(org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileConsumer consumer)
          Subscribes a consumer to all LocalProfileEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.gcube.common.core.utils.logging.GCUBELog logger

eventProducer

protected static org.gcube.common.core.utils.events.GCUBEProducer<org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileTopic,Object> eventProducer
Internal GCUBEProducer for LocalProfileEvent.

Constructor Detail

GCUBELocalPublisher

public GCUBELocalPublisher()
Method Detail

subscribeLocalProfileEvents

public void subscribeLocalProfileEvents(org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileConsumer consumer)
                                 throws GCUBEPublisherException
Subscribes a consumer to all LocalProfileEvent.

Specified by:
subscribeLocalProfileEvents in interface org.gcube.common.core.informationsystem.publisher.ISLocalPublisher
Parameters:
consumer - the consumer
Throws:
Exception - if the subscription could not be completed.
GCUBEPublisherException

getManager

public static GCUBELocalPublisher getManager()
Returns the local publisher

Returns:
the publisher

notifyResourceRemoved

public void notifyResourceRemoved(String ID,
                                  String type,
                                  org.gcube.common.core.scope.GCUBEScope scope)
                           throws Exception
Notifies that a @link GCUBEResource has been removed

Parameters:
resource - the resource
Throws:
Exception

notifyResourceRegistered

public void notifyResourceRegistered(org.gcube.common.core.resources.GCUBEResource resource,
                                     org.gcube.common.core.scope.GCUBEScope scope)
                              throws Exception
Notifies that a @link GCUBEResource has been created

Parameters:
resource - the resource
Throws:
Exception

notifyResourceUpdated

public void notifyResourceUpdated(org.gcube.common.core.resources.GCUBEResource resource,
                                  org.gcube.common.core.scope.GCUBEScope scope)
                           throws Exception
Notifies that a @link GCUBEResource has been updated

Parameters:
resource - the resource
Throws:
Exception

isEnabled

public boolean isEnabled(String resourceType,
                         org.gcube.common.core.scope.GCUBEScope scope)
Checks if the local publishing is enabled or not for the given scope

Specified by:
isEnabled in interface org.gcube.common.core.informationsystem.publisher.ISLocalPublisher
Parameters:
scope - the scope to check
Returns:
true if the local publishing is enabled, false otherwise


Copyright © 2013. All Rights Reserved.