|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.avatar.AvatarServiceImpl
public class AvatarServiceImpl
Implementation of the AvatarService.
Constructor Summary | |
---|---|
AvatarServiceImpl(UserManager userManager,
AvatarManager avatarManager,
UserPropertyManager userPropertyManager,
VelocityRequestContextFactory velocityRequestContextFactory,
ApplicationProperties applicationProperties)
|
Method Summary | |
---|---|
boolean |
canSetCustomUserAvatar(com.atlassian.crowd.embedded.api.User remoteUser,
String username)
Returns a boolean indicating whether the calling user can edit the custom user avatar for the user with the given username. |
protected boolean |
canViewAvatar(com.atlassian.crowd.embedded.api.User user,
Avatar avatar)
Returns true if the passed in user has permission to view the passed in avatar. |
protected Long |
configuredAvatarIdFor(com.atlassian.crowd.embedded.api.User user)
Returns the avatar id that is configured for the given User. |
protected Avatar |
getAnonymousAvatar()
Returns the anonymous avatar, if configured. |
Avatar |
getAvatar(com.atlassian.crowd.embedded.api.User remoteUser,
String avatarUserId)
Returns the Avatar for the given user, if configured. |
URI |
getAvatarAbsoluteURL(com.atlassian.crowd.embedded.api.User remoteUser,
String avatarUserId,
Avatar.Size size)
This is the same as AvatarService.getAvatarURL(com.atlassian.crowd.embedded.api.User, String, com.atlassian.jira.avatar.Avatar.Size)
but returns an absolute URL. |
URI |
getAvatarURL(com.atlassian.crowd.embedded.api.User remoteUser,
String avatarUserId)
Returns the URL for the avatar of the user having the given username for displaying on a page that should be shown for the passed in remoteUser. |
URI |
getAvatarURL(com.atlassian.crowd.embedded.api.User remoteUser,
String avatarUserId,
Avatar.Size size)
Returns the URL for the avatar of the user having the given username for displaying on a page that should be shown for the passed in remoteUser. |
URI |
getAvatarUrlNoPermCheck(String avatarUserId,
Avatar.Size size)
This is the same as AvatarService.getAvatarURL(com.atlassian.crowd.embedded.api.User, String,
com.atlassian.jira.avatar.Avatar.Size) but does no permission checking. |
protected Avatar |
getDefaultAvatar()
Returns the default avatar, if configured. |
URI |
getProjectAvatarAbsoluteURL(Project project,
Avatar.Size size)
Returns the URL for the avatar of the given project. |
URI |
getProjectAvatarURL(Project project,
Avatar.Size size)
Returns the URL for the avatar of the given project. |
boolean |
hasCustomUserAvatar(com.atlassian.crowd.embedded.api.User remoteUser,
String username)
|
boolean |
isGravatarEnabled()
Returns true if Gravatar support is enabled. |
protected void |
setConfiguredAvatarIdFor(com.atlassian.crowd.embedded.api.User user,
Long avatarId)
Sets the given avatar id as the configured avatar id for a user. |
void |
setCustomUserAvatar(com.atlassian.crowd.embedded.api.User remoteUser,
String username,
Long avatarId)
Sets a custom avatar for a given user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AvatarServiceImpl(UserManager userManager, AvatarManager avatarManager, UserPropertyManager userPropertyManager, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties)
Method Detail |
---|
public Avatar getAvatar(com.atlassian.crowd.embedded.api.User remoteUser, String avatarUserId) throws AvatarsDisabledException
AvatarService
getAvatar
in interface AvatarService
remoteUser
- the User that wants to view an AvataravatarUserId
- a String containing a username (may have been deleted)
AvatarsDisabledException
- if avatars are disabledpublic URI getAvatarURL(com.atlassian.crowd.embedded.api.User remoteUser, String avatarUserId) throws AvatarsDisabledException
AvatarService
getAvatarURL
in interface AvatarService
remoteUser
- a User object for the currently logged in useravatarUserId
- a String containing a username (may have been deleted)
AvatarsDisabledException
- if avatars are disabledAvatarService.getAvatar(com.atlassian.crowd.embedded.api.User, String)
public URI getAvatarURL(com.atlassian.crowd.embedded.api.User remoteUser, String avatarUserId, Avatar.Size size) throws AvatarsDisabledException
AvatarService
getAvatarURL
in interface AvatarService
remoteUser
- a User object for the currently logged in useravatarUserId
- a String containing a username (may have been deleted)size
- the size of the avatar to be displayed (if null, the default size is used)
AvatarsDisabledException
- if avatars are disabledAvatarService.getAvatar(com.atlassian.crowd.embedded.api.User, String)
public URI getAvatarUrlNoPermCheck(String avatarUserId, Avatar.Size size) throws AvatarsDisabledException
AvatarService
AvatarService.getAvatarURL(com.atlassian.crowd.embedded.api.User, String,
com.atlassian.jira.avatar.Avatar.Size)
but does no permission checking.
getAvatarUrlNoPermCheck
in interface AvatarService
avatarUserId
- a String containing a username (may have been deleted)size
- the size of the avatar to be displayed (if null, the default size is used)
AvatarsDisabledException
- if avatars are disabledpublic URI getAvatarAbsoluteURL(com.atlassian.crowd.embedded.api.User remoteUser, String avatarUserId, Avatar.Size size) throws AvatarsDisabledException
AvatarService
AvatarService.getAvatarURL(com.atlassian.crowd.embedded.api.User, String, com.atlassian.jira.avatar.Avatar.Size)
but returns an absolute URL.
getAvatarAbsoluteURL
in interface AvatarService
AvatarsDisabledException
public boolean hasCustomUserAvatar(com.atlassian.crowd.embedded.api.User remoteUser, String username)
hasCustomUserAvatar
in interface AvatarService
public void setCustomUserAvatar(com.atlassian.crowd.embedded.api.User remoteUser, String username, Long avatarId) throws AvatarsDisabledException, NoPermissionException
AvatarService
setCustomUserAvatar
in interface AvatarService
remoteUser
- a User object for the currently logged in userusername
- the username of the user whose avatar we will configureavatarId
- the id of the avatar to configure for the user
AvatarsDisabledException
- if avatars are disabled
NoPermissionException
- if the remote user does not have permission to update the given user's avatarAvatarService.canSetCustomUserAvatar(com.atlassian.crowd.embedded.api.User, String)
public boolean canSetCustomUserAvatar(com.atlassian.crowd.embedded.api.User remoteUser, String username)
AvatarService
canSetCustomUserAvatar
in interface AvatarService
remoteUser
- a User object for the currently logged in userusername
- the username of the user whose avatar we will configure
public URI getProjectAvatarURL(Project project, Avatar.Size size)
AvatarService
getProjectAvatarURL
in interface AvatarService
project
- the Project of which to get the avatar URLsize
- the size of the avatar to be displayed (if null, the default size is used)
public URI getProjectAvatarAbsoluteURL(Project project, Avatar.Size size)
AvatarService
getProjectAvatarAbsoluteURL
in interface AvatarService
project
- the Project of which to get the avatar URLsize
- the size of the avatar to be displayed (if null, the default size is used)
protected Long configuredAvatarIdFor(com.atlassian.crowd.embedded.api.User user)
user
- the user whose avatar we want
AvatarManager.getDefaultAvatarId(com.atlassian.jira.avatar.Avatar.Type)
,
AvatarManager.getAnonymousAvatarId()
public boolean isGravatarEnabled()
isGravatarEnabled
in interface AvatarService
protected void setConfiguredAvatarIdFor(com.atlassian.crowd.embedded.api.User user, Long avatarId)
user
- the User whose avatar is being configuredavatarId
- the avatar id to configureprotected boolean canViewAvatar(com.atlassian.crowd.embedded.api.User user, Avatar avatar)
user
- a Useravatar
- an Avatar
protected Avatar getDefaultAvatar()
protected Avatar getAnonymousAvatar()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |