Interface AvatarStore

All Known Implementing Classes:
CachingTaggingAvatarStore

public interface AvatarStore
Persistent storage mechanism for AvatarImpl.
Since:
v4.0
  • Method Details

    • getById

      Avatar getById(Long avatarId) throws DataAccessException
      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

      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.
    • delete

      boolean delete(Long avatarId) throws DataAccessException
      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

      void update(Avatar avatar) throws DataAccessException
      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

      Avatar create(Avatar avatar) throws DataAccessException
      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

      List<Avatar> getAllSystemAvatars(IconType iconType) throws DataAccessException
      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

      List<Avatar> getCustomAvatarsForOwner(IconType iconType, String ownerId) throws DataAccessException
      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.