Package com.loop54.user
Interface IRemoteClientInfo
- All Known Implementing Classes:
NullClientInfo
public interface IRemoteClientInfo
This interface contains methods used to get information about the end-user client request.
-
Method Summary
Modifier and TypeMethodDescriptionGets the value of a cookie with a given name.Get the Referer(sic) header sent by the end-user.Get the IP address of the end-user.getRequestHeader(String name) Get a named header from the request made by the end-user.Get the User-Agent header sent by the end-user.voidsetCookie(String name, String value, LocalDateTime expiryTime) Sets a cookie with a given name, value and expiryTime.
-
Method Details
-
getRequestHeader
Get a named header from the request made by the end-user.- Parameters:
name- The name of the header. Can be of any casing.- Returns:
- If the header isn't set return null, otherwise the string value of the header.
-
getReferrer
String getReferrer()Get the Referer(sic) header sent by the end-user.- Returns:
- Referer header or null if it doesn't exist.
-
getUserAgent
String getUserAgent()Get the User-Agent header sent by the end-user.- Returns:
- User-Agent header or null if it doesn't exist.
-
getRemoteIp
String getRemoteIp()Get the IP address of the end-user.- Returns:
- IP address or null if it doesn't exist.
-
getCookie
Gets the value of a cookie with a given name. This needs to be able return cookies set withsetCookie(String, String, LocalDateTime)- Parameters:
name- Name of the cookie- Returns:
- Return the cookie data or null if it doesn't exist.
-
setCookie
Sets a cookie with a given name, value and expiryTime. Cookies set by this method needs to be accessible withgetCookie(String);- Parameters:
name- Name of the cookie to setexpiryTime- When the cookie should expirevalue- What value to set on the cookie
-