com.atlassian.jira.avatar.types
Class BasicTypedTypeAvatarService

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

public class BasicTypedTypeAvatarService
extends Object
implements TypeAvatarService


Constructor Summary
BasicTypedTypeAvatarService(Avatar.Type type, AvatarManager avatarManager, AvatarAccessPolicy policy)
           
 
Method Summary
 boolean canUserCreateAvatar(ApplicationUser remoteUser, String owningObjectId)
          Return information if user can add avatar to given subject.
 Avatar createAvatar(ApplicationUser remoteUser, String owningObjectId, AvatarImageDataProvider imageDataProvider)
          Adds new avatar to given subject with provided image data - with permissions of given remote user.
 Avatar getAvatar(ApplicationUser remoteUser, long avatarId)
          Return avatar using remote user permissions.
 SystemAndCustomAvatars getAvatars(ApplicationUser remoteUser, String owningObjectId)
          Get avatars assigned to given subject - with permisions of remote user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTypedTypeAvatarService

public BasicTypedTypeAvatarService(Avatar.Type type,
                                   AvatarManager avatarManager,
                                   AvatarAccessPolicy policy)
Method Detail

getAvatars

public final SystemAndCustomAvatars getAvatars(ApplicationUser remoteUser,
                                               String owningObjectId)
Description copied from interface: TypeAvatarService
Get avatars assigned to given subject - with permisions 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


Copyright © 2002-2014 Atlassian. All Rights Reserved.