if (keywords == null) {
throw new CamelExchangeException("No keywords to use for query", exchange);
}
Query query = new Query(keywords);
// filter of older tweets
if (te.getProperties().isFilterOld() && myLastId != 0) {
query.setSinceId(myLastId);
}
// language
String lang = exchange.getIn().getHeader(TwitterConstants.TWITTER_SEARCH_LANGUAGE, String.class);
if (lang == null) {
lang = te.getProperties().getLang();
}
if (ObjectHelper.isNotEmpty(lang)) {
query.setLang(lang);
}
// number of elemnt per page
Integer count = exchange.getIn().getHeader(TwitterConstants.TWITTER_COUNT, Integer.class);
if (count == null) {
count = te.getProperties().getCount();
}
if (ObjectHelper.isNotEmpty(count)) {
query.setCount(count);
}
// number of pages
Integer numberOfPages = exchange.getIn().getHeader(TwitterConstants.TWITTER_NUMBER_OF_PAGES, Integer.class);
if (numberOfPages == null) {