Class APIUsage

java.lang.Object
org.deltava.beans.stats.APIUsage
All Implemented Interfaces:
Serializable, Comparable<APIUsage>, Cacheable

public class APIUsage extends Object implements Cacheable, Comparable<APIUsage>
A bean to store external API usage statistics.
Since:
9.0
Version:
9.0
Author:
Luke
See Also:
  • Constructor Details

    • APIUsage

      public APIUsage(Instant dt, String name)
      Creates the bean.
      Parameters:
      dt - the date/time
      name - the API method name
  • Method Details

    • getName

      public String getName()
      Returns the API/method name.
      Returns:
      the name
    • getDate

      public Instant getDate()
      Returns the statistics date.
      Returns:
      the date/time
    • getTotal

      public int getTotal()
      Returns the total number of API invocations.
      Returns:
      the number of invocations
    • getAnonymous

      public int getAnonymous()
      Returns the number of anonymous API invocations.
      Returns:
      the number of invocations
    • getBlocked

      public int getBlocked()
      Returns the number of blocked API invocations.
      Returns:
      the number of blocked invocations
    • setTotal

      public void setTotal(int cnt)
      Updates the total number of API invocations.
      Parameters:
      cnt - the number of invocations
    • setAnonymous

      public void setAnonymous(int cnt)
      Updates the number of anonymous API invocations.
      Parameters:
      cnt - the number of invocations
    • setBlocked

      public void setBlocked(int cnt)
      Updates the number of blocked API invocations.
      Parameters:
      cnt - the number of invocations
    • compareTo

      public int compareTo(APIUsage u2)
      Specified by:
      compareTo in interface Comparable<APIUsage>
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object