Class SamplePreRatingDelay
java.lang.Object
oracle.communication.brm.charging.sdk.extensions.SamplePreRatingDelay
- All Implemented Interfaces:
PreRatingExtension,oracle.communication.brm.charging.extensions.framework.ExtensionCallback<PreRatingExtensionContext>
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PreRatingExtensionContext extensionContext) This execute method is specific to a PreRatingExtension hook.voidinitialize(ExtensionContext extensionContext) 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.voidshutdown(ExtensionContext extensionContext) method is invoked once at ECS Node shutdown time to allow integrators a spot to release any resources that were acquired by the Extension.
-
Constructor Details
-
SamplePreRatingDelay
public SamplePreRatingDelay()
-
-
Method Details
-
initialize
Description copied from interface:oracle.communication.brm.charging.extensions.framework.ExtensionCallbackmethod 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:
initializein interfaceoracle.communication.brm.charging.extensions.framework.ExtensionCallback<PreRatingExtensionContext>- Specified by:
initializein interfacePreRatingExtension- Parameters:
extensionContext- the context which exposes objects that are needed at initialization time.- Throws:
ExtensionException- if a non-recoverable error occurs during initialization.
-
execute
Description copied from interface:PreRatingExtensionThis 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:
executein interfacePreRatingExtension- 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
Description copied from interface:oracle.communication.brm.charging.extensions.framework.ExtensionCallbackmethod 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:
shutdownin interfaceoracle.communication.brm.charging.extensions.framework.ExtensionCallback<PreRatingExtensionContext>- Specified by:
shutdownin interfacePreRatingExtension- Parameters:
extensionContext- the context which exposes objects that are needed at shutdown time.- Throws:
ExtensionException- if a non-recoverable error occurs during shutdown.
-