Class SampleExternalTopUpRequestLauncher
java.lang.Object
oracle.communication.brm.charging.sdk.AbstractSampleProgram
oracle.communication.brm.charging.sdk.update.SampleExternalTopUpRequestLauncher
Sample program to send synchronous ExternalTopUpUpdateRequest to a
ECE charging grid.
Eg.
REQUEST:
User identity = 100000
msg id = UNIQUE_MSG_ID
Operation type = EXTERNAL_TOP_UP_UPDATE
Product type = VOICE
Event type = Request time in ZonedDateTime format
Balance element Id = 840 for USD
Impact quantity = 10 to specify $10 impact
Validity start = -1 (for currency resources) or validity start string (non currency resources)
Validity end = -1 (for currency resources) or validity end string (non currency resources)
Validity extendFlag = TRUE (extends validity of existing bucket)
FALSE (creates new bucket if no matching found)
First usage offset = If no first usage validity, set this field to -1
Example: offset value 2 and unit set to "DAYS" indicates 2 days from first usage.
First usage unit = if no first usage validity, set this field to null
Example: ExternalTopUpUpdateRequest.FirstUsageValidityUnit.DAYS
To indicate whether the quantity represented in offset is in days/hours/minutes or so on
RESPONSE: Status = SUCCESS
-
Nested Class Summary
Nested classes/interfaces inherited from class oracle.communication.brm.charging.sdk.AbstractSampleProgram
AbstractSampleProgram.SampleResponseConsumer<T extends Response<?>>
-
Constructor Summary
ConstructorsConstructorDescriptionSampleExternalTopUpRequestLauncher
(String userIdentity, String msgId, String productType, int beId, BigDecimal quantity, String validityStartStr, String validityEndStr, int numberOfMonths, boolean extendValidity, String requestStartStr, String fuOffsetStr, String fuUnit) Constructor -
Method Summary
Methods inherited from class oracle.communication.brm.charging.sdk.AbstractSampleProgram
createDefaultPayLoad, getBatchRequestService, getContext, getExternalTopUpUpdateRequestBuilderFactory, getLogger, getManagementRequestBuilderFactory, getNResponsesReceived, getPolicyRequestBuilderFactory, getQueryRequestBuilderFactory, getResponsesReceived, getServiceSpecRepository, getStackTrace, getStateManager, getUpdateRequestBuilderFactory, getUsageRequestBuilderFactory, resetResponsesReceived, run, sendAsynchronousRequest, sendRequest, sendRequests, sendUpdateRequest, sendUpdateRequests, waitForResponses
-
Constructor Details
-
SampleExternalTopUpRequestLauncher
public SampleExternalTopUpRequestLauncher(String userIdentity, String msgId, String productType, int beId, BigDecimal quantity, String validityStartStr, String validityEndStr, int numberOfMonths, boolean extendValidity, String requestStartStr, String fuOffsetStr, String fuUnit) Constructor- Parameters:
userIdentity
- user identity or Public user identitymsgId
- unique string to identify each top-up requestproductType
- the product typebeId
- the balance element IDquantity
- the impact quantityvalidityStartStr
- -1 (for currency resources) or validity start string (non currency resources)validityEndStr
- -1 (for currency resources) or validity end string (non currency resources)numberOfMonths
- validity of bucket to be set in months. (if specified then validity start and validity end will be ignored)extendValidity
- whether to extend validity or notrequestStartStr
- request start time stringfuOffsetStr
- first usage offsetfuUnit
- first usage unit. To indicate whether the quantity specified in offset is in DAYS,MONTHS or so on
-
-
Method Details
-
runSample
protected void runSample() throws InterruptedException, MessagesException, SystemHealthException, TimeoutException, ExecutionException, UserNotFoundExceptionDescription copied from class:AbstractSampleProgram
To be implemented by each sample program for specific scenario- Specified by:
runSample
in classAbstractSampleProgram
- Throws:
InterruptedException
MessagesException
SystemHealthException
TimeoutException
ExecutionException
UserNotFoundException
-
main
Main method to start the sample program- Parameters:
args
- arguments args[0]: user identity; eg. 10000 args[1]: product type; eg. VOICE / SMS / DATA or any args[2]: balance element id: eg. 840 for USD args[3]: impact quantity: eg. 10 to indicate 10$ impact args[4]: validity start: eg. -1 (for currency resources) or validity start string (non currency resources) args[5]: validity end: eg. -1 (for currency resources) or validity end string (non currency resources) args[6]: validity of bucket to be set in months. (if specified then validity start and validity end will be ignored) args[7]: extend validity: If true, then validity of bucket will be extended. args[8]: request time: eg. 2013-01-01T00:01:00 if not specified current time will be taken [optional field] args[9]: first usage offset: eg. offset value 2 and unit set to "DAYS" indicates 2 days from first usage [optional field] args[10]: first usage unit: eg. To indicate whether the quantity represented in offset is in days/hours/minutes or so on [optional field]
-