use of org.apache.camel.component.dropbox.integration.consumer.DropboxScheduledPollConsumer 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!");
}
}
Aggregations