com.atlassian.jira.avatar
Class OfbizAvatarStore

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

public class OfbizAvatarStore
extends Object
implements AvatarStore

Main Store implementation for Avatars. Nearly all methods could throw a DataAccessException.

Since:
v4.0

Constructor Summary
OfbizAvatarStore(OfBizDelegator ofBizDelegator)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfbizAvatarStore

public OfbizAvatarStore(OfBizDelegator ofBizDelegator)
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.

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.
Returns:
all the avatars that have the given type and owner, never null.


Copyright © 2002-2012 Atlassian. All Rights Reserved.