Interface CustomPlugin


public interface CustomPlugin
Custom plugin allows customized implementation for processing the ECE rated events such as transforming the rated events into specific formats or to various storage systems. A customized plugin implementation can be configured and executed by ECE RatedEventFormatter component. The customized plugin will be invoked by RatedEventFormatter component and provided with ECE rated events. For a set of rated events, the plugin will be invoked via 2 phase commit paradigm which is a pre-commit call followed by either a commit call or a abort call. The 2 phase commit paradigm is to coordinate multiple sets of rated events which are processed in parallel. Upon a preparecommit() call, the plugin should do most of the effort such as processing and generating the rated event files in a temporary location. Upon a commit() call, the plugin is ensured to safely move the rated event files from temporary location to permanent location because all the rated event sets have successfully executed the preparecommit() calls. Upon a abort() call, the plugin is informed that some rated event sets had problems from executing the preparecommit() call, therefore the plugin can delete the rated event files created from the preparecommit() call. After the commit() call, the same set of rated events never got processed by the plugin again. After the abort() call, the same set of rated event will be reprocessed to start the 2 phase commit paradigm until they are committed successfully.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    abort(CustomPluginContext context, List<RatedEventView> ratedEvents)
    Abort allows plugin to abort the operation executed in the prepareCommit state
    void
    Commit allows plugin to commit the operation executed in the prepareCommit state
    void
    initialize(FrameworkContext frameworkContext)
    Initialization hook to allow custom plugin to execute tasks before processing rated events
    void
    Preparecommit allows plugin to operate against a list of rated events in 2-phase stateful operation without commit the operation
    void
    Upon stopping the rated event formatter, the shutdown will be invoked.
  • Method Details

    • initialize

      void initialize(FrameworkContext frameworkContext)
      Initialization hook to allow custom plugin to execute tasks before processing rated events
      Parameters:
      frameworkContext - contains the RatedEventFormatter configuration and runtime information
    • prepareCommit

      void prepareCommit(CustomPluginContext context, List<RatedEventView> ratedEvents)
      Preparecommit allows plugin to operate against a list of rated events in 2-phase stateful operation without commit the operation
      Parameters:
      context - A context keep track of the state of the 2-phase commit operation. The context allows plugin to indicate success/failure from executing from the prepareCommit operation.
      ratedEvents - rated events to be processed by the custom plugin
    • commit

      void commit(CustomPluginContext context, List<RatedEventView> ratedEvents)
      Commit allows plugin to commit the operation executed in the prepareCommit state
      Parameters:
      context - A context keep track of the state of the 2-phase commit operation The context allows plugin to indicate success/failure from executing from the commit operation.
      ratedEvents - rated events to be committed by the custom plugin
    • abort

      void abort(CustomPluginContext context, List<RatedEventView> ratedEvents)
      Abort allows plugin to abort the operation executed in the prepareCommit state
      Parameters:
      context - A context keep track of the state of the 2-phase commit operation The context allows plugin to indicate success/failure from executing from the abort operation.
      ratedEvents - rated events to be aborted by the custom plugin
    • shutdown

      void shutdown()
      Upon stopping the rated event formatter, the shutdown will be invoked. Plugin can use this method to do graceful shutdown tasks such as cleaning up the resources used during processing the rated events.