use of org.codelibs.fess.es.config.exentity.ThumbnailQueue in project fess by codelibs.
the class ThumbnailManager method storeQueue.
protected void storeQueue(final List<Tuple4<String, String, String, String>> taskList) {
final FessConfig fessConfig = ComponentUtil.getFessConfig();
final SystemHelper systemHelper = ComponentUtil.getSystemHelper();
final String[] targets = fessConfig.getThumbnailGeneratorTargetsAsArray();
final List<ThumbnailQueue> list = new ArrayList<>();
taskList.stream().filter(entity -> entity != null).forEach(task -> {
for (final String target : targets) {
final ThumbnailQueue entity = new ThumbnailQueue();
entity.setGenerator(task.getValue1());
entity.setThumbnailId(task.getValue2());
entity.setUrl(task.getValue3());
entity.setPath(task.getValue4());
entity.setTarget(target);
entity.setCreatedBy(Constants.SYSTEM_USER);
entity.setCreatedTime(systemHelper.getCurrentTimeAsLong());
list.add(entity);
}
});
taskList.clear();
final ThumbnailQueueBhv thumbnailQueueBhv = ComponentUtil.getComponent(ThumbnailQueueBhv.class);
thumbnailQueueBhv.batchInsert(list);
}
Aggregations