Class DefaultCartEntryActionFacade

    • Constructor Detail

      • DefaultCartEntryActionFacade

        public DefaultCartEntryActionFacade()
    • Method Detail

      • executeAction

        public java.util.Optional<java.lang.String> executeAction​(CartEntryAction action,
                                                                  java.util.List<java.lang.Long> entryNumbers)
                                                           throws CartEntryActionException
        Description copied from interface: CartEntryActionFacade
        This method will trigger CartEntryActionHandler.handleAction(List) on the CartEntryActionHandler configured for the given .
        Specified by:
        executeAction in interface CartEntryActionFacade
        Parameters:
        action - the action you want to execute.
        entryNumbers - the cart entry numbers for which the action is executed.
        Returns:
        An empty optional to signal the controller to apply the default behaviour: redisplay the cart page with a success message. Otherwise return a custom redirect URL to navigate elsewhere upon the action completion. The expected url format is the format used as SpringMVC controller method return values.
        Throws:
        CartEntryActionException - when an error occurs during the action execution.
      • getSuccessMessageKey

        public java.util.Optional<java.lang.String> getSuccessMessageKey​(CartEntryAction action)
        Description copied from interface: CartEntryActionFacade
        Provides the key to the message that should be displayed when an action runs with success.
        Specified by:
        getSuccessMessageKey in interface CartEntryActionFacade
        Parameters:
        action - the action you want the message key for
        Returns:
        the success message key.
      • getErrorMessageKey

        public java.util.Optional<java.lang.String> getErrorMessageKey​(CartEntryAction action)
        Description copied from interface: CartEntryActionFacade
        Provides the key to the message that should be displayed when a CartEntryActionException is thrown.
        Specified by:
        getErrorMessageKey in interface CartEntryActionFacade
        Parameters:
        action - the action you want the message key for.
        Returns:
        the error message key.
      • setCartEntryActionHandlerRegistry

        public void setCartEntryActionHandlerRegistry​(CartEntryActionHandlerRegistry cartEntryActionHandlerRegistry)