Search in sources :

Example 1 with ThumbnailQueue

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);
}
Also used : ThumbnailQueueBhv(org.codelibs.fess.es.config.exbhv.ThumbnailQueueBhv) Constants(org.codelibs.fess.Constants) DocumentUtil(org.codelibs.fess.util.DocumentUtil) FessSystemException(org.codelibs.fess.exception.FessSystemException) LoggerFactory(org.slf4j.LoggerFactory) HashMap(java.util.HashMap) LruHashMap(org.codelibs.core.collection.LruHashMap) LaRequestUtil(org.lastaflute.web.util.LaRequestUtil) ArrayList(java.util.ArrayList) ThumbnailQueue(org.codelibs.fess.es.config.exentity.ThumbnailQueue) PreDestroy(javax.annotation.PreDestroy) ResourceUtil(org.codelibs.fess.util.ResourceUtil) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig) Lists(com.google.common.collect.Lists) Map(java.util.Map) JobProcessingException(org.codelibs.fess.exception.JobProcessingException) Path(java.nio.file.Path) HttpSession(javax.servlet.http.HttpSession) Tuple4(org.codelibs.core.misc.Tuple4) Logger(org.slf4j.Logger) FileVisitor(java.nio.file.FileVisitor) Files(java.nio.file.Files) StringUtil(org.codelibs.core.lang.StringUtil) IOException(java.io.IOException) BlockingQueue(java.util.concurrent.BlockingQueue) BasicFileAttributes(java.nio.file.attribute.BasicFileAttributes) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) FileVisitResult(java.nio.file.FileVisitResult) List(java.util.List) ComponentUtil(org.codelibs.fess.util.ComponentUtil) SystemHelper(org.codelibs.fess.helper.SystemHelper) PostConstruct(javax.annotation.PostConstruct) ThumbnailQueueBhv(org.codelibs.fess.es.config.exbhv.ThumbnailQueueBhv) SystemHelper(org.codelibs.fess.helper.SystemHelper) ArrayList(java.util.ArrayList) ThumbnailQueue(org.codelibs.fess.es.config.exentity.ThumbnailQueue) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig)

Aggregations

Lists (com.google.common.collect.Lists)1 File (java.io.File)1 IOException (java.io.IOException)1 FileVisitResult (java.nio.file.FileVisitResult)1 FileVisitor (java.nio.file.FileVisitor)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 BasicFileAttributes (java.nio.file.attribute.BasicFileAttributes)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 BlockingQueue (java.util.concurrent.BlockingQueue)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 TimeUnit (java.util.concurrent.TimeUnit)1 PostConstruct (javax.annotation.PostConstruct)1 PreDestroy (javax.annotation.PreDestroy)1 HttpSession (javax.servlet.http.HttpSession)1 LruHashMap (org.codelibs.core.collection.LruHashMap)1 StringUtil (org.codelibs.core.lang.StringUtil)1