Class APIRequest

java.lang.Object
org.deltava.beans.system.APIRequest
All Implemented Interfaces:
Serializable, Comparable<APIRequest>

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

    • APIRequest

      public APIRequest(String name, boolean isAnonymous)
      Creates the bean.
      Parameters:
      name - the API name
      isAnonymous - TRUE if not authenticated, otherwise FALSE
    • APIRequest

      public APIRequest(String name, String db, boolean isAnonymous, boolean isBlocked)
      Creates the bean.
      Parameters:
      name - the API name
      db - the database to log to
      isAnonymous - TRUE if not authenticated, otherwise FALSE
      isBlocked - TRUE if request was blocked, otherwise FALSE
  • Method Details

    • getName

      public String getName()
      Returns the API name.
      Returns:
      the name
    • getTime

      public Instant getTime()
      Returns the time of the API request.
      Returns:
      the request date/time
    • getDB

      public String getDB()
      Returns the database name.
      Returns:
      the database or null if unspecific
    • getIsAnonymous

      public boolean getIsAnonymous()
      Returns if the request was made by an unauthenticated user.
      Returns:
      TRUE if anonymous, otherwise FALSE
    • isBlocked

      public boolean isBlocked()
      Returns if the request was blocked.
      Returns:
      TRUE if blocked, otherwise FALSE
    • compareTo

      public int compareTo(APIRequest u2)
      Specified by:
      compareTo in interface Comparable<APIRequest>