org.gcube.informationsystem.collector.impl.state
Class AggregatorRegisteredResource

java.lang.Object
  extended by org.globus.mds.aggregator.impl.AggregatorServiceGroupResource
      extended by org.gcube.informationsystem.collector.impl.state.AggregatorRegisteredResource
All Implemented Interfaces:
ICRegisteredResource, org.globus.mds.aggregator.impl.AggregatorSink, org.globus.wsrf.impl.servicegroup.ServiceGroupRegistrationResource, org.globus.wsrf.impl.servicegroup.ServiceGroupResource, org.globus.wsrf.Resource, org.globus.wsrf.ResourceLifetime, org.globus.wsrf.ResourceProperties, org.globus.wsrf.TopicListAccessor

public class AggregatorRegisteredResource
extends org.globus.mds.aggregator.impl.AggregatorServiceGroupResource
implements org.globus.mds.aggregator.impl.AggregatorSink, ICRegisteredResource

This class implements an aggregating in-memory service group resource.
For every registered AggregatorSource instance one connected AggregatorRegisteredResource instance is created and it is delivered with its data, following the chosen registration mode (Push/Pull).

Author:
Manuele Simi (ISTI-CNR)

Field Summary
static javax.xml.namespace.QName RP_SET
           
 
Fields inherited from class org.globus.mds.aggregator.impl.AggregatorServiceGroupResource
DEFAULT_SWEEP_PERIOD, REGISTRATION_COUNT_RP
 
Constructor Summary
AggregatorRegisteredResource()
          Builds a new resource
 
Method Summary
 void deliver(org.apache.axis.encoding.AnyContentType messageObj, org.globus.mds.aggregator.impl.AggregatorServiceGroupEntryResource entry)
          Takes delivery of a message from an AggregatorSource.
 java.util.Calendar getCurrentTime()
          
 org.globus.wsrf.ResourceKey getResourceKey()
           
 org.globus.mds.aggregator.impl.AggregatorSource getSource()
          Gets the AggregatorSource connected to this sink
 java.util.Calendar getTerminationTime()
          
 org.globus.wsrf.TopicList getTopicList()
          
 void initialize(java.lang.Object parameters)
          Called to initialize any necessary state.
 void remove()
          Callback method invoked when the resource is removed by the Aggregator Framework
 void setResourceKey(org.globus.wsrf.ResourceKey k)
          Used to inform the resource of its key.
 void setSource(org.globus.mds.aggregator.impl.AggregatorSource source)
          Sets the AggregatorSource connected to this sink
 void setTerminationTime(java.util.Calendar time)
          Sets the termination time
 void terminate()
          Called to free resources used by the sink.
 
Methods inherited from class org.globus.mds.aggregator.impl.AggregatorServiceGroupResource
addAggregatorSource, getConfiguration, getKey, getResourcePropertySet, iterateEntryKeys, iterateEntryValues, loadCompatibleSources, notifyChange, serviceGroupAdd, setVersion
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.wsrf.ResourceProperties
getResourcePropertySet
 

Field Detail

RP_SET

public static final javax.xml.namespace.QName RP_SET
Constructor Detail

AggregatorRegisteredResource

public AggregatorRegisteredResource()
Builds a new resource

Method Detail

setResourceKey

public void setResourceKey(org.globus.wsrf.ResourceKey k)
                    throws java.lang.Exception
Used to inform the resource of its key.

Parameters:
k - the resource key
Throws:
java.lang.Exception - if the resource key is already set

getResourceKey

public org.globus.wsrf.ResourceKey getResourceKey()
Returns:
the resource key

setTerminationTime

public void setTerminationTime(java.util.Calendar time)
Sets the termination time

Specified by:
setTerminationTime in interface org.globus.wsrf.ResourceLifetime
Parameters:
time - the new termination time

getTerminationTime

public java.util.Calendar getTerminationTime()

Specified by:
getTerminationTime in interface org.globus.wsrf.ResourceLifetime

getCurrentTime

public java.util.Calendar getCurrentTime()

Specified by:
getCurrentTime in interface org.globus.wsrf.ResourceLifetime

getTopicList

public org.globus.wsrf.TopicList getTopicList()

Specified by:
getTopicList in interface org.globus.wsrf.TopicListAccessor

deliver

public void deliver(org.apache.axis.encoding.AnyContentType messageObj,
                    org.globus.mds.aggregator.impl.AggregatorServiceGroupEntryResource entry)
Takes delivery of a message from an AggregatorSource.
This is called by an AggregatorSource to deliver a message with the assumption that the message data will be aggregated as its native type and into whatever data storage format is used by the underlying AggregatorSink class.

Specified by:
deliver in interface org.globus.mds.aggregator.impl.AggregatorSink
Parameters:
messageObj - the message content
entry - the related service group entry

initialize

public void initialize(java.lang.Object parameters)
Called to initialize any necessary state.

Specified by:
initialize in interface org.globus.mds.aggregator.impl.AggregatorSink
Parameters:
parameters - any initialization parameters (not used)

setSource

public void setSource(org.globus.mds.aggregator.impl.AggregatorSource source)
Sets the AggregatorSource connected to this sink

Specified by:
setSource in interface org.globus.mds.aggregator.impl.AggregatorSink
Parameters:
source - the source

getSource

public org.globus.mds.aggregator.impl.AggregatorSource getSource()
Gets the AggregatorSource connected to this sink

Specified by:
getSource in interface org.globus.mds.aggregator.impl.AggregatorSink
Returns:
always null

terminate

public void terminate()
Called to free resources used by the sink.

Specified by:
terminate in interface org.globus.mds.aggregator.impl.AggregatorSink

remove

public void remove()
Callback method invoked when the resource is removed by the Aggregator Framework