CacheService.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package cn.keking.service.cache;
  2. import java.util.List;
  3. import java.util.Map;
  4. /**
  5. * @author: chenjh
  6. * @since: 2019/4/2 16:45
  7. */
  8. public interface CacheService {
  9. String FILE_PREVIEW_PDF_KEY = "converted-preview-pdf-file";
  10. String FILE_PREVIEW_IMGS_KEY = "converted-preview-imgs-file";//压缩包内图片文件集合
  11. String FILE_PREVIEW_PDF_IMGS_KEY = "converted-preview-pdfimgs-file";
  12. String FILE_PREVIEW_MEDIA_CONVERT_KEY = "converted-preview-media-file";
  13. String TASK_QUEUE_NAME = "convert-task";
  14. Integer DEFAULT_PDF_CAPACITY = 500000;
  15. Integer DEFAULT_IMG_CAPACITY = 500000;
  16. Integer DEFAULT_PDFIMG_CAPACITY = 500000;
  17. Integer DEFAULT_MEDIACONVERT_CAPACITY = 500000;
  18. void initPDFCachePool(Integer capacity);
  19. void initIMGCachePool(Integer capacity);
  20. void initPdfImagesCachePool(Integer capacity);
  21. void initMediaConvertCachePool(Integer capacity);
  22. void putPDFCache(String key, String value);
  23. void putImgCache(String key, List<String> value);
  24. Map<String, String> getPDFCache();
  25. String getPDFCache(String key);
  26. Map<String, List<String>> getImgCache();
  27. List<String> getImgCache(String key);
  28. Integer getPdfImageCache(String key);
  29. void putPdfImageCache(String pdfFilePath, int num);
  30. Map<String, String> getMediaConvertCache();
  31. void putMediaConvertCache(String key, String value);
  32. String getMediaConvertCache(String key);
  33. void cleanCache();
  34. void addQueueTask(String url);
  35. String takeQueueTask() throws InterruptedException;
  36. }