Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventOperator

Overview

The EventOperator manages event processors and sets limits on their behavior.

An EventOperator categorizes processors into 3 types:

  • Watcher: Listens for events and triggers callbacks when events occur.
  • Emitter: Emits events that other applications listen for.
  • EmitterAndWatcher: Combines the functionalities of both watcher and emitter.

Applications use the EventOperator to obtain the appropriate event processor based on their needs. For example, an application might use a watcher to react to user actions and an emitter to notify other components of state changes.

App Names and Processors

Processors are tied to application names to prevent event collisions and to maintain a clear separation of event domains. Valid app names are defined in the list of extenders (formal plugin names or ZE extender names).

Understanding Event Types

  • Predefined Zowe Events: Zowe provides a set of predefined shared and user events that can be watched.
  • Custom Events: Applications can define their own shared/user events, allowing for custom event-driven behavior.
export

Hierarchy

  • EventOperator

Index

Properties

Static Private instances

instances: Map<string, EventProcessor> = new Map()

Methods

Static Private createProcessor

  • Creates an event processor for a specified application.

    static
    throws

    {ImperativeError} If the application name is not recognized.

    Parameters

    • appName: string

      The name of the application.

    • type: IProcessorTypes

      The type of processor to create (emitter, watcher, or both).

    • Optional logger: Logger

    Returns IZoweProcessor

    A new or existing processor instance.

Static deleteEmitter

  • deleteEmitter(appName: string): void

Static deleteProcessor

  • deleteProcessor(appName: string): void

Static deleteWatcher

  • deleteWatcher(appName: string): void

Static Private destroyProcessor

  • destroyProcessor(appName: string): void
  • Destroys a processor by removing all associated file watchers and cleaning up resources.

    static

    Parameters

    • appName: string

      The name of the application whose processor needs to be destroyed.

    Returns void

Static getEmitter

Static getProcessor

Static getWatcher

  • Retrieves a watcher-only event processor.

    static
    throws

    {ImperativeError} If the application name is not recognized.

    Parameters

    • Default value appName: string = "Zowe"

      The application name, defaults to "Zowe" if not specified.

    • Optional logger: Logger

    Returns IWatcher

    A watcher-only event processor.

Static getZoweProcessor

  • getZoweProcessor(): IZoweProcessor
  • Retrieves a Zowe-specific event processor. The purpose of this method is for internal Imperative APIs to get a properly initialized processor. This processor will be used when applications (like Zowe Explorer) call Imperative APIs that trigger events. For example, when the user updates credentials from Zowe Explorer, this processor could be used to emit an OnVaultChanged event.

    internal

    Not meant to be called by application developers

    static
    throws

    {ImperativeError} If the application name is not recognized.

    Returns IZoweProcessor

    The Zowe event processor instance.

Generated using TypeDoc