Interface ExtensionBalance
public interface ExtensionBalance
Exposes balance API to be accessed in customization
- Since:
- 11.2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionThis method Fetches the balance numeric code and beCodevoid
generateSpendingLimitNotificationEvents
(String beCode, UnitValue existingCurrBalanceWithConsumed, UnitValue newCurrBalanceWithConsumed, Collection<oracle.communication.brm.charging.config.offerprofile.OfferProfile> offerProfiles, ZonedDateTime eventTime, oracle.communication.brm.charging.extensions.client.notification.UpdateExtensionContext extensionContext) This method Generates the Spending Limit Notification Eventvoid
generateSpendingLimitNotificationEventsForPostCharging
(String beCode, UnitValue existingCurrBalanceWithConsumed, UnitValue newCurrBalanceWithConsumed, Collection<oracle.communication.brm.charging.config.offerprofile.OfferProfile> offerProfiles, ZonedDateTime eventTime, PostChargingExtensionContext extensionContext) This method Generates the Spending Limit Notification EventThis method returns the map of remaining balances with key as balance resource code the first value in the pair is remaining balance without credit limit cap; the second value is up to credit limitgetAvailableBalance
(Integer numericCode) This method calculates and returns the available balance valid at current usage session start time.Calculates and returns the available balance.getAvailableBalance
(Integer numericCode, String sessionId, ZonedDateTime sessionStartTime) This method calculates and returns the available balance as applicable at the sessionStartTime passed.getAvailableBalance
(String beCode, String sessionId, ZonedDateTime sessionStartTime) getAvailableBalanceUpToCreditLimit
(Integer paramInteger) This method returns the Available Balance UpTo CreditLimitThis method returns the extension balance IdThis method returns the extension business profile objectoracle.communication.brm.charging.config.consumptionrule.ConsumptionRule
getConsumptionRule
(String beCode) Method to get the consumption rule for the given Balance Element Get the BalanceItemSpec for this beCode and check if the consumptionRule is not null.This method returns the extension credit profile object that has the details about the credit limits and thresholds.int
Retrun the balanceElementId of the Currency resource.getCurrentBalance
(Integer numericCode, ZonedDateTime sessionStartTime) Returns the current balance for the given resource considering the balance items valid during the specified validity rangegetOriginalBalance
(Integer numericCode) This method calculates and returns the original balance valid at current usage session start time.This method returns the owner IdgetRemainingBalance
(Integer numericCode) This method returns the remaining balance valid at current usage session start time.getRemainingBalanceUptoCreditLimit
(Integer numericCode) This method returns the remaining balance valid at current usage session start time capped at teh credit limit.Collection
<oracle.communication.brm.charging.balance.BalanceItem> getValidBalanceItems
(String beCode, ZonedDateTime sessionStartTime) Get the balance items that are valid for a given session start time
-
Method Details
-
getAvailableBalance
This method calculates and returns the available balance valid at current usage session start time.Calculates and returns the available balance. The logic is: availableBalance = currentBalance - totalReservedBalance The current usage session id's reserved balance is also considered as available.The balance state fetched is prior to applying current usage rating impacts.
- Parameters:
numericCode
- balanceElement's unique numeric code (eg, 840, 978, etc..)- Returns:
- the available balance amount or null if Balance does not contain a BalanceItem for the supplied numeric code and session start time
-
getAvailableBalance
UnitValue getAvailableBalance(Integer numericCode, String sessionId, ZonedDateTime sessionStartTime) This method calculates and returns the available balance as applicable at the sessionStartTime passed. The logic is: availableBalance = currentBalance - totalReservedBalance If session id is passed, then the reserved amount from it is considered as available and hence is not deducted from current balance.Note: The reserved amount already has the opposite sign (debit) as current balance (credit) and hence is 'added' in the code below. This method calls the utility method to perform the actual functionality
- Parameters:
numericCode
- balanceElement's unique numeric code (eg, 840, 978, etc..)sessionId
- that identifies the current session, if null is supplied then the result will be the total unreserved available balance.sessionStartTime
- the session start time- Returns:
- the available balance amount or null if Balance does not contain a BalanceItem for the supplied alpha code and range
-
getAvailableBalance
-
generateSpendingLimitNotificationEvents
void generateSpendingLimitNotificationEvents(String beCode, UnitValue existingCurrBalanceWithConsumed, UnitValue newCurrBalanceWithConsumed, Collection<oracle.communication.brm.charging.config.offerprofile.OfferProfile> offerProfiles, ZonedDateTime eventTime, oracle.communication.brm.charging.extensions.client.notification.UpdateExtensionContext extensionContext) This method Generates the Spending Limit Notification Event -
fetchBalanceDetails
This method Fetches the balance numeric code and beCode -
getOriginalBalance
This method calculates and returns the original balance valid at current usage session start time. Calculates and returns the original balance.The balance state fetched is prior to applying current usage rating impacts.
- Parameters:
numericCode
- balanceElement's unique numeric code (eg, 840, 978, etc..)- Returns:
- the original balance amount or null if Balance does not contain a BalanceItem for the supplied numeric code and session start time
-
getCurrentBalance
Returns the current balance for the given resource considering the balance items valid during the specified validity range- Parameters:
numericCode
- resource idsessionStartTime
- Session Start Time- Returns:
- current balance
-
getRemainingBalance
This method returns the remaining balance valid at current usage session start time.- Parameters:
numericCode
- balanceElement's unique numeric code (eg, 840, 978, etc..)- Returns:
- the remaining balance amount or null if Balance does not contain a BalanceItem for the supplied numeric code and session start time
-
getRemainingBalanceUptoCreditLimit
This method returns the remaining balance valid at current usage session start time capped at teh credit limit.- Parameters:
numericCode
- balanceElement's unique numeric code (eg, 840, 978, etc..)- Returns:
- the remaining balance amount or null if Balance does not contain a BalanceItem for the supplied numeric code and session start time
-
getAllRemainingBalance
Map<String,oracle.communication.brm.charging.util.misc.Pair<UnitValue, getAllRemainingBalance()UnitValue>> This method returns the map of remaining balances with key as balance resource code the first value in the pair is remaining balance without credit limit cap; the second value is up to credit limit -
getCreditProfileDetails
ExtensionCreditProfile getCreditProfileDetails()This method returns the extension credit profile object that has the details about the credit limits and thresholds.- Returns:
- the extension credit profile object
-
getBusinessProfileDetails
ExtensionBusinessProfile getBusinessProfileDetails()This method returns the extension business profile object- Returns:
- the extension business profile object, null if there is no business profile
-
getBalanceId
String getBalanceId()This method returns the extension balance Id -
getOwnerId
String getOwnerId()This method returns the owner Id -
getAvailableBalanceUpToCreditLimit
This method returns the Available Balance UpTo CreditLimit -
generateSpendingLimitNotificationEventsForPostCharging
void generateSpendingLimitNotificationEventsForPostCharging(String beCode, UnitValue existingCurrBalanceWithConsumed, UnitValue newCurrBalanceWithConsumed, Collection<oracle.communication.brm.charging.config.offerprofile.OfferProfile> offerProfiles, ZonedDateTime eventTime, PostChargingExtensionContext extensionContext) This method Generates the Spending Limit Notification Event -
getConsumptionRule
oracle.communication.brm.charging.config.consumptionrule.ConsumptionRule getConsumptionRule(String beCode) Method to get the consumption rule for the given Balance Element Get the BalanceItemSpec for this beCode and check if the consumptionRule is not null. If not null, apply it on BIs and get the BI Id If null/NONE, check the balance element level consumption rule. If NONE, get the system property set for consumption rule.- Parameters:
beCode
- Balance Element Code- Returns:
- Consumption Rule applicable for the given Balance Element
-
getValidBalanceItems
Collection<oracle.communication.brm.charging.balance.BalanceItem> getValidBalanceItems(String beCode, ZonedDateTime sessionStartTime) Get the balance items that are valid for a given session start time- Parameters:
beCode
- Impacted Balance Element CodesessionStartTime
- Session Start Time- Returns:
- Collection of valid Balance Items
-
getCurrencyBalanceItemId
int getCurrencyBalanceItemId()Retrun the balanceElementId of the Currency resource. Assuming there is only one currency resource impacted.- Returns:
-