com.groupdocs.editor.license

Class Metered



  • public class Metered
    extends Object

    Provides methods for applying <a href="https://purchase.groupdocs.com/faqs/licensing/metered">Metered</a> license.

    • Constructor Detail

      • Metered

        public Metered()
    • Method Detail

      • getConsumptionCredit

        public static double getConsumptionCredit()
                                           throws Exception

        Retrieves count of credits consumed.


          Following example demonstrates how to retrieve count of credits consumed.
          
          string publicKey = "Public Key";
          string privateKey = "Private Key";
        
          Metered metered = new Metered();
          metered.SetMeteredKey(publicKey, privateKey);
          decimal creditsConsumed = Metered.GetConsumptionCredit();
         
        Returns:
        Count of already used credits
        Throws:
        Exception
      • 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);
          decimal mbProcessed = Metered.GetConsumptionQuantity();
         
        Throws:
        Exception
      • increaseBytesCount

        public static void increaseBytesCount(long bytesCount)
      • increaseCreditsByLength

        public static void increaseCreditsByLength(long bytesCount)
      • increaseCreditsByOne

        public static void increaseCreditsByOne()
      • setMeteredKey

        public final void setMeteredKey(String publicKey,
                         String privateKey)

        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);
         
        Parameters:
        publicKey - The public key.
        privateKey - The private key.