public interface

CacheableAvatarSupplier

implements AvatarSupplier
com.atlassian.bitbucket.avatar.CacheableAvatarSupplier
Known Indirect Subclasses

Class Overview

Augments the AvatarSupplier with timestamp information that can be used to control caching, or to simply display a modification date indicating when the avatar was last updated.

Summary

Constants
int TIMESTAMP_ETERNAL Marker value to be returned by getTimestamp() for avatars which cannot be modified.
int TIMESTAMP_UNKNOWN Marker value to be returned by getTimestamp() for avatars whose modification timestamp cannot be determined by the system.
Public Methods
long getTimestamp()
The timestamp at which the avatar was last modified, in milliseconds.
[Expand]
Inherited Methods
From interface com.atlassian.bitbucket.avatar.AvatarSupplier
From interface com.atlassian.bitbucket.io.InputSupplier

Constants

public static final int TIMESTAMP_ETERNAL

Marker value to be returned by getTimestamp() for avatars which cannot be modified.

Constant Value: -1 (0xffffffff)

public static final int TIMESTAMP_UNKNOWN

Marker value to be returned by getTimestamp() for avatars whose modification timestamp cannot be determined by the system.

Constant Value: 0 (0x00000000)

Public Methods

public 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