public interface

AvatarStore

com.atlassian.jira.avatar.AvatarStore
Known Indirect Subclasses

Class Overview

Persistent storage mechanism for AvatarImpl.

Summary

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.

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.
Throws
DataAccessException if there is a back-end storage problem.

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.
Throws
DataAccessException if there is a back-end storage problem.

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.
Throws
DataAccessException if there is a back-end database problem.

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.
Throws
DataAccessException if there is a back-end storage problem.

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.
Throws
DataAccessException if there is a back-end storage problem.

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.
Throws
DataAccessException if there is a back-end database problem.

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.
Throws
DataAccessException if there is a back-end storage problem.