com.groupdocs.viewer.licensing.metered

Class Metered

  • java.lang.Object
    • com.groupdocs.foundation.license.aspose.metered.Metered
      • com.groupdocs.viewer.licensing.metered.Metered


  • public class Metered
    extends com.groupdocs.foundation.license.aspose.metered.Metered

    Provides methods which allow to activate product with Metered license and retrieve amount of MBs processed. Learn more about Metered licenses at https://purchase.groupdocs.com/faqs/licensing/metered.

    • Constructor Detail

      • Metered

        public Metered()
    • Method Detail

      • getConsumptionQuantity

        public static double getConsumptionQuantity()
                                             throws Exception

        Retrieves amount of MBs processed.


         Following example demonstrates how to retrieve amount of MBs processed.
         
        String publicKey = "Public Key";
         String privateKey = "Private Key";
         Metered metered = new Metered();
         metered.setMeteredKey(publicKey, privateKey);
         double mbProcessed = Metered.getConsumptionQuantity();
         

        Throws:
        Exception
      • setMeteredKey

        public void setMeteredKey(String publicKey,
                         String privateKey)
                           throws Exception

        Activates product with Metered keys.


         Following example demonstrates how to activate product with Metered keys.
         
        String publicKey = "Public Key";
         String privateKey = "Private Key";
         Metered metered = new Metered();
         metered.setMeteredKey(publicKey, privateKey);
         

        Overrides:
        setMeteredKey in class com.groupdocs.foundation.license.aspose.metered.Metered
        Parameters:
        publicKey - The public key.
        privateKey - The private key.
        Throws:
        Exception