Class FeedEndpoint

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.support.DefaultPollingEndpoint
org.apache.camel.component.feed.FeedEndpoint
All Implemented Interfaces:
AutoCloseable, 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.support.DefaultPollingEndpoint
A base class for feed (atom, RSS) endpoints.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected boolean
     

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    FeedEndpoint(String endpointUri, FeedComponent component, String feedUri)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.camel.Consumer
    createConsumer(org.apache.camel.Processor processor)
     
    protected String
     
    protected abstract FeedPollingConsumer
    createEntryPollingConsumer(FeedEndpoint feedEndpoint, org.apache.camel.Processor processor, boolean throttleEntries)
     
    abstract org.apache.camel.Exchange
    Creates an Exchange with the entries as the in body.
    abstract org.apache.camel.Exchange
    Creates an Exchange with the given entry as the in body.
    protected org.apache.camel.Exchange
     
    protected abstract FeedPollingConsumer
    createPollingConsumer(FeedEndpoint feedEndpoint, org.apache.camel.Processor processor)
     
    org.apache.camel.Producer
     
     
     
     
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    void
    setFeedHeader(boolean feedHeader)
    Sets whether to add the feed object as a header
    void
    setFeedUri(String feedUri)
    The URI to the feed to poll.
    void
    setPassword(String password)
    Sets the password to be used for basic authentication when polling from a HTTP feed
    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.
    void
    setUsername(String username)
    Sets the username to be used for basic authentication when polling from a HTTP feed

    Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint

    configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay

    Methods inherited from class org.apache.camel.support.DefaultEndpoint

    configureExchange, configurePollingConsumer, createAsyncProducer, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, 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.Endpoint

    getEndpointBaseUri, isSingletonProducer

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Field Details

    • feedUri

      @UriPath(description="The URI to the feed to poll.") @Metadata(required=true) protected String feedUri
    • splitEntries

      @UriParam(defaultValue="true", description="Sets whether or not entries should be sent individually or whether the entire feed should be sent as a single message") protected boolean splitEntries
  • Constructor Details

    • FeedEndpoint

      public FeedEndpoint()
    • FeedEndpoint

      public FeedEndpoint(String endpointUri, FeedComponent component, String feedUri)
  • Method Details

    • 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.support.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 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.support.DefaultEndpoint
    • getEndpointKey

      public String getEndpointKey()
      Specified by:
      getEndpointKey in interface org.apache.camel.Endpoint
      Overrides:
      getEndpointKey in class org.apache.camel.support.DefaultEndpoint
    • getFeedUri

      public String getFeedUri()
    • setFeedUri

      public void setFeedUri(String feedUri)
      The URI to the feed to poll.
    • 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
    • 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.support.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 delay. Only applicable when splitEntries = true.
    • isThrottleEntries

      public boolean isThrottleEntries()
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
      Sets the username to be used for basic authentication when polling from a HTTP feed
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
      Sets the password to be used for basic authentication when polling from a HTTP feed