Package com.nettoolkit.gatekeeper
Class Visit
java.lang.Object
com.nettoolkit.gatekeeper.Visit
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet authorization for this visit.Get country code of visit.Get country name of visit.longGet visit creation timestamp in milliseconds.Get visit domain.getId()Get visit ID.Get visit IP address.getPage()Get visit page.Get ID of policy used to authorize this visit.Get name of policy used to authorize this visit.Get reason for authorization.getTags()Get a list of tags for this visitor.Get visitor user agent.Get visitor user ID.
-
Constructor Details
-
Visit
- Throws:
ParsingException
-
-
Method Details
-
getId
Get visit ID.- Returns:
- visit ID
-
getIpAddress
Get visit IP address.- Returns:
- IP address in IPv4 dot notation or IPv6 hexadecimal
-
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
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
Get visitor user ID.- Returns:
- visitor user ID or
nullif absent
-
getUserAgent
Get visitor user agent.- Returns:
- visitor user agent or
nullif absent
-
getCountryCode
Get country code of visit. Country codes are in ISO Alpha-2 format. For example,"US","JP", etc.- Returns:
- visit country code
-
getCountryName
Get country name of visit.- Returns:
- visit country name
-
getTags
Get a list of tags for this visitor.- Returns:
- list of tags
-
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
nullif not applicable
-
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
nullif not applicable
-
getAuthorization
Get authorization for this visit. Authorization will only be present if visit was created during visit authorization.- Returns:
- authorization or
nullif not applicable
-
getReason
Get reason for authorization. Reason will only be present if visit was created during visit authorization.- Returns:
- reason for authorization or
nullif not applicable
-
getCreated
public long getCreated()Get visit creation timestamp in milliseconds. Time zone is set to UTC.- Returns:
- visit creation timestamp
-