com.atlassian.mywork.model
Class Notification

java.lang.Object
  extended by com.atlassian.mywork.model.Notification
All Implemented Interfaces:
JsonObject

public class Notification
extends java.lang.Object
implements JsonObject

This class describes a user notification.


Constructor Summary
Notification(long id, java.lang.String applicationLinkId, java.lang.String user, java.lang.String iconUrl, java.lang.String title, java.lang.String description, java.lang.String url, java.lang.String application, java.lang.String entity, java.lang.String action, java.lang.String actionIconUrl, long created, long updated, Status status, boolean read, boolean pinned, java.lang.String groupingId, java.lang.String globalId, org.codehaus.jackson.node.ObjectNode metadata, Item item)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getAction()
          Returns name of the action that caused the notification to be created (e.g "comment").
 java.lang.String getActionIconUrl()
          Returns the absolute url to an icon representing the action.
 java.lang.String getApplication()
          Returns the application that created the notification (e.g.
 java.lang.String getApplicationLinkId()
          Returns the application link id of the application that created the notification.
 long getCreated()
          Returns the time in milliseconds when this notification was created in the data store.
 java.lang.String getDescription()
          Returns the description of the notification.
 java.lang.String getEntity()
          Returns type of the remote entity that the notification is related to (e.g.
 java.lang.String getGlobalId()
          Returns a string that should uniquely identify the remote object that this notification relates to.
 java.lang.String getGroupingId()
          Returns a string that will be used to group notifications or null if not specified.
 java.lang.String getIconUrl()
          Returns the absolute url to an icon representing the notification.
 long getId()
          Returns the notification id.
 Item getItem()
          Returns the item describing content related to this notification.
 org.codehaus.jackson.node.ObjectNode getMetadata()
          Returns optional free-form metadata for use by the creator of this notification.
 Status getStatus()
          Returns the status of this notification.
 java.lang.String getTitle()
          Returns the title of the notification.
 long getUpdated()
          Returns the time in milliseconds when this notification was last updated in the data store.
 java.lang.String getUrl()
          Returns the absolute url pointing to the source of the notification.
 java.lang.String getUser()
          Returns username of the receiver of the notification.
 int hashCode()
           
 boolean isPinned()
          Returns true if this notification should be displayed to the user until the user takes action.
 boolean isRead()
          Returns true if the user has read this notification.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Notification

public Notification(long id,
                    java.lang.String applicationLinkId,
                    java.lang.String user,
                    java.lang.String iconUrl,
                    java.lang.String title,
                    java.lang.String description,
                    java.lang.String url,
                    java.lang.String application,
                    java.lang.String entity,
                    java.lang.String action,
                    java.lang.String actionIconUrl,
                    long created,
                    long updated,
                    Status status,
                    boolean read,
                    boolean pinned,
                    java.lang.String groupingId,
                    java.lang.String globalId,
                    org.codehaus.jackson.node.ObjectNode metadata,
                    Item item)
Method Detail

getId

public long getId()
Returns the notification id.

Returns:
notification id

getApplicationLinkId

public java.lang.String getApplicationLinkId()
Returns the application link id of the application that created the notification.

Returns:
the application link id of the application that created the notification

getUser

public java.lang.String getUser()
Returns username of the receiver of the notification.

Returns:
username of the receiver of the notification

getIconUrl

public java.lang.String getIconUrl()
Returns the absolute url to an icon representing the notification.

The icon should preferably be 16x16 px.

Returns:
the absolute url to an icon representing the notification

getTitle

public java.lang.String getTitle()
Returns the title of the notification.

Returns:
the title of the notification

getDescription

public java.lang.String getDescription()
Returns the description of the notification.

Returns:
the description of the notification

getUrl

public java.lang.String getUrl()
Returns the absolute url pointing to the source of the notification.

Returns:
the absolute url pointing to the source of the notification

getApplication

public java.lang.String getApplication()
Returns the application that created the notification (e.g. "com.atlassian.jira").

Returns:
the application that created the notification

getEntity

public java.lang.String getEntity()
Returns type of the remote entity that the notification is related to (e.g. "issue").

Returns:
type of the remote entity that the notification is related to

getAction

public java.lang.String getAction()
Returns name of the action that caused the notification to be created (e.g "comment").

Returns:
name of the action that caused the notification to be created

getActionIconUrl

public java.lang.String getActionIconUrl()
Returns the absolute url to an icon representing the action.

The icon should preferably be 16x16 px .

Returns:
the absolute url to an icon representing the action

getCreated

public long getCreated()
Returns the time in milliseconds when this notification was created in the data store.

Returns:
the time in milliseconds when this notification was created

getUpdated

public long getUpdated()
Returns the time in milliseconds when this notification was last updated in the data store.

If the creation time matches the update time, the notification has never been updated.

Returns:
the time in milliseconds when this notification was last updated

getStatus

public Status getStatus()
Returns the status of this notification. If there is a task with the same globalId the status of the task will be returned. Otherwise Status.DONE will be returned.

Returns:
status of the linked task or DONE.

isRead

public boolean isRead()
Returns true if the user has read this notification.

Returns:
true if the user has read this notification

isPinned

public boolean isPinned()
Returns true if this notification should be displayed to the user until the user takes action.

Returns:
true if this notification should be displayed to the user until the user takes action

getGroupingId

public java.lang.String getGroupingId()
Returns a string that will be used to group notifications or null if not specified. All notifications with the same groupingId and action should be grouped together in the UI.

Returns:
a string that will be used to group notifications or null if not specified

getGlobalId

public java.lang.String getGlobalId()
Returns a string that should uniquely identify the remote object that this notification relates to.

Returns:
a string that should uniquely identify the remote object that this notification relates to

getMetadata

public org.codehaus.jackson.node.ObjectNode getMetadata()
Returns optional free-form metadata for use by the creator of this notification.

Returns:
optional free-form metadata for use by the creator of this notification

getItem

public Item getItem()
Returns the item describing content related to this notification.

Returns:
the item describing content related to this notification

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2012 Atlassian. All Rights Reserved.