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 Details

    • getRequestHeader

      String getRequestHeader(String name)
      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

      String getCookie(String name)
      Gets the value of a cookie with a given name. This needs to be able return cookies set with setCookie(String, String, LocalDateTime)
      Parameters:
      name - Name of the cookie
      Returns:
      Return the cookie data or null if it doesn't exist.
    • setCookie

      void setCookie(String name, String value, LocalDateTime expiryTime)
      Sets a cookie with a given name, value and expiryTime. Cookies set by this method needs to be accessible with getCookie(String);
      Parameters:
      name - Name of the cookie to set
      expiryTime - When the cookie should expire
      value - What value to set on the cookie