Package de.xima.fc.api.cache
Class FileCache
- java.lang.Object
-
- de.xima.fc.api.cache.AGenericDataCache
-
- de.xima.fc.api.cache.FileCache
-
public class FileCache extends AGenericDataCache
-
-
Constructor Summary
Constructors Constructor Description FileCache()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>>
byte[]cacheFileData(UserContext uc, T entity)
static <T extends IFileEntity<?,?>>
byte[]cacheFileEntityData(UserContext uc, T fileEntity)
static <TFile extends IFileEntity<?,?>>
IFileAdaptergetCachedFile(UserContext uc, TFile file)
Gets a file adapter that accesses the file data via the file cache (if the file is cacheable).static <TFileMeta extends IFileMetaEntity<?,?>>
IFileAdaptergetCachedFile(UserContext uc, TFileMeta fileMeta)
Gets a file adapter that accesses the file data via the file cache (if the file is cacheable).static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>>
byte[]getCachedFileData(UserContext uc, T entity)
static <TFileMeta extends IFileMetaEntity<?,?>>
byte[]getCachedFileData(UserContext uc, TFileMeta fileEntity)
Returns the cached file data if it exists within the file cache and is unchanged.static <T extends IFileEntity<?,?>>
byte[]getCachedFileEntityData(UserContext uc, T fileEntity)
static byte[]
getCachedResourceData(String cacheKey)
static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>>
byte[]getUncachedFileData(UserContext uc, T entity)
static <T extends IFileEntity<?,?>>
byte[]getUncachedFileEntityData(UserContext uc, T fileEntity)
static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>>
BinaryCacheModelreadCachedFileData(T entity)
static <T extends IFileEntity<?,?>>
BinaryCacheModelreadCachedFileEntityData(T fileEntity)
-
Methods inherited from class de.xima.fc.api.cache.AGenericDataCache
cacheData, readCachedData, readCachedData
-
-
-
-
Method Detail
-
getCachedFileData
public static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>> byte[] getCachedFileData(UserContext uc, T entity)
-
getCachedFileData
public static <TFileMeta extends IFileMetaEntity<?,?>> byte[] getCachedFileData(UserContext uc, TFileMeta fileEntity)
Returns the cached file data if it exists within the file cache and is unchanged. Reads the file data from the database and creates a cache entry otherwise.- Type Parameters:
TFileMeta
- type of the file entity.- Parameters:
uc
- user context for database transactionsfileEntity
- to get the data for.- Returns:
- the binary data of the file or
null
if it wasn't found. - Since:
- 8.2.0
-
getCachedFile
public static <TFileMeta extends IFileMetaEntity<?,?>> IFileAdapter getCachedFile(UserContext uc, TFileMeta fileMeta)
Gets a file adapter that accesses the file data via the file cache (if the file is cacheable).- Type Parameters:
TFileMeta
- type of the file entity.- Parameters:
uc
- user context for database transactionsfileMeta
- to get the file adapter for.- Returns:
- the file adapter for the given file.
- Since:
- 8.2.0
-
getCachedFileEntityData
public static <T extends IFileEntity<?,?>> byte[] getCachedFileEntityData(UserContext uc, T fileEntity)
-
getCachedFile
public static <TFile extends IFileEntity<?,?>> IFileAdapter getCachedFile(UserContext uc, TFile file)
Gets a file adapter that accesses the file data via the file cache (if the file is cacheable).- Type Parameters:
TFile
- type of the file entity.- Parameters:
uc
- user context for database transactionsfile
- to get the file adapter for.- Returns:
- the file adapter for the given file.
- Since:
- 8.2.0
-
getUncachedFileEntityData
public static <T extends IFileEntity<?,?>> byte[] getUncachedFileEntityData(UserContext uc, T fileEntity)
-
getUncachedFileData
public static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>> byte[] getUncachedFileData(UserContext uc, T entity)
-
readCachedFileData
public static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>> BinaryCacheModel readCachedFileData(T entity)
-
readCachedFileEntityData
public static <T extends IFileEntity<?,?>> BinaryCacheModel readCachedFileEntityData(T fileEntity)
-
cacheFileEntityData
public static <T extends IFileEntity<?,?>> byte[] cacheFileEntityData(UserContext uc, T fileEntity)
-
cacheFileData
public static <E extends IFileDataEntity<?>,T extends IFileProviding<?,E>> byte[] cacheFileData(UserContext uc, T entity)
-
getCachedResourceData
public static byte[] getCachedResourceData(String cacheKey)
-
-