public class

CachingTaggingAvatarStore

extends Object
implements AvatarStore
java.lang.Object
   ↳ com.atlassian.jira.avatar.CachingTaggingAvatarStore

Class Overview

Avatar store which converts legacy avatar files to the new tagged format during retrieval

Summary

Constants
String AVATAR_ENTITY
String AVATAR_TYPE
String CONTENT_TYPE
String FILE_NAME
String ID
String OWNER
String SYSTEM_AVATAR
Public Constructors
CachingTaggingAvatarStore(OfBizDelegator ofBizDelegator, AvatarTagger avatarTagger, CacheManager cacheManager)
Public Methods
Avatar create(Avatar avatar)
Creates an avatar with the properties of the given avatar.
boolean delete(Long avatarId)
Permanently removes the avatar from the system.
List<Avatar> getAllSystemAvatars(Avatar.Type type)
Provides a list of all system avatars.
Avatar getById(Long avatarId)
Retrieves the Avatar by id.
Avatar getByIdTagged(Long avatarId)
Retrieves the Avatar by id, ensuring the avatar file is tagged with metadata identifying the image came from JIRA.
List<Avatar> getCustomAvatarsForOwner(Avatar.Type type, String ownerId)
Provides a list of all avatars that are of the given type which have the given owner.
void update(Avatar avatar)
Updates an avatar's properties to match those in the given avatar.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.avatar.AvatarStore

Constants

public static final String AVATAR_ENTITY

Constant Value: "Avatar"

public static final String AVATAR_TYPE

Constant Value: "avatarType"

public static final String CONTENT_TYPE

Constant Value: "contentType"

public static final String FILE_NAME

Constant Value: "fileName"

public static final String ID

Constant Value: "id"

public static final String OWNER

Constant Value: "owner"

public static final String SYSTEM_AVATAR

Constant Value: "systemAvatar"

Public Constructors

public CachingTaggingAvatarStore (OfBizDelegator ofBizDelegator, AvatarTagger avatarTagger, CacheManager cacheManager)

Public Methods

public Avatar create (Avatar avatar)

Creates an avatar with the properties of the given avatar.

Parameters
avatar the to create, must not be null, must have a null id.
Returns
  • the avatar with the given id or null if it doesn't exist.

public boolean delete (Long avatarId)

Permanently removes the avatar from the system.

Parameters
avatarId the avatar's id, must not be null.
Returns
  • the avatar with the given id or null if it doesn't exist.

public List<Avatar> getAllSystemAvatars (Avatar.Type type)

Provides a list of all system avatars.

Parameters
type the types of avatar to retrieve
Returns
  • the system avatars, never null.

public Avatar getById (Long avatarId)

Retrieves the Avatar by id.

Parameters
avatarId the avatar's id, must not be null.
Returns
  • the avatar with the given id or null if it doesn't exist.

public Avatar getByIdTagged (Long avatarId)

Retrieves the Avatar by id, ensuring the avatar file is tagged with metadata identifying the image came from JIRA.

Parameters
avatarId the avatar's id, must not be null.
Returns
  • the avatar with the given id or null if it doesn't exist.

public List<Avatar> getCustomAvatarsForOwner (Avatar.Type type, String ownerId)

Provides a list of all avatars that are of the given type which have the given owner.

Parameters
type the desired type of the avatars to retrieve.
ownerId the id of the owner, matches the type (project id or user key).
Returns
  • all the avatars that have the given type and owner, never null.

public void update (Avatar avatar)

Updates an avatar's properties to match those in the given avatar. The avatar too change is identified by the id of the given avatar.

Parameters
avatar the avatar to update, must not be null.