Interface PageRedirectSupplier
-
- All Known Implementing Classes:
AbstractPageRedirectSupplier
,CategoryPageRedirectSupplier
,ContentPageRedirectSupplier
,ProductPageRedirectSupplier
public interface PageRedirectSupplier
Interface responsible for indicating whether to redirect the request or not and providing the redirect URL if applicable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.function.Predicate<ItemModel>
getConstrainedBy()
Predicate to test if a given page model matches the page type supplier.java.lang.String
getRedirectUrl(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData)
Constructs the redirect url given the http servlet request and the preview data.boolean
shouldRedirect(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData)
Determines whether to redirect the request depending upon the logic in supplier.
-
-
-
Method Detail
-
getConstrainedBy
java.util.function.Predicate<ItemModel> getConstrainedBy()
Predicate to test if a given page model matches the page type supplier.- Returns:
true
if the supplier exists;false
otherwise.
-
shouldRedirect
boolean shouldRedirect(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData)
Determines whether to redirect the request depending upon the logic in supplier.- Parameters:
request
- - the http requestpreviewData
- - the preview data- Returns:
true
if it needs to redirect the request;false
otherwise.
-
getRedirectUrl
java.lang.String getRedirectUrl(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData)
Constructs the redirect url given the http servlet request and the preview data.- Parameters:
request
- - the http servlet requestpreviewData
- - the preview data- Returns:
- the redirect url
-
-