com.atlassian.mywork.host.dao
Interface NotificationDao

All Known Implementing Classes:
AONotificationDao

@Transactional
public interface NotificationDao


Method Summary
 int countByGlobalId(java.lang.String username, java.lang.String globalId)
          Returns number of notifications for the given user with a given globalId.
 Notification create(Notification notification)
           
 Notification delete(long id)
           
 int deleteAll(java.lang.String username)
           
 java.lang.Iterable<Notification> deleteByGlobalId(java.lang.String globalId)
           
 int deleteOldNotifications(int days, boolean read)
          Deletes notifications that are older than the given number of days.
 java.lang.Iterable<Notification> findAll(java.lang.String username)
          Returns all notifications for the given user.
 java.lang.Iterable<Notification> findAllAfter(java.lang.String username, long after, long before, int limit)
          Returns all notifications for the given user after a given notification.
 java.lang.Iterable<Notification> findAllUnread(java.lang.String username)
          Returns all unread notifications for the given user.
 java.lang.Iterable<Notification> findAllUnreadAfter(java.lang.String username, long notificationId)
           
 java.lang.Iterable<Notification> findByGlobalId(java.lang.String username, java.lang.String globalId)
          Returns all notifications for the given user with a given globalId.
 Notification get(long id)
           
 void markAllRead(java.lang.String username, long before)
           
 void setRead(java.lang.String username, java.util.List<java.lang.Long> notificationIds)
           
 void setStatusByGlobalId(java.lang.String username, java.lang.String globalId, Status status)
           
 Notification update(Notification notification)
           
 void updateMetadata(java.lang.String username, java.lang.String globalId, org.codehaus.jackson.node.ObjectNode condition, org.codehaus.jackson.node.ObjectNode metadata)
           
 

Method Detail

get

Notification get(long id)

create

Notification create(Notification notification)

update

Notification update(Notification notification)

updateMetadata

void updateMetadata(java.lang.String username,
                    java.lang.String globalId,
                    org.codehaus.jackson.node.ObjectNode condition,
                    org.codehaus.jackson.node.ObjectNode metadata)

delete

Notification delete(long id)

deleteByGlobalId

java.lang.Iterable<Notification> deleteByGlobalId(java.lang.String globalId)

findAll

java.lang.Iterable<Notification> findAll(java.lang.String username)
Returns all notifications for the given user.

Parameters:
username - username of the user to retrieve notifications for
Returns:
all notifications for the given user.

findAllUnread

java.lang.Iterable<Notification> findAllUnread(java.lang.String username)
Returns all unread notifications for the given user.

Parameters:
username - username of the user to retrieve notifications for
Returns:
all unread notifications for the given user.

findAllAfter

java.lang.Iterable<Notification> findAllAfter(java.lang.String username,
                                              long after,
                                              long before,
                                              int limit)
Returns all notifications for the given user after a given notification.

Parameters:
username - username of the user to retrieve notifications for
after - notification id to search from
before - notification id to search to
limit - maximum number of results to return
Returns:
all notifications for the given user.

findAllUnreadAfter

java.lang.Iterable<Notification> findAllUnreadAfter(java.lang.String username,
                                                    long notificationId)

findByGlobalId

java.lang.Iterable<Notification> findByGlobalId(java.lang.String username,
                                                java.lang.String globalId)
Returns all notifications for the given user with a given globalId.

Parameters:
username - username of the user to retrieve notifications for
Returns:
all notifications for the given user.

countByGlobalId

int countByGlobalId(java.lang.String username,
                    java.lang.String globalId)
Returns number of notifications for the given user with a given globalId.

Parameters:
username - username of the user to retrieve number of notifications for
Returns:
number of notifications for the given user.

markAllRead

void markAllRead(java.lang.String username,
                 long before)

setRead

void setRead(java.lang.String username,
             java.util.List<java.lang.Long> notificationIds)

setStatusByGlobalId

void setStatusByGlobalId(java.lang.String username,
                         java.lang.String globalId,
                         Status status)

deleteOldNotifications

int deleteOldNotifications(int days,
                           boolean read)
Deletes notifications that are older than the given number of days. This does not include pinned notifications.

Parameters:
days - number of days that notifications should be kept for
read - where to delete read or unread
Returns:
number of notifications deleted

deleteAll

int deleteAll(java.lang.String username)


Copyright © 2012 Atlassian. All Rights Reserved.