Package com.atlassian.bamboo.avatar
Interface CacheableAvatarSupplier
-
- All Superinterfaces:
AvatarSupplier,InputSupplier<InputStream>
- All Known Implementing Classes:
DelegatingCacheableAvatarSupplier
public interface CacheableAvatarSupplier extends AvatarSupplier
Augments theAvatarSupplierwith timestamp information that can be used to control caching, or to simply display a modification date indicating when the avatar was last updated.- Since:
- 9.5
-
-
Field Summary
Fields Modifier and Type Field Description static intTIMESTAMP_ETERNALMarker value to be returned bygetTimestamp()for avatars which cannot be modified.static intTIMESTAMP_UNKNOWNMarker value to be returned bygetTimestamp()for avatars whose modification timestamp cannot be determined by the system.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetTimestamp()The timestamp at which the avatar was last modified, in milliseconds.-
Methods inherited from interface com.atlassian.bamboo.avatar.AvatarSupplier
getContentType, open
-
-
-
-
Field Detail
-
TIMESTAMP_ETERNAL
static final int TIMESTAMP_ETERNAL
Marker value to be returned bygetTimestamp()for avatars which cannot be modified.- See Also:
- Constant Field Values
-
TIMESTAMP_UNKNOWN
static final int TIMESTAMP_UNKNOWN
Marker value to be returned bygetTimestamp()for avatars whose modification timestamp cannot be determined by the system.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTimestamp
long getTimestamp()
The timestamp at which the avatar was last modified, in milliseconds.To account for differences in avatar repository implementations:
- If timestamp information is not available, implementations shall return
TIMESTAMP_UNKNOWN. Avatars without timestamps should not be cached, as it may not be possible to reliably detect updates. - If the avatar cannot be updated, implementations shall return
TIMESTAMP_ETERNAL. Such avatars may be cached more aggressively, as they cannot change.
- Returns:
- the avatar's modification timestamp in milliseconds, or
TIMESTAMP_UNKNOWNif no modification date is available, orTIMESTAMP_ETERNALif the avatar is unmodifiable
- If timestamp information is not available, implementations shall return
-
-