Metered Licensing

Metered Licensing

Here are the simple steps to use the Metered class.

  1. Create an instance of Metered class.
  2. Pass public & private keys to setMeteredKey method.
  3. Do processing (perform task).
  4. call method getConsumptionQuantity of the Metered class.
  5. It will return the amount/quantity of API requests that you have consumed so far.

Following is the sample code demonstrating how to set metered public and private key.

com.aspose.imaging.Metered metered = new com.aspose.imaging.Metered();
//Specify public and private metered keys
metered.setMeteredKey(publicKey, privateKey);
//getConsumptionQuantity of the Metered class.
BigDecimal credit = com.aspose.imaging.Metered.getConsumptionCredit();
BigDecimal quanity = com.aspose.imaging.Metered.getConsumptionQuantity();