Class ClientNotificationAddress

java.lang.Object
org.eclipse.scout.rt.shared.clientnotification.ClientNotificationAddress
All Implemented Interfaces:
Serializable, IClientNotificationAddress

public class ClientNotificationAddress extends Object implements IClientNotificationAddress
Determines how the client notification needs to be dispatched and handled. A client notification can be addressed to
  • all nodes
  • all sessions
  • one or more specific sessions
  • one or more specific users
See Also:
  • Constructor Details

    • ClientNotificationAddress

      protected ClientNotificationAddress()
      Only one of the following expression must evaluate to true (listed in order of evaluation in ClientNotificationDispatcher):
      • notifyAllNodes
      • notifyAllSessions
      • !CollectionUtility.isEmpty(sessionIds)
      • !CollectionUtility.isEmpty(userIds)
  • Method Details

    • createSessionAddress

      public static ClientNotificationAddress createSessionAddress(Set<String> sessionIds)
      Create an address for a notification that should to be handled once for each of the given sessions.
      Parameters:
      sessionIds - the ids of the users for this address see ISession.getId()
      Returns:
      notification address
    • createUserAddress

      public static ClientNotificationAddress createUserAddress(Set<String> userIds)
      Create an address for a notification that should to be handled once for each of the given users.
      Parameters:
      userIds - the ids of the users for this address see ISession.getUserId()
      Returns:
      notification address
    • createAllSessionsAddress

      public static ClientNotificationAddress createAllSessionsAddress()
      Create an address for a notification that should to be handled once for each session.
      Returns:
      notification address
    • createAllNodesAddress

      public static ClientNotificationAddress createAllNodesAddress()
      Create an address for a notification that should to be handled once per client node.
      Returns:
      notification address
    • getSessionIds

      public Set<String> getSessionIds()
      Specified by:
      getSessionIds in interface IClientNotificationAddress
      Returns:
      the sessions for which this client notification should be dispatched.
    • getUserIds

      public Set<String> getUserIds()
      Specified by:
      getUserIds in interface IClientNotificationAddress
      Returns:
      the userIds for which this client notification should be dispatched.
    • isNotifyAllSessions

      public boolean isNotifyAllSessions()
      Specified by:
      isNotifyAllSessions in interface IClientNotificationAddress
      Returns:
      true, if a notification should be dispatched once for every available session, false otherwise.
    • isNotifyAllNodes

      public boolean isNotifyAllNodes()
      Specified by:
      isNotifyAllNodes in interface IClientNotificationAddress
      Returns:
      true, if a notification should be dispatched once per UI server node, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • withSessionIds

      protected ClientNotificationAddress withSessionIds(Set<String> sessionIds)
    • withUserIds

      protected ClientNotificationAddress withUserIds(Set<String> userIds)
    • withNotifyAllSessions

      protected ClientNotificationAddress withNotifyAllSessions(boolean notifyAllSessions)
    • withNotifyAllNodes

      protected ClientNotificationAddress withNotifyAllNodes(boolean notifyAllNodes)