org.apache.camel.component.feed
Class FeedEndpoint

java.lang.Object
  extended by org.apache.camel.impl.DefaultEndpoint
      extended by org.apache.camel.impl.ScheduledPollEndpoint
          extended by org.apache.camel.impl.DefaultPollingEndpoint
              extended by org.apache.camel.component.feed.FeedEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton
Direct Known Subclasses:
AtomEndpoint

public abstract class FeedEndpoint
extends DefaultPollingEndpoint

A base class for feed (atom, RSS) endpoints.


Field Summary
protected  String feedUri
           
protected  boolean filter
           
protected  Date lastUpdate
           
protected  boolean splitEntries
           
 
Constructor Summary
FeedEndpoint()
           
FeedEndpoint(String endpointUri)
           
FeedEndpoint(String endpointUri, FeedComponent component, String feedUri)
           
FeedEndpoint(String endpointUri, String feedUri)
           
 
Method Summary
 Consumer createConsumer(Processor processor)
           
protected  String createEndpointUri()
           
protected abstract  FeedPollingConsumer createEntryPollingConsumer(FeedEndpoint feedEndpoint, Processor processor, boolean filter, Date lastUpdate)
           
abstract  Exchange createExchange(Object feed)
          Creates an Exchange with the entries as the in body.
abstract  Exchange createExchange(Object feed, Object entry)
          Creates an Exchange with the given entry as the in body.
protected  Exchange createExchangeWithFeedHeader(Object feed, String header)
           
protected abstract  FeedPollingConsumer createPollingConsumer(FeedEndpoint feedEndpoint, Processor processor)
           
 Producer createProducer()
           
 String getEndpointKey()
           
 String getFeedUri()
           
 Date getLastUpdate()
           
 boolean isFeedHeader()
           
 boolean isFilter()
           
 boolean isLenientProperties()
           
 boolean isSingleton()
           
 boolean isSortEntries()
           
 boolean isSplitEntries()
           
 void setFeedHeader(boolean feedHeader)
          Sets whether to add the feed object as a header
 void setFeedUri(String feedUri)
           
 void setFilter(boolean filter)
          Sets whether to use filtering or not of the entries.
 void setLastUpdate(Date lastUpdate)
          Sets the timestamp to be used for filtering entries from the atom feeds.
 void setSortEntries(boolean sortEntries)
          Sets whether to sort entries by published date.
 void setSplitEntries(boolean splitEntries)
          Sets whether or not entries should be sent individually or whether the entire feed should be sent as a single message
 
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint
configureConsumer, configureProperties, getConsumerProperties, setConsumerProperties
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
createExchange, createExchange, createExchange, createPollingConsumer, createScheduledExecutorService, equals, getCamelContext, getComponent, getEndpointUri, getExchangePattern, getExchangeType, getExecutorService, getScheduledExecutorService, hashCode, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setExecutorService, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

feedUri

protected String feedUri

splitEntries

protected boolean splitEntries

lastUpdate

protected Date lastUpdate

filter

protected boolean filter
Constructor Detail

FeedEndpoint

public FeedEndpoint()

FeedEndpoint

public FeedEndpoint(String endpointUri,
                    FeedComponent component,
                    String feedUri)

FeedEndpoint

public FeedEndpoint(String endpointUri,
                    String feedUri)

FeedEndpoint

public FeedEndpoint(String endpointUri)
Method Detail

isSingleton

public boolean isSingleton()

createProducer

public Producer createProducer()
                        throws Exception
Throws:
Exception

createConsumer

public Consumer createConsumer(Processor processor)
                        throws Exception
Specified by:
createConsumer in interface Endpoint
Overrides:
createConsumer in class DefaultPollingEndpoint
Throws:
Exception

createPollingConsumer

protected abstract FeedPollingConsumer createPollingConsumer(FeedEndpoint feedEndpoint,
                                                             Processor processor)

createEntryPollingConsumer

protected abstract FeedPollingConsumer createEntryPollingConsumer(FeedEndpoint feedEndpoint,
                                                                  Processor processor,
                                                                  boolean filter,
                                                                  Date lastUpdate)

createExchangeWithFeedHeader

protected Exchange createExchangeWithFeedHeader(Object feed,
                                                String header)

createExchange

public abstract Exchange createExchange(Object feed)
Creates an Exchange with the entries as the in body.

Parameters:
feed - the atom feed
Returns:
the created exchange

createExchange

public abstract Exchange createExchange(Object feed,
                                        Object entry)
Creates an Exchange with the given entry as the in body.

Parameters:
feed - the feed
entry - the entry as the in body
Returns:
the created exchange

createEndpointUri

protected String createEndpointUri()
Overrides:
createEndpointUri in class DefaultEndpoint

getEndpointKey

public String getEndpointKey()
Specified by:
getEndpointKey in interface Endpoint
Overrides:
getEndpointKey in class DefaultEndpoint

getFeedUri

public String getFeedUri()

setFeedUri

public void setFeedUri(String feedUri)

isSplitEntries

public boolean isSplitEntries()

setSplitEntries

public void setSplitEntries(boolean splitEntries)
Sets whether or not entries should be sent individually or whether the entire feed should be sent as a single message


getLastUpdate

public Date getLastUpdate()

setLastUpdate

public void setLastUpdate(Date lastUpdate)
Sets the timestamp to be used for filtering entries from the atom feeds. This options is only in conjunction with the splitEntries.


isFilter

public boolean isFilter()

setFilter

public void setFilter(boolean filter)
Sets whether to use filtering or not of the entries.


setFeedHeader

public void setFeedHeader(boolean feedHeader)
Sets whether to add the feed object as a header


isFeedHeader

public boolean isFeedHeader()

setSortEntries

public void setSortEntries(boolean sortEntries)
Sets whether to sort entries by published date. Only works when splitEntries = true.


isSortEntries

public boolean isSortEntries()

isLenientProperties

public boolean isLenientProperties()
Specified by:
isLenientProperties in interface Endpoint
Overrides:
isLenientProperties in class DefaultEndpoint


Copyright © 2007-2009 The Apache Software Foundation. All Rights Reserved.