Metered

Inheritance: java.lang.Object

public class Metered

Provides methods to license the component with Metered license.

Lean more

The following example demonstrates demonstrates how to activate product with Metered keys.

string publicKey = “Public Key”; string privateKey = “Private Key”;

Metered metered = new Metered(); metered.setMeteredKey(publicKey, privateKey);

Constructors

Constructor Description
Metered() Initializes a new instance of the [Metered](../../com.groupdocs.watermark.licensing/metered) class.

Methods

Method Description
setMeteredKey(String publicKey, String privateKey) Activates product with Metered keys.
getConsumptionQuantity() Retrieves amount of MBs processed.
getConsumptionCredit() Retrieves count of credits consumed.

Metered()

public Metered()

Initializes a new instance of the [Metered](../../com.groupdocs.watermark.licensing/metered) class.

setMeteredKey(String publicKey, String privateKey)

public void setMeteredKey(String publicKey, String privateKey)

Activates product with Metered keys.

Parameters:

Parameter Type Description
publicKey java.lang.String The public key.
privateKey java.lang.String The private key.

getConsumptionQuantity()

public static double getConsumptionQuantity()

Retrieves amount of MBs processed.

The following example demonstrates 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();

Returns: double - The amount of MBs processed.

getConsumptionCredit()

public static double getConsumptionCredit()

Retrieves count of credits consumed.

The following example demonstrates demonstrates how to retrieve count of credits consumed.

string publicKey = “Public Key”; string privateKey = “Private Key”;

Metered metered = new Metered(); metered.setMeteredKey(publicKey, privateKey);

double creditsConsumed = Metered.getConsumptionCredit();

Returns: double - The count of credits consumed.