Metered

Inheritance: java.lang.Object

public class Metered

Provides methods to set metered key.


In this example, an attempt will be made to set metered public and private key the component jar file:


  Metered metered = new Metered();
  metered.setMeteredKey("PublicKey", "PrivateKey");
  

Constructors

ConstructorDescription
Metered()

Methods

MethodDescription
getConsumptionCredit()Gets consumption credit.
getConsumptionQuantity()Gets consumption file size.
isLicensed()Checks whether the product is successfully licensed using Metered license.
resetMeteredKey()Removes previously setup license.
setMeteredKey(String publicKey, String privateKey)Sets metered public and private keys.

Metered()

public Metered()

getConsumptionCredit()

public static BigDecimal getConsumptionCredit()

Gets consumption credit.

Returns: java.math.BigDecimal - Returns the number of consumed credit points.

getConsumptionQuantity()

public static BigDecimal getConsumptionQuantity()

Gets consumption file size.

Returns: java.math.BigDecimal - Returns the number of consumed bytes.

isLicensed()

public final boolean isLicensed()

Checks whether the product is successfully licensed using Metered license.

Returns: boolean - true or false

resetMeteredKey()

public final void resetMeteredKey()

Removes previously setup license.

setMeteredKey(String publicKey, String privateKey)

public final void setMeteredKey(String publicKey, String privateKey)

Sets metered public and private keys.

Parameters:

ParameterTypeDescription
publicKeyjava.lang.StringThe public key.
privateKeyjava.lang.StringThe private key.

If you purchase metered license, this API should be called on application startup, normally, this is enough. However, if metered fails to upload consumption data during 24 hours period, the license will be set to evaluation status. To avoid such case, you should regularly check the license status If it is evaluation status, call this API again. |