Class AgendaWebSocketService

java.lang.Object
org.exoplatform.agenda.service.AgendaWebSocketService

public class AgendaWebSocketService extends Object
A service to push notifications from server to browsers of users about modifications made by other users on events.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgendaWebSocketService(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.ws.frameworks.cometd.ContinuationService continuationService, org.mortbay.cometd.continuation.EXoContinuationBayeux continuationBayeux)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    getUserToken(String username)
    Generate a cometd Token for each user
    void
    sendMessage(String wsEventName, Collection<String> recipientUsers, Object... params)
    Propagate an event from Backend to frontend to add dynamism in pages
    void
    sendMessage(String wsEventName, org.exoplatform.agenda.model.AgendaEventModification eventModification)
    Propagate an event from Backend to frontend to add dynamism in pages
    void
    sendMessage(org.exoplatform.agenda.model.WebSocketMessage messageObject, Collection<String> recipientUsers)
    Propagate an event from Backend to frontend to add dynamism in pages

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AgendaWebSocketService

      public AgendaWebSocketService(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.ws.frameworks.cometd.ContinuationService continuationService, org.mortbay.cometd.continuation.EXoContinuationBayeux continuationBayeux)
  • Method Details

    • sendMessage

      public void sendMessage(String wsEventName, org.exoplatform.agenda.model.AgendaEventModification eventModification)
      Propagate an event from Backend to frontend to add dynamism in pages
      Parameters:
      wsEventName - event name that will allow Browser to distinguish which behavior to adopt in order to update UI
      eventModification - The event modification object that provides the list of modifications made on event
    • sendMessage

      public void sendMessage(String wsEventName, Collection<String> recipientUsers, Object... params)
      Propagate an event from Backend to frontend to add dynamism in pages
      Parameters:
      wsEventName - event name that will allow Browser to distinguish which behavior to adopt in order to update UI
      recipientUsers - Collection of usernames of receivers
      params - an Array of parameters to include in message sent via WebSocket
    • sendMessage

      public void sendMessage(org.exoplatform.agenda.model.WebSocketMessage messageObject, Collection<String> recipientUsers)
      Propagate an event from Backend to frontend to add dynamism in pages
      Parameters:
      messageObject - WebSocketMessage to transmit via WebSocket
      recipientUsers - Collection of usernames of receivers
    • getCometdContextName

      public String getCometdContextName()
      Returns:
      'cometd' webapp context name
    • getUserToken

      public String getUserToken(String username)
      Generate a cometd Token for each user
      Parameters:
      username - user name for whom the token will be generated
      Returns:
      generated cometd token