com.atlassian.mywork.service
Interface LocalNotificationService

All Superinterfaces:
NotificationService

public interface LocalNotificationService
extends NotificationService

Provides services related to notifications


Method Summary
 int count(java.lang.String username, java.lang.String globalId)
          Retrieves a number of notifications with the given global id and user.
 void delete(java.lang.String username, long notificationId)
          Deletes a notification with the given id.
 void deleteByGlobalId(java.lang.String globalId)
          Deletes notifications with the given global id
 void deleteByGlobalId(java.lang.String username, java.lang.String globalId)
          Deletes notifications with the given global id and user
 Notification find(java.lang.String username, long notificationId)
          Retrieves a notification with the given id and user.
 java.lang.Iterable<Notification> find(java.lang.String username, java.lang.String globalId)
          Retrieves notifications with the given user and global id.
 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.
 void invalidateCachedCounts()
           
 void setLastRead(java.lang.String username, java.lang.Long notificationId)
          Sets the latest notification that the user has seen.
 void setRead(java.lang.String username, java.util.List<java.lang.Long> notificationIds)
          Marks notifications read.
 Task setStatus(java.lang.String username, long notificationId, Status status)
          Sets the status of the notification and creates/updates associated work item.
 
Methods inherited from interface com.atlassian.mywork.service.NotificationService
createOrUpdate, getCount, updateMetadata
 

Method Detail

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.

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 - to start searching from
before - to start searching to
limit - maximum number of results to return
Returns:
notifications for this user after the given notification.

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.

find

Notification find(java.lang.String username,
                  long notificationId)
Retrieves a notification with the given id and user. Returns null if the notification was not found.

Parameters:
username - owner of the notification
notificationId - id of the notification
Returns:
notification with the given id and user or null if not found
Throws:
PermissionException - if the user does not own the notification

find

java.lang.Iterable<Notification> find(java.lang.String username,
                                      java.lang.String globalId)
Retrieves notifications with the given user and global id.

Parameters:
username - owner of the notificationss
globalId - global id of the notifications
Returns:
notifications with the given user and global id

count

int count(java.lang.String username,
          java.lang.String globalId)
Retrieves a number of notifications with the given global id and user.

Parameters:
username - owner of the notifications
globalId - global id of the notifications
Returns:
number of notifications with the given user and global id

invalidateCachedCounts

void invalidateCachedCounts()

delete

void delete(java.lang.String username,
            long notificationId)
Deletes a notification with the given id.

Parameters:
username - username of the user performing this action
notificationId - id of the notification to delete
Throws:
PermissionException - if the user does not own the notification

deleteByGlobalId

void deleteByGlobalId(java.lang.String username,
                      java.lang.String globalId)
Deletes notifications with the given global id and user

Parameters:
username - username of the owner of the notifications to delete
globalId - global id of the notifications to delete

deleteByGlobalId

void deleteByGlobalId(java.lang.String globalId)
Deletes notifications with the given global id

Parameters:
globalId - global id of the notifications to delete

setStatus

Task setStatus(java.lang.String username,
               long notificationId,
               Status status)
Sets the status of the notification and creates/updates associated work item.

Parameters:
username - owner of the notification
notificationId - if of the notification
status - new status
Returns:
task the associated task that was created/updated
Throws:
PermissionException - if the user does not own the notification

setLastRead

void setLastRead(java.lang.String username,
                 java.lang.Long notificationId)
Sets the latest notification that the user has seen.

Parameters:
username - owner of the notification
notificationId - if of the notification

setRead

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

Parameters:
username - username of the current user
notificationIds - ids of the notifications to mark read


Copyright © 2012 Atlassian. All Rights Reserved.