Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AppEventPortal

Children class @EventPortal which is a Controller class to abstract the events subscription and publishing actions.

This class has the login feature as an enhancement.

Hierarchy

Index

Constructors

constructor

Properties

Private appName

appName: string

Protected eventTarget

eventTarget: EventTargetFoundation = new EventTargetFoundation()
property

{EventTargetFoundation} eventTarget - EventTargetFoundation instance used to publish/subscribe events

Protected notificationStrategy

notificationStrategy: NotificationStrategyFoundation
property

{NotificationStrategyFoundation} notificationStrategy - NotificationStrategyFoundation instance used on subscribe time to encapsulate notifications strategies

Protected traceLogs

traceLogs: Traces = new Traces()
property

{Traces} traceLogs - Traces instance used to save the publishing and notifying events by apps

Accessors

logs

notificationStrategyType

  • get notificationStrategyType(): string

Methods

listenEvent

  • listenEvent(eventName: string, strategyCallBack?: any): EventPortal
  • Method to register/subscribe listeners to events. After this method execution the listeners/subscribers will be notified about events occurrences using the corresponding strategyCallBack.

    On event publishing, each the notification action will be logged into the traces instance.

    Parameters

    • eventName: string

      The name of the event of interest

    • Default value strategyCallBack: any = this.notificationStrategy

      Payload object with data to send into the published event

    Returns EventPortal

notifyEvent

  • notifyEvent(eventName: string, eventPayload: any): EventPortal
  • Method to publish events and notify subscribers about events occurrences.

    Each publication action will be logged into the traces instance.

    Parameters

    • eventName: string

      The name of the event to publish

    • eventPayload: any

      Payload object with data to send into the published event

    Returns EventPortal

Generated using TypeDoc