Class Visit

java.lang.Object
com.nettoolkit.gatekeeper.Visit
All Implemented Interfaces:
Serializable

public class Visit extends Object implements Serializable
Visit is a model for visit information and authorization. Visits contain both provided visit data, such as IP address and URL, and data derived from IP intelligence, such as country and tags. If the visit object was created by visit authorization, it will contain authorization information as well.
See Also:
  • Constructor Details

  • Method Details

    • getId

      public UUID getId()
      Get visit ID.
      Returns:
      visit ID
    • getIpAddress

      public String getIpAddress()
      Get visit IP address.
      Returns:
      IP address in IPv4 dot notation or IPv6 hexadecimal
    • getDomain

      public String getDomain()
      Get visit domain. For example, if visit URL is "https://www.example.com/hello/world?q=abc", this method will return "https://www.example.com".
      Returns:
      visit domain
    • getPage

      public String getPage()
      Get visit page. For example, if visit URL is "https://www.example.com/hello/world?q=abc", this method will return "/hello/world?q=abc".
      Returns:
      visit page
    • getUserId

      public Long getUserId()
      Get visitor user ID.
      Returns:
      visitor user ID or null if absent
    • getUserAgent

      public String getUserAgent()
      Get visitor user agent.
      Returns:
      visitor user agent or null if absent
    • getCountryCode

      public String getCountryCode()
      Get country code of visit. Country codes are in ISO Alpha-2 format. For example, "US", "JP", etc.
      Returns:
      visit country code
    • getCountryName

      public String getCountryName()
      Get country name of visit.
      Returns:
      visit country name
    • getTags

      public List<String> getTags()
      Get a list of tags for this visitor.
      Returns:
      list of tags
    • getPolicyId

      public UUID getPolicyId()
      Get ID of policy used to authorize this visit. Policy ID will only be present if visit was created during visit authorization.
      Returns:
      authorizing policy ID or null if not applicable
    • getPolicyName

      public String getPolicyName()
      Get name of policy used to authorize this visit. Policy name will only be present if visit was created during visit authorization.
      Returns:
      authorizing policy name or null if not applicable
    • getAuthorization

      public String getAuthorization()
      Get authorization for this visit. Authorization will only be present if visit was created during visit authorization.
      Returns:
      authorization or null if not applicable
    • getReason

      public String getReason()
      Get reason for authorization. Reason will only be present if visit was created during visit authorization.
      Returns:
      reason for authorization or null if not applicable
    • getCreated

      public long getCreated()
      Get visit creation timestamp in milliseconds. Time zone is set to UTC.
      Returns:
      visit creation timestamp