Class DefaultCartEntryActionFacade
- java.lang.Object
-
- de.hybris.platform.acceleratorfacades.cart.action.impl.DefaultCartEntryActionFacade
-
- All Implemented Interfaces:
CartEntryActionFacade
public class DefaultCartEntryActionFacade extends java.lang.Object implements CartEntryActionFacade
Default implementation of theCartEntryActionFacadeinterface.
-
-
Constructor Summary
Constructors Constructor Description DefaultCartEntryActionFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>executeAction(CartEntryAction action, java.util.List<java.lang.Long> entryNumbers)This method will triggerCartEntryActionHandler.handleAction(List)on theCartEntryActionHandlerconfigured for the given .protected CartEntryActionHandlerRegistrygetCartEntryActionHandlerRegistry()java.util.Optional<java.lang.String>getErrorMessageKey(CartEntryAction action)Provides the key to the message that should be displayed when a CartEntryActionException is thrown.java.util.Optional<java.lang.String>getSuccessMessageKey(CartEntryAction action)Provides the key to the message that should be displayed when an action runs with success.voidsetCartEntryActionHandlerRegistry(CartEntryActionHandlerRegistry cartEntryActionHandlerRegistry)
-
-
-
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:CartEntryActionFacadeThis method will triggerCartEntryActionHandler.handleAction(List)on theCartEntryActionHandlerconfigured for the given .- Specified by:
executeActionin interfaceCartEntryActionFacade- 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:CartEntryActionFacadeProvides the key to the message that should be displayed when an action runs with success.- Specified by:
getSuccessMessageKeyin interfaceCartEntryActionFacade- 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:CartEntryActionFacadeProvides the key to the message that should be displayed when a CartEntryActionException is thrown.- Specified by:
getErrorMessageKeyin interfaceCartEntryActionFacade- Parameters:
action- the action you want the message key for.- Returns:
- the error message key.
-
getCartEntryActionHandlerRegistry
protected CartEntryActionHandlerRegistry getCartEntryActionHandlerRegistry()
-
setCartEntryActionHandlerRegistry
public void setCartEntryActionHandlerRegistry(CartEntryActionHandlerRegistry cartEntryActionHandlerRegistry)
-
-