org.apache.camel.component.feed
Class FeedEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      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:
org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
Direct Known Subclasses:
AtomEndpoint

public abstract class FeedEndpoint
extends org.apache.camel.impl.DefaultPollingEndpoint

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


Field Summary
protected  String feedUri
           
protected  boolean filter
           
protected  Date lastUpdate
           
protected  boolean splitEntries
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
FeedEndpoint()
           
FeedEndpoint(String endpointUri, FeedComponent component, String feedUri)
           
 
Method Summary
 org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
           
protected  String createEndpointUri()
           
protected abstract  FeedPollingConsumer createEntryPollingConsumer(FeedEndpoint feedEndpoint, org.apache.camel.Processor processor, boolean filter, Date lastUpdate, boolean throttleEntries)
           
abstract  org.apache.camel.Exchange createExchange(Object feed)
          Creates an Exchange with the entries as the in body.
abstract  org.apache.camel.Exchange createExchange(Object feed, Object entry)
          Creates an Exchange with the given entry as the in body.
protected  org.apache.camel.Exchange createExchangeWithFeedHeader(Object feed, String header)
           
protected abstract  FeedPollingConsumer createPollingConsumer(FeedEndpoint feedEndpoint, org.apache.camel.Processor processor)
           
 org.apache.camel.Producer createProducer()
           
 String getEndpointKey()
           
 String getFeedUri()
           
 Date getLastUpdate()
           
 boolean isFeedHeader()
           
 boolean isFilter()
           
 boolean isLenientProperties()
           
 boolean isSingleton()
           
 boolean isSortEntries()
           
 boolean isSplitEntries()
           
 boolean isThrottleEntries()
           
 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
 void setThrottleEntries(boolean throttleEntries)
          Sets whether all entries identified in a single feed poll should be delivered immediately.
 
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint
configurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, createEndpointConfiguration, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointUri, getExchangePattern, getId, hashCode, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setProperties, setSynchronous, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

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)
Method Detail

isSingleton

public boolean isSingleton()

createProducer

public org.apache.camel.Producer createProducer()
                                         throws Exception
Throws:
Exception

createConsumer

public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
                                         throws Exception
Specified by:
createConsumer in interface org.apache.camel.Endpoint
Overrides:
createConsumer in class org.apache.camel.impl.DefaultPollingEndpoint
Throws:
Exception

createPollingConsumer

protected abstract FeedPollingConsumer createPollingConsumer(FeedEndpoint feedEndpoint,
                                                             org.apache.camel.Processor processor)
                                                      throws Exception
Throws:
Exception

createEntryPollingConsumer

protected abstract FeedPollingConsumer createEntryPollingConsumer(FeedEndpoint feedEndpoint,
                                                                  org.apache.camel.Processor processor,
                                                                  boolean filter,
                                                                  Date lastUpdate,
                                                                  boolean throttleEntries)
                                                           throws Exception
Throws:
Exception

createExchangeWithFeedHeader

protected org.apache.camel.Exchange createExchangeWithFeedHeader(Object feed,
                                                                 String header)

createExchange

public abstract org.apache.camel.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 org.apache.camel.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 org.apache.camel.impl.DefaultEndpoint

getEndpointKey

public String getEndpointKey()
Specified by:
getEndpointKey in interface org.apache.camel.Endpoint
Overrides:
getEndpointKey in class org.apache.camel.impl.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 org.apache.camel.Endpoint
Overrides:
isLenientProperties in class org.apache.camel.impl.DefaultEndpoint

setThrottleEntries

public void setThrottleEntries(boolean throttleEntries)
Sets whether all entries identified in a single feed poll should be delivered immediately. If true, only one entry is processed per consumer.delay. Only applicable when splitEntries = true.


isThrottleEntries

public boolean isThrottleEntries()


Apache Camel