Search in sources :

Example 1 with DropboxScheduledPollSearchConsumer

use of org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollSearchConsumer in project camel by apache.

the class DropboxEndpoint method createConsumer.

/**
     * Create one of the camel consumer available based on the configuration
     * @param processor  the given processor
     * @return the camel consumer
     * @throws Exception
     */
public Consumer createConsumer(Processor processor) throws Exception {
    LOG.trace("Resolve consumer dropbox endpoint {" + configuration.getOperation().toString() + "}");
    LOG.trace("Resolve consumer dropbox attached client:" + configuration.getClient());
    DropboxScheduledPollConsumer consumer;
    if (this.configuration.getOperation() == DropboxOperation.search) {
        consumer = new DropboxScheduledPollSearchConsumer(this, processor, configuration);
        consumer.setDelay(POLL_CONSUMER_DELAY);
        return consumer;
    } else if (this.configuration.getOperation() == DropboxOperation.get) {
        consumer = new DropboxScheduledPollGetConsumer(this, processor, configuration);
        consumer.setDelay(POLL_CONSUMER_DELAY);
        return consumer;
    } else {
        throw new DropboxException("Operation specified is not valid for consumer!");
    }
}
Also used : DropboxScheduledPollSearchConsumer(org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollSearchConsumer) DropboxException(org.apache.camel.component.dropbox.util.DropboxException) DropboxScheduledPollGetConsumer(org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollGetConsumer) DropboxScheduledPollConsumer(org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollConsumer)

Aggregations

DropboxScheduledPollConsumer (org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollConsumer)1 DropboxScheduledPollGetConsumer (org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollGetConsumer)1 DropboxScheduledPollSearchConsumer (org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollSearchConsumer)1 DropboxException (org.apache.camel.component.dropbox.util.DropboxException)1