Class SamplePreRatingDelay

java.lang.Object
oracle.communication.brm.charging.sdk.extensions.SamplePreRatingDelay
All Implemented Interfaces:
PreRatingExtension, oracle.communication.brm.charging.extensions.framework.ExtensionCallback<PreRatingExtensionContext>

public class SamplePreRatingDelay extends Object implements PreRatingExtension
A sample implementation of the PreRatingExtension interface that introduces a delay in the pre-rating process. The delay can be configured dynamically via an HTTP endpoint. Example: curl -X POST http://localhost:8123/delayMs -H "Content-Type: text/plain; charset=utf-8" --data "42" curl http://localhost:8123/delayMs curl -X DELETE http://localhost:8123/delayMs This can be run on a private cloud deployment on all ECS nodes kubectl get pods -o name | grep '^pod/ecs' | xargs -n1 -I{} kubectl -c ece exec {} -- \ curl -s -X POST http://localhost:8123/delayMs -H 'Content-Type: text/plain; charset=utf-8' --data '42'

kubectl get pods -o name | grep '^pod/ecs' | xargs -n1 -I{} kubectl -c ece exec {} -- \ curl -s http://localhost:8123/delayMs

kubectl get pods -o name | grep '^pod/ecs' | xargs -n1 -I{} kubectl -c ece exec {} -- \ curl -s -X DELETE http://localhost:8123/delayMs

  • Constructor Details

    • SamplePreRatingDelay

      public SamplePreRatingDelay()
  • Method Details

    • initialize

      public void initialize(ExtensionContext extensionContext) throws ExtensionException
      Description copied from interface: oracle.communication.brm.charging.extensions.framework.ExtensionCallback
      method is invoked once at ECS Node startup time to allow integrators a spot to populate private data members that are required by the extension callback.
      Specified by:
      initialize in interface oracle.communication.brm.charging.extensions.framework.ExtensionCallback<PreRatingExtensionContext>
      Specified by:
      initialize in interface PreRatingExtension
      Parameters:
      extensionContext - the context which exposes objects that are needed at initialization time.
      Throws:
      ExtensionException - if a non-recoverable error occurs during initialization.
    • execute

      public void execute(PreRatingExtensionContext extensionContext) throws ExtensionException
      Description copied from interface: PreRatingExtension
      This execute method is specific to a PreRatingExtension hook. Operator should implement this method to perform their custom logic that is specific to their Pret OCS Rating needs.
      Specified by:
      execute in interface PreRatingExtension
      Parameters:
      extensionContext - context information pertaining to Pre OCS Rating.
      Throws:
      ExtensionException - throw and exception if a non-recoverable error occurs. This exception will be logged and a EXTENSION_ERROR ServiceEvent will be set into the UsageResponse.
    • shutdown

      public void shutdown(ExtensionContext extensionContext) throws ExtensionException
      Description copied from interface: oracle.communication.brm.charging.extensions.framework.ExtensionCallback
      method is invoked once at ECS Node shutdown time to allow integrators a spot to release any resources that were acquired by the Extension.
      Specified by:
      shutdown in interface oracle.communication.brm.charging.extensions.framework.ExtensionCallback<PreRatingExtensionContext>
      Specified by:
      shutdown in interface PreRatingExtension
      Parameters:
      extensionContext - the context which exposes objects that are needed at shutdown time.
      Throws:
      ExtensionException - if a non-recoverable error occurs during shutdown.