Class AbstractChannel

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.commons.api.notification.channel.AbstractChannel
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public abstract class AbstractChannel extends org.exoplatform.container.component.BaseComponentPlugin
  • Constructor Details

    • AbstractChannel

      public AbstractChannel(AbstractNotificationLifecycle lifecycle)
    • AbstractChannel

      public AbstractChannel()
      Using the default life-cycle
  • Method Details

    • start

      public void start()
      Initialize something when starts to work the channel
    • end

      public void end()
    • getId

      public abstract String getId()
      Gets ChannelId
      Returns:
    • getKey

      public abstract ChannelKey getKey()
      Gets Channel Key
      Returns:
    • getLifecycle

      public AbstractNotificationLifecycle getLifecycle()
      Gets the lifecycle what assigned to the channel
      Returns:
    • dispatch

      public abstract void dispatch(NotificationContext ctx, String userId)
      Process the notification information for the specified user.
      Parameters:
      ctx - The NotificationContext
      userId - the user will be received the message.
    • dispatch

      public void dispatch(NotificationInfo notifInfo)
      Process the notification info
      Parameters:
      notifInfo - the notification information
    • registerTemplateProvider

      public abstract void registerTemplateProvider(TemplateProvider provider)
      Register the template provider to the channel.
      Parameters:
      provider -
    • getTemplateFilePath

      public String getTemplateFilePath(PluginKey key)
      Gets the template by the specified pluginId
      Parameters:
      key - the plugin key
    • hasTemplateBuilder

      public boolean hasTemplateBuilder(PluginKey key)
      Has the template builder of the plugin and the channel
      Parameters:
      key - the plugin key
    • getTemplateBuilder

      public AbstractTemplateBuilder getTemplateBuilder(PluginKey key)
      Gets the template builder by the specified PluginKey
      Parameters:
      key - the PluginKey
    • isDefaultChannel

      public boolean isDefaultChannel()
    • getTemplateBuilderInChannel

      protected abstract AbstractTemplateBuilder getTemplateBuilderInChannel(PluginKey key)