com.groupdocs.merger.licensing.metered

Class Metered



  • public class Metered
    extends Object

    Provides methods for applying Metered license.

    • Constructor Detail

      • Metered

        public Metered()
    • Method Detail

      • getConsumptionCredit

        public static double getConsumptionCredit()
                                           throws Exception

        Retrieves amount of used credits


          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 usedCredits = Metered.getConsumptionCredit();
          
        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);
          double mbProcessed = Metered.getConsumptionQuantity();
          
        Throws:
        Exception
      • setMeteredKey

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