Class BasicTypedTypeAvatarService

java.lang.Object
com.atlassian.jira.avatar.types.BasicTypedTypeAvatarService
All Implemented Interfaces:
TypeAvatarService
Direct Known Subclasses:
IssueTypeTypeAvatarService, ProjectTypeAvatarService

public class BasicTypedTypeAvatarService extends Object implements TypeAvatarService
To be honest, you don't need this class very much if you already have the IconType and the AvatarManager.
  • Constructor Details

    • BasicTypedTypeAvatarService

      public BasicTypedTypeAvatarService(IconType iconType, AvatarManager avatarManager)
  • Method Details

    • getAvatars

      public final SystemAndCustomAvatars getAvatars(ApplicationUser remoteUser, String owningObjectId)
      Description copied from interface: TypeAvatarService
      Get avatars assigned to given subject - with permissions of remote user.
      Specified by:
      getAvatars in interface TypeAvatarService
      Parameters:
      remoteUser - user whose permissions should be used
      owningObjectId - id of object (project/user/issuetype) to which this avatar is connected to
      Returns:
      object with all system and accessible by user custom avatars
    • getAvatar

      public Avatar getAvatar(ApplicationUser remoteUser, long avatarId)
      Description copied from interface: TypeAvatarService
      Return avatar using remote user permissions. May return null if user cannot access this avatar.
      Specified by:
      getAvatar in interface TypeAvatarService
      Parameters:
      remoteUser - user whose permissions should be used
      avatarId - avatar id
    • canUserCreateAvatar

      public boolean canUserCreateAvatar(ApplicationUser remoteUser, String owningObjectId)
      Description copied from interface: TypeAvatarService
      Return information if user can add avatar to given subject.
      Specified by:
      canUserCreateAvatar in interface TypeAvatarService
      Parameters:
      remoteUser - user whose permissions should be used
      owningObjectId - id of object (project/user/issuetype) to which this avatar is connected to
    • createAvatar

      public Avatar createAvatar(ApplicationUser remoteUser, String owningObjectId, AvatarImageDataProvider imageDataProvider) throws IllegalAccessException, IOException
      Description copied from interface: TypeAvatarService
      Adds new avatar to given subject with provided image data - with permissions of given remote user. Returns created avatar.
      Specified by:
      createAvatar in interface TypeAvatarService
      Parameters:
      remoteUser - user whose permissions should be used
      owningObjectId - id of object (project/user/issuetype) to which this avatar will be connected to
      imageDataProvider - provider of image data for new avatar
      Throws:
      IllegalAccessException - if user cannot add avatar to given subject
      IOException - if there is error with image data
    • getDefaultAvatar

      @Nonnull public Avatar getDefaultAvatar()
      Description copied from interface: TypeAvatarService
      Get default avatar for current type. This avatar should be available to anyone
      Specified by:
      getDefaultAvatar in interface TypeAvatarService
      Returns: