Package com.nettoolkit.gatekeeper
Class CountVisitsForPolicyRequest
java.lang.Object
com.nettoolkit.internal.request.BaseApiRequest
com.nettoolkit.internal.request.GetRequest
com.nettoolkit.gatekeeper.CountVisitsForPolicyRequest
Request to count visits for a certain policy. Corresponds to endpoint
GET /v1/gatekeeper/visits/count-for-policy. Policy ID and IP address are required.
Sample:
int numVisits = gatekeeperClient.newCountVisitsForPolicyRequest()
.policyId("14f4a740-e3ef-47a4-8315-aa4316c2e7b5")
.ip("1.2.3.4")
.send();
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.nettoolkit.internal.request.GetRequest
getHttpMethod, serializeParametersMethods inherited from class com.nettoolkit.internal.request.BaseApiRequest
getClient, getParameters, newHttpRequestBuilder, toHttpRequest, toString
-
Constructor Details
-
CountVisitsForPolicyRequest
-
-
Method Details
-
getPath
- Specified by:
getPathin classBaseApiRequest
-
policyId
Sets the policy ID. The visit count as seen by this policy will be returned. required- Parameters:
policyId- the policy ID- Returns:
- this
-
policyId
Sets the policy ID.- Parameters:
strPolicyId- the policy ID as a string- Returns:
- this
- Throws:
IllegalArgumentException- if the string is not a valid UUID- See Also:
-
ip
Sets the visit IP address. Expects dot notation for IPv4 and hexadecimal for IPv6. required- Parameters:
strIpAddress- the IP address in dot or hexadecimal format- Returns:
- this
-
send
Sends the request.- Returns:
- the visit count for IP address as seen by policy
- Throws:
NetToolKitException
-