Dekoh platform API

dekoh.portal.syndication.aggregator.core
Interface Aggregator

All Known Implementing Classes:
AggregatorImpl, AggregatorWrapper

public interface Aggregator

Aggregator is an interface for feed aggregator implementations which will aggregate feeds present in a SubscriptionList.

Three main responsibilities of an aggregator are

Feed Aggregation is ascheduled activity which repeats itself after a specific interval. Impelemntations should provide a mechanism so that on repeated aggregation only new feed entries are added to the aggregated feed.
After evaluating a new feed item, aggregator gives a callback so that applications can modify/transform the feed item before it becomes part of aggregated feed.

Since:
Oct 16, 2007

Method Summary
 void addAggregatedItemTransformer(AggregatedItemTransformer[] transformers)
           
 void destroy()
          Stops the scheduler if started , and if required cleans up the aggregated files and all the individual feeds that has been downloaded by the aggregator
 List getAggregatedItemTransformers()
           
 File getAggregatedRSSFeedXml()
           
 String getId()
           
 File getItemRSSFeedXml(String itemId)
          The location of the file where the downloaded subscription item feed will be available.
 long getLastAggregatedTime()
           
 long getLastModifiedTime()
           
 int getMaxItemsToAggregate()
           
 long getSchedulerFrequency()
           
 SubscriptionList getSubscriptionList()
           
 boolean isScheduled()
           
 void scheduleAggregation()
          Triggers a periodic aggregation that becomes enabled now, and subsequently repeats itself after a frequency.Implementatin can chose to have a defualt frequency or take in the the constructor

Generally this will be a one time call, However it can be used to start aggregation "now", to check for latest feeds

 void scheduleAggregation(long frequencyInMilliseconds)
          Triggers a periodic aggregation that becomes enabled now, and subsequently repeats itself after the specified frequency.
 void setMaxItemsToAggregate(int maxItemsToAggregate)
           
 void stopScheduler()
          Stops the scheduling of aggregator.
 

Method Detail

getId

String getId()
Returns:
An id which can be used to find this aggregator instance

scheduleAggregation

void scheduleAggregation()
Triggers a periodic aggregation that becomes enabled now, and subsequently repeats itself after a frequency.Implementatin can chose to have a defualt frequency or take in the the constructor

Generally this will be a one time call, However it can be used to start aggregation "now", to check for latest feeds

See Also:
Aggregator.scheduleAggregation(long)

scheduleAggregation

void scheduleAggregation(long frequencyInMilliseconds)
Triggers a periodic aggregation that becomes enabled now, and subsequently repeats itself after the specified frequency.

Generally this will be a one time call, However it can be used to reschedule the aggregation with a different frequency, or to wake up the aggregator from sleep and start aggrating now. After this is called any calls to scheduleAggregation() should happen with this new frequency

Parameters:
frequencyInMilliseconds - frequency with which aggregation will happen

isScheduled

boolean isScheduled()
Returns:
true if the aggregator is scheduled
false if aggregator was never scheduled or is stopped

stopScheduler

void stopScheduler()
Stops the scheduling of aggregator. The subscription items in the list will not be downloaded and aggregated any more

See Also:
Aggregator.scheduleAggregation(long)

getSchedulerFrequency

long getSchedulerFrequency()
Returns:
frequency in milliseconds at which the aggregator is scheduled, value of zero indicate that the aggregator was never scheduled or is stopeed.

destroy

void destroy()
Stops the scheduler if started , and if required cleans up the aggregated files and all the individual feeds that has been downloaded by the aggregator


getSubscriptionList

SubscriptionList getSubscriptionList()
Returns:
SubscriptionList which is scheduked for aggregation

getAggregatedRSSFeedXml

File getAggregatedRSSFeedXml()
Returns:
the file representing aggregated feed

getItemRSSFeedXml

File getItemRSSFeedXml(String itemId)
The location of the file where the downloaded subscription item feed will be available. This can be used if the applications desire to display each individual feeds

Parameters:
itemId - id of a subscription item in the list
Returns:
the downloaded feed for the subscription item

getLastAggregatedTime

long getLastAggregatedTime()
Returns:
time in milliseconds when the aggragation las happened

getLastModifiedTime

long getLastModifiedTime()
Returns:
time in millisecond when the aggregated feed was las modified

getMaxItemsToAggregate

int getMaxItemsToAggregate()
Returns:
maximum feed entries that will be part of aggregation

getAggregatedItemTransformers

List getAggregatedItemTransformers()
Returns:
the transformer which will be given a callback before a new feed entry is made part of aggregated item

addAggregatedItemTransformer

void addAggregatedItemTransformer(AggregatedItemTransformer[] transformers)
Parameters:
transformers - which will be given a callback before a new feed entry is made part of aggregated item

setMaxItemsToAggregate

void setMaxItemsToAggregate(int maxItemsToAggregate)
Parameters:
maxItemsToAggregate - maximum items that will be aggregated byu this aggregater. Aggregators may choose a policy to remove items from the aggregated feed if the total no of aggregated items exceeds this limit.

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers