Enum Class RecentPreviewCacheService.Unavailable
java.lang.Object
java.lang.Enum<RecentPreviewCacheService.Unavailable>
dev.turboism.sdk.cubism.recentpreview.RecentPreviewCacheService.Unavailable
- All Implemented Interfaces:
RecentPreviewCacheService,Serializable,Comparable<RecentPreviewCacheService.Unavailable>,Constable
- Enclosing interface:
- RecentPreviewCacheService
public static enum RecentPreviewCacheService.Unavailable
extends Enum<RecentPreviewCacheService.Unavailable>
implements RecentPreviewCacheService
Fail-closed implementation returned by
RecentPreviewCacheService.unavailable().-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface dev.turboism.sdk.cubism.recentpreview.RecentPreviewCacheService
RecentPreviewCacheService.DeletionHandler, RecentPreviewCacheService.ReplayHandler, RecentPreviewCacheService.Unavailable -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiondelete(RecentFileId id) Deletes the cached preview of one recent file.booleanReports whether a live runtime surface backs this instance.Registers the handler that performs deletions.provide(RecentPreviewCacheService.DeletionHandler deletionHandler, RecentPreviewCacheService.ReplayHandler replayHandler) Registers deletion and cache-replay handlers for the active provider generation.Requests the active provider to replay its cached previews to subscribers.Returns the enum constant of this class with the specified name.values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isAvailable
public boolean isAvailable()Description copied from interface:RecentPreviewCacheServiceReports whether a live runtime surface backs this instance.- Specified by:
isAvailablein interfaceRecentPreviewCacheService- Returns:
falsefor theRecentPreviewCacheService.unavailable()sentinel
-
delete
Description copied from interface:RecentPreviewCacheServiceDeletes the cached preview of one recent file.- Specified by:
deletein interfaceRecentPreviewCacheService- Parameters:
id- opaque recent-file identity- Returns:
- a stage completing with
truewhen an entry existed and was removed,falsewhen nothing was cached or no provider is registered; the stage may complete exceptionally when the underlying storage fails
-
provide
Description copied from interface:RecentPreviewCacheServiceRegisters the handler that performs deletions. Only one provider may register; the registration ends with the provider's plugin generation.- Specified by:
providein interfaceRecentPreviewCacheService- Parameters:
handler- performs one deletion and reports whether an entry was removed- Returns:
- registration whose close removes the handler
-
provide
public Registration provide(RecentPreviewCacheService.DeletionHandler deletionHandler, RecentPreviewCacheService.ReplayHandler replayHandler) Description copied from interface:RecentPreviewCacheServiceRegisters deletion and cache-replay handlers for the active provider generation.The default implementation keeps a provider that only implements
RecentPreviewCacheService.provide(DeletionHandler)source compatible: replay requests then complete without publishing anything, so a dependent must treat a missing replay as "no cached previews".- Specified by:
providein interfaceRecentPreviewCacheService- Parameters:
deletionHandler- performs one deletion and reports whether an entry was removedreplayHandler- replays cached preview events to dependent plugins- Returns:
- registration whose close removes both handlers
-
requestReplay
Description copied from interface:RecentPreviewCacheServiceRequests the active provider to replay its cached previews to subscribers.- Specified by:
requestReplayin interfaceRecentPreviewCacheService- Returns:
- a stage completing once the replay finishes, or immediately when no provider is registered
-