Package com.atlassian.jira.avatar
Interface AvatarStore
- All Known Implementing Classes:
CachingTaggingAvatarStore
public interface AvatarStore
Persistent storage mechanism for
AvatarImpl.- Since:
- v4.0
-
Method Summary
Modifier and TypeMethodDescriptionCreates an avatar with the properties of the given avatar.booleanPermanently removes the avatar from the system.getAllSystemAvatars(IconType iconType) Provides a list of all system avatars.Retrieves the Avatar by id.getByIdTagged(Long avatarId) Retrieves the Avatar by id, ensuring the avatar file is tagged with metadata identifying the image came from JIRA.getCustomAvatarsForOwner(IconType iconType, String ownerId) Provides a list of all avatars that are of the given type which have the given owner.getSystemAvatarsForFilename(IconType iconType, String filename) Get the system icon with a particular filename.voidUpdates an avatar's properties to match those in the given avatar.
-
Method Details
-
getById
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.
-
getByIdTagged
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.
-
delete
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.
-
update
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.
-
create
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.
-
getAllSystemAvatars
Provides a list of all system avatars.- Parameters:
iconType- the types of avatar to retrieve- Returns:
- the system avatars, never null.
- Throws:
DataAccessException- if there is a back-end database problem.- Since:
- v7.1
-
getCustomAvatarsForOwner
Provides a list of all avatars that are of the given type which have the given owner.- Parameters:
iconType- 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.- Since:
- v7.1
-
getSystemAvatarsForFilename
List<Avatar> getSystemAvatarsForFilename(IconType iconType, String filename) throws DataAccessException Get the system icon with a particular filename.- Parameters:
iconType- The type of icon to return.filename- The filename.- Returns:
- The list of icons.
- Throws:
DataAccessException- back end DB problem.
-