|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.usage.agent.api.CustomMeteringAgent
public class CustomMeteringAgent
CustomMeteringAgent is used to get recorded duration, to check whether usage entry exists, to persist and retrieve usage.
| Constructor Summary | |
|---|---|
CustomMeteringAgent(org.wso2.carbon.registry.core.Registry registry)
Constructor for the custom metering agent |
|
| Method Summary | |
|---|---|
long |
addUsage(String duration,
String measurement,
long value)
Add a long value to the usage, if there were no previous entry, this will start with value 0 |
String[] |
getRecordedDurations(String measurement)
Get recorded durations |
boolean |
isUsageEntryExists(String duration,
String measurement)
Check whether the usage entry exist or not |
void |
persistUsage(String duration,
String measurement,
String value)
Persist usage of a user |
String |
retrieveUsage(String duration,
String measurement)
Retrieve usage of a user |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CustomMeteringAgent(org.wso2.carbon.registry.core.Registry registry)
registry - governance registry of super tenant| Method Detail |
|---|
public String[] getRecordedDurations(String measurement)
throws UsageException
measurement - the measurement to get the duration
UsageException
public boolean isUsageEntryExists(String duration,
String measurement)
throws UsageException
duration - the duration (e.g. year month), null for any durationmeasurement - measurement key
UsageException
public void persistUsage(String duration,
String measurement,
String value)
throws UsageException
duration - the duration (e.g. year month), null for any durationmeasurement - measurement keyvalue - measurement value
UsageException
public String retrieveUsage(String duration,
String measurement)
throws UsageException
duration - the duration (e.g. year month), null for any durationmeasurement - measurement key
UsageException
public long addUsage(String duration,
String measurement,
long value)
throws UsageException
duration - the duration (e.g. year month), null for any durationmeasurement - measurement keyvalue - measurement value
UsageException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||