Package com.vaadin.flow.server.dau
Class FlowDauIntegration
java.lang.Object
com.vaadin.flow.server.dau.FlowDauIntegration
A utility class for various daily active users collecting methods.
For internal use only. May be renamed or removed in a future release.
- Since:
- 24.5
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyEnforcement(VaadinRequest request, Predicate<VaadinRequest> enforceableRequest) Potentially applies enforcement to the current request if DAU limit is exceeded.static jakarta.servlet.http.CookiegenerateNewCookie(VaadinRequest request) Generates a new cookie for counting daily active users within 24 hour time interval.
-
Method Details
-
generateNewCookie
Generates a new cookie for counting daily active users within 24 hour time interval.
Cookie value is formatted astrackingHash$creationTime, withcreationTimeexpressed as number of milliseconds from the epoch of 1970-01-01T00:00:00Z. The cookie creation time is required on subsequent requests to detect active users. By default, the cookie expires after 24 hours.- Parameters:
request- http request from browser- Returns:
- http cookie to be used to count application's end-users daily
-
applyEnforcement
public static void applyEnforcement(VaadinRequest request, Predicate<VaadinRequest> enforceableRequest) Potentially applies enforcement to the current request if DAU limit is exceeded.
If enforcement has to be applied anEnforcementExceptionis thrown.- Parameters:
request- the Vaadin requestenforceableRequest- predicate to check if the request can be blocked or not.- Throws:
DauEnforcementException- if request must be blocked because of DAU limit exceeded.
-