Package jetbrains.buildServer.util
Interface BinaryDataCache
-
- All Known Implementing Classes:
PersistentBinaryDataCache
public interface BinaryDataCacheRepresents a cache for storing streamable binary data. The keys of cached data are strings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceBinaryDataCache.EntryRepresents a data element stored in the cache
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BinaryDataCache.Entryget(String key)Returns the content element associated with the key.booleanhasEntry(String key)Whether some value with the key is present in the cachevoidinvalidate(String key)Invalidates the data associated with the key.voidput(String key, InputStream stream)Stores the data presented by the stream object for the given key.voidputBytes(String key, byte[] bytes)Stores the data presented by the byte array for the given key.
-
-
-
Method Detail
-
get
@Nullable BinaryDataCache.Entry get(@NotNull String key)
Returns the content element associated with the key.- Parameters:
key- the key- Returns:
- the element or null if no entry is present in the cache.
-
put
void put(@NotNull String key, @Nullable InputStream stream)Stores the data presented by the stream object for the given key. The caller is responsible for closing the stream.- Parameters:
key- the keystream- the data stream. Null is acceptable.
-
putBytes
void putBytes(@NotNull String key, @Nullable byte[] bytes)Stores the data presented by the byte array for the given key. Usingput(String, java.io.InputStream)is preferable unless you have binary data in memory.- Parameters:
key- the keybytes- the data. Null is acceptable.
-
invalidate
void invalidate(@NotNull String key)Invalidates the data associated with the key.- Parameters:
key- the key
-
hasEntry
boolean hasEntry(@NotNull String key)Whether some value with the key is present in the cache- Parameters:
key- the key- Returns:
- true if present (even null) and false otherwise
-
-