org.globus.mds.aggregator.impl
Interface AggregatorSink

All Known Implementing Classes:
ServiceGroupEntryAggregatorSink

public interface AggregatorSink

This interface must be implemented by a plugin for the AggregatorSource component of the aggregator and is generally type-specific to the message data being processed. It is a required parameter for any AggregatorSource. Also, for every AggregatorSource instance there can be only one connected AggregatorSink instance.


Method Summary
 void deliver(AnyContentType message, AggregatorServiceGroupEntryResource context)
          Should be 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.
 AggregatorSource getSource()
          Gets the AggregatorSource connected to this sink
 void initialize(Object parameters)
          Called to initialize any necessary state.
 void setSource(AggregatorSource source)
          Sets the AggregatorSource connected to this sink
 void terminate()
          Called to free resources used by the sink.
 

Method Detail

initialize

public void initialize(Object parameters)
                throws AggregatorException,
                       Exception
Called to initialize any necessary state. This method should throw an exception if the host AggregatorSource is not set. The underlying implementation may also throw an exception during initialization if it is not compatible with the host AggregationSource. The implementation may use the optional parameters Object to read implementation specific data or can just ignore processing it altogether. TODO: add custom exceptions here like SourceNotSet and SourceTypeNotSupported

Throws:
AggregatorException
Exception

terminate

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


getSource

public AggregatorSource getSource()
Gets the AggregatorSource connected to this sink


setSource

public void setSource(AggregatorSource source)
Sets the AggregatorSource connected to this sink


deliver

public void deliver(AnyContentType message,
                    AggregatorServiceGroupEntryResource context)
             throws AggregatorException,
                    Exception
Should be 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. The context parameter is the AggregatorServiceGroupEntryResource context parameter passed to the hosting AggregationSource when the AggregationSource.addAggregation method is invoked.

Throws:
AggregatorException
Exception