Interface OptOutService


  • public interface OptOutService

    The @{code OptOutService} provides the names of cookies/headers that represent the user's choice of "opting out", i.e. not wanting to be tracked by means of cookies. The service also provides the names of white-listed cookies and a convenience method to determine whether a given request is opted out.

    This service is intended to be used by applications for the purpose of identifying opted-out requests and change behavior regarding the setting of cookies according to the opt-out status and / or white-list.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Collection<java.lang.String> getCookieNames()
      A configured collection of names of cookies that a client can set to opt-out of tracking.
      java.util.Map<java.lang.String,​java.lang.String> getHeaders()
      A map of name/value pairs of HTTP headers that a client can set to opt-out of tracking.
      java.util.Collection<java.lang.String> getWhitelistCookieNames()
      A collection of names of cookies that are still allowed by configuration to be set regardless of the client opting out.
      boolean isOptedOut​(HttpServletRequest request)
      Determines whether the request contains any cookies or headers that match any of the configured opt-out cookies or headers.
    • Method Detail

      • getCookieNames

        java.util.Collection<java.lang.String> getCookieNames()
        A configured collection of names of cookies that a client can set to opt-out of tracking.
        Returns:
        An unordered Collection representing the cookie names.
      • getHeaders

        java.util.Map<java.lang.String,​java.lang.String> getHeaders()
        A map of name/value pairs of HTTP headers that a client can set to opt-out of tracking.
        Returns:
        A Map representing the configured header name/value pairs.
      • getWhitelistCookieNames

        java.util.Collection<java.lang.String> getWhitelistCookieNames()
        A collection of names of cookies that are still allowed by configuration to be set regardless of the client opting out.
        Returns:
        An unordered Collection representing the cookie names.
      • isOptedOut

        boolean isOptedOut​(HttpServletRequest request)
        Determines whether the request contains any cookies or headers that match any of the configured opt-out cookies or headers. In the case of cookies, the simple existence of the cookie is enough to opt-out. In the case of headers, the header-value must correspond to the configured value.
        Parameters:
        request - The request to check.
        Returns:
        true if the request contains any of the cookies/headers indicated via getCookieNames() or getHeaders().