Class DefaultRequestOriginDenialStrategy
- java.lang.Object
-
- de.hybris.platform.ordercancel.impl.denialstrategies.AbstractCancelDenialStrategy
-
- de.hybris.platform.ordercancel.impl.denialstrategies.DefaultRequestOriginDenialStrategy
-
- All Implemented Interfaces:
OrderCancelDenialStrategy
public class DefaultRequestOriginDenialStrategy extends AbstractCancelDenialStrategy implements OrderCancelDenialStrategy
Strategy that forbids cancel, when the end-customer makes the cancel request and configuration prevents cancels by end-customers (only CSA is allowed to make request in that case). To use this strategy, please make sure, that PrincipalModel passed togetCancelDenialReason(OrderCancelConfigModel, OrderModel, PrincipalModel, boolean, boolean)
represents the end-customer. This object is considered to be an end-customer when it's type code is equal toConstants.TYPES.Customer
-
-
Constructor Summary
Constructors Constructor Description DefaultRequestOriginDenialStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OrderCancelDenialReason
getCancelDenialReason(OrderCancelConfigModel configuration, OrderModel order, PrincipalModel requestor, boolean partialCancel, boolean partialEntryCancel)
Determines cancel possibility for given conditions.TypeService
getTypeService()
void
setTypeService(TypeService typeService)
-
Methods inherited from class de.hybris.platform.ordercancel.impl.denialstrategies.AbstractCancelDenialStrategy
getReason, setReason
-
-
-
-
Method Detail
-
getCancelDenialReason
public OrderCancelDenialReason getCancelDenialReason(OrderCancelConfigModel configuration, OrderModel order, PrincipalModel requestor, boolean partialCancel, boolean partialEntryCancel)
Description copied from interface:OrderCancelDenialStrategy
Determines cancel possibility for given conditions.- Specified by:
getCancelDenialReason
in interfaceOrderCancelDenialStrategy
order
- Order that is subject to cancelrequestor
- Principal that originates the request ("issuer of the request"). It might be different from current session user.partialCancel
- if true, the method determines possibility of doing partial cancel. If false, it tests for complete cancel.partialEntryCancel
- only valid if partialCancel is true. If true, the method determines possibility of doing partial entry cancel (decreasing OrderEntry quantity). If false, the method determines possibility of doing whole entry cancel (discarding the whole OrderEntry)- Returns:
- Returns an OrderCancelDenialReason object if cancel is denied for given conditions. Returns null, if cancel is not denied (i.e. it is allowed.)
-
getTypeService
public TypeService getTypeService()
- Returns:
- the typeService
-
setTypeService
public void setTypeService(TypeService typeService)
- Parameters:
typeService
- the typeService to set
-
-