com.atlassian.jira.avatar
Class CachingTaggingAvatarStore

java.lang.Object
  extended by com.atlassian.jira.avatar.CachingTaggingAvatarStore
All Implemented Interfaces:
AvatarStore

public class CachingTaggingAvatarStore
extends Object
implements AvatarStore

Avatar store which converts legacy avatar files to the new tagged format during retrieval

Since:
v6.2

Constructor Summary
CachingTaggingAvatarStore(OfBizDelegator ofBizDelegator, AvatarTagger avatarTagger, com.atlassian.cache.CacheManager cacheManager)
           
 
Method Summary
 Avatar create(Avatar avatar)
          Creates an avatar with the properties of the given avatar.
 boolean delete(Long avatarId)
          Permanently removes the avatar from the system.
 List<Avatar> getAllSystemAvatars(Avatar.Type type)
          Provides a list of all system avatars.
 Avatar getById(Long avatarId)
          Retrieves the Avatar by id.
 Avatar getByIdTagged(Long avatarId)
          Retrieves the Avatar by id, ensuring the avatar file is tagged with metadata identifying the image came from JIRA.
 List<Avatar> getCustomAvatarsForOwner(Avatar.Type type, String ownerId)
          Provides a list of all avatars that are of the given type which have the given owner.
 void update(Avatar avatar)
          Updates an avatar's properties to match those in the given avatar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingTaggingAvatarStore

public CachingTaggingAvatarStore(OfBizDelegator ofBizDelegator,
                                 AvatarTagger avatarTagger,
                                 com.atlassian.cache.CacheManager cacheManager)
Method Detail

getById

public Avatar getById(Long avatarId)
Description copied from interface: AvatarStore
Retrieves the Avatar by id.

Specified by:
getById in interface AvatarStore
Parameters:
avatarId - the avatar's id, must not be null.
Returns:
the avatar with the given id or null if it doesn't exist.

getByIdTagged

public Avatar getByIdTagged(Long avatarId)
Description copied from interface: AvatarStore
Retrieves the Avatar by id, ensuring the avatar file is tagged with metadata identifying the image came from JIRA.

Specified by:
getByIdTagged in interface AvatarStore
Parameters:
avatarId - the avatar's id, must not be null.
Returns:
the avatar with the given id or null if it doesn't exist.

delete

public boolean delete(Long avatarId)
Description copied from interface: AvatarStore
Permanently removes the avatar from the system.

Specified by:
delete in interface AvatarStore
Parameters:
avatarId - the avatar's id, must not be null.
Returns:
the avatar with the given id or null if it doesn't exist.

update

public void update(Avatar avatar)
Description copied from interface: AvatarStore
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.

Specified by:
update in interface AvatarStore
Parameters:
avatar - the avatar to update, must not be null.

create

public Avatar create(Avatar avatar)
Description copied from interface: AvatarStore
Creates an avatar with the properties of the given avatar.

Specified by:
create in interface AvatarStore
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.

getAllSystemAvatars

public List<Avatar> getAllSystemAvatars(Avatar.Type type)
Description copied from interface: AvatarStore
Provides a list of all system avatars.

Specified by:
getAllSystemAvatars in interface AvatarStore
Parameters:
type - the types of avatar to retrieve
Returns:
the system avatars, never null.

getCustomAvatarsForOwner

public List<Avatar> getCustomAvatarsForOwner(Avatar.Type type,
                                             String ownerId)
Description copied from interface: AvatarStore
Provides a list of all avatars that are of the given type which have the given owner.

Specified by:
getCustomAvatarsForOwner in interface AvatarStore
Parameters:
type - 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.


Copyright © 2002-2014 Atlassian. All Rights Reserved.