com.atlassian.jira.avatar
Interface AvatarStore

All Known Implementing Classes:
CachingAvatarStore, OfbizAvatarStore

public interface AvatarStore

Persistent storage mechanism for AvatarImpl.

Since:
v4.0

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

Method Detail

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.

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(Avatar.Type type)
                                 throws DataAccessException
Provides a list of all system avatars.

Parameters:
type - the types of avatar to retrieve
Returns:
the system avatars, never null.
Throws:
DataAccessException - if there is a back-end database problem.

getCustomAvatarsForOwner

List<Avatar> getCustomAvatarsForOwner(Avatar.Type type,
                                      String ownerId)
                                      throws DataAccessException
Provides a list of all avatars that are of the given type which have the given owner.

Parameters:
type - the desired type of the avatars to retrieve.
ownerId - the id of the owner, matches the type.
Returns:
all the avatars that have the given type and owner, never null.
Throws:
DataAccessException - if there is a back-end database problem.


Copyright © 2002-2012 Atlassian. All Rights Reserved.