com.shephertz.app42.paas.sdk.jme.appTab
Class ChargeService

java.lang.Object
  extended by com.shephertz.app42.paas.sdk.jme.appTab.ChargeService

public class ChargeService
extends java.lang.Object

ChargeService is part of AppTab which is a rating, metering, charging and billing engine. This service allows app developers to specify the rate for a particular charge parameter. e.g. Storage, Bandwidth, Feature. It provides methods for first creating the scheme for charging which specifies the unit of charging and the associated price. Subsequently a chargeXXX call has to be made for charging. e.g. If an App developer wants to charge on Storage, He can use the method createStorageCharge and specify that for 10 KB/MB/GB TB the price is 10 USD. Once the scheme is created. The app developer can call the chargeStorage whenever storage is utilized. e.g. 5MB. The bill is calculated based on package which is specified.


Constructor Summary
ChargeService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
          This is a constructor that takes
 
Method Summary
 Charge chargePackage(java.lang.String schemeName, java.lang.String packageName, java.lang.String chargeUser, java.lang.Double storageSpace, java.lang.String usageStorage, java.lang.String type)
           
 Charge createBandwidthCharge(java.lang.String bandwidthName, java.lang.Double bandwidthUsage, java.lang.String usageBandWidth, java.lang.Double bandwidthPrice, java.lang.String bandwidthCurrency, java.lang.String bandwidthDescription)
          Creates the scheme for bandwidth based charging.
 Charge createFeatureCharge(java.lang.String featureName, java.lang.Double featurePrice, java.lang.String featureCurrency, java.lang.String featureDescription)
          Creates the scheme for feature based charging.
 Charge createStorageCharge(java.lang.String storageName, java.lang.Double storageSpace, java.lang.String usageStorage, java.lang.Double storagePrice, java.lang.String storageCurrency, java.lang.String storageDescription)
          Creates the scheme for storage based charging.
 Charge validatePackageUsage(java.lang.String schemeName, java.lang.String packageName, java.lang.String featureName, java.lang.String userName, java.lang.Double storageSpace, java.lang.String usageStorage)
          Check and Validate a package usage under this module before you plan a pricing for it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChargeService

public ChargeService(java.lang.String apiKey,
                     java.lang.String secretKey,
                     java.lang.String baseURL)
This is a constructor that takes

Parameters:
apiKey -
secretKey -
baseURL -
Method Detail

chargePackage

public Charge chargePackage(java.lang.String schemeName,
                            java.lang.String packageName,
                            java.lang.String chargeUser,
                            java.lang.Double storageSpace,
                            java.lang.String usageStorage,
                            java.lang.String type)
                     throws App42Exception
Throws:
App42Exception

createBandwidthCharge

public Charge createBandwidthCharge(java.lang.String bandwidthName,
                                    java.lang.Double bandwidthUsage,
                                    java.lang.String usageBandWidth,
                                    java.lang.Double bandwidthPrice,
                                    java.lang.String bandwidthCurrency,
                                    java.lang.String bandwidthDescription)
                             throws App42Exception
Creates the scheme for bandwidth based charging. It is best suited for network based bandwidth usage.

Parameters:
bandwidthName - - name of the scheme
bandwidthUsage - - bandwidth usage for the scheme
usageBandWidth - - bandwidth unit for the scheme
bandwidthPrice - - The price of the level scheme
bandwidthCurrency - - Currency to be used for the scheme
bandwidthDescription - - Description of the scheme
Throws:
App42Exception

createFeatureCharge

public Charge createFeatureCharge(java.lang.String featureName,
                                  java.lang.Double featurePrice,
                                  java.lang.String featureCurrency,
                                  java.lang.String featureDescription)
                           throws App42Exception
Creates the scheme for feature based charging. Feature based charging is suited for Software Applications. E.g. Within mobile, desktop, SaaS based charging based on features. One can charge based on number of features one uses.

Parameters:
featureName - - The name of the scheme
featurePrice - - The price of the scheme
featureCurrency - - Currency to be used for that scheme
featureDescription - - Description of the scheme
Throws:
App42Exception

createStorageCharge

public Charge createStorageCharge(java.lang.String storageName,
                                  java.lang.Double storageSpace,
                                  java.lang.String usageStorage,
                                  java.lang.Double storagePrice,
                                  java.lang.String storageCurrency,
                                  java.lang.String storageDescription)
                           throws App42Exception
Creates the scheme for storage based charging. It is best suited for disk based storage usage. E.g. photo Storage, file Storage, RAM usage, Secondary Storage.

Parameters:
storageName - - The name of the scheme
storageSpace - - storage space for the scheme
usageStorage - - Storage units to be used for the scheme
storagePrice - - The price of the scheme
storageCurrency - - Currency to be used for that scheme
storageDescription - - Description of the scheme
Throws:
App42Exception

validatePackageUsage

public Charge validatePackageUsage(java.lang.String schemeName,
                                   java.lang.String packageName,
                                   java.lang.String featureName,
                                   java.lang.String userName,
                                   java.lang.Double storageSpace,
                                   java.lang.String usageStorage)
                            throws App42Exception
Check and Validate a package usage under this module before you plan a pricing for it.

Parameters:
schemeName - - Name of scheme you wan't to validate
packageName - - Name of package you wan't to validate
featureName - - Name of feature you wan't to validate
userName - - Name of user for which you wan't to validate for the package
storageSpace - - StorageSpace of scheme you wan't to validate
storageUnit - - Unit of storage you wan't to validate (it is either in KB, MB, GB Or TB.
Returns:
The Charge Object
Throws:
App42Exception