@Security public class OrderServiceSecurity extends CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams> implements OrderService
OrderServiceentityClass| Constructor and Description |
|---|
OrderServiceSecurity() |
| Modifier and Type | Method and Description |
|---|---|
OrderStatus |
accept(AcceptOrderParams params)
Accepts the given order, which should be in either
OrderStatus.PENDING_BUYER or
OrderStatus.PENDING_SELLER status, and needs
the delivery price to be already set. |
void |
addToCart(java.lang.Long adId,
java.math.BigDecimal quantity)
Adds the given product to the logged user's shopping cart, returning the updated shopping cart.
|
void |
checkCartStock(UserLocatorVO sellerVO,
CurrencyVO currencyVO)
Checks that all items on the given cart are still on stock
|
protected void |
checkCreateNew(OrderDataParams params)
Checks whether creating new entities with the given context parameters is allowed, throwing
PermissionDeniedException if not |
java.lang.Long |
checkout(ShoppingCartCheckoutParams params)
Checks out the logged user's shopping cart with the given seller and currency, checking the confirmation password
(if any), and reserving the
amount when the delivery price is previously known (otherwise, the buyer still needs to confirm before the
payment is done)
|
int |
countCartItems()
Returns the total number of items in the logged user's shopping cart
|
protected void |
customizeData(OrderData data)
Can be overridden in order to process the returned data object for the given entity
|
boolean |
doHasManageAccess(Order order)
Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given
operation
|
boolean |
doHasViewAccess(Order order)
Should be implemented in order to return whether the caller is allowed to view the given entity.
|
OrderData |
getCheckoutData(UserLocatorVO sellerVO,
CurrencyVO currencyVO)
Returns data for checkout the cart items of the given seller and currency
|
protected OrderServiceLocal |
getImplementation()
Should be implemented in order to return the actual implementation of the service
|
ShoppingCartDTO |
getMyCart()
Returns the current logged user's shopping cart, it's read-write because updates the messages.
|
UserSalesData |
getUserSalesData(UserLocatorVO locator)
Returns data for viewing an user sales
|
boolean |
isAccessible(SessionData sessionData,
Order entity)
Must be implemented in order to determine whether the given entity is accessible for the given session data.
|
void |
modifyQuantityOnCart(java.lang.Long adId,
java.math.BigDecimal quantity)
Updates the quantity for the given product on the logged user's shopping cart
|
void |
reject(RejectOrderParams params)
Rejects the given order
|
void |
removeCart(UserLocatorVO sellerVO,
CurrencyVO currencyVO)
Removes the logged user's shopping cart for the given seller and currency
|
void |
removeCartItem(java.lang.Long adId)
Removes the given product from the logged user's shopping cart
|
Page<OrderVO> |
search(OrderQuery query)
Searches for orders based on
OrderQuery |
void |
setDeliveryMethod(SetDeliveryMethodParams deliveryInfo)
Updates the delivery method information of an order when it is on the
OrderStatus.PENDING_SELLER status
and there is no delivery
information yet. |
java.lang.Long |
submitToBuyer(OrderDTO order)
Submits the given order for buyer approval
|
canPerformOperation, canViewHistoryLog, checkManageAccess, checkOperation, checkViewAccess, find, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, hasManageAccess, hasViewAccess, load, onBeforeSave, remove, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveEntityCheck, save, saveWithConfirmationPasswordcheckGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initializecanManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getAccountHandler, getAuthHandler, getBaseEntityManagerHandler, getChannelConfiguration, getConfiguration, getConversionHandler, getCustomFieldValueHandler, getEntityManagerHandler, getGroupsHandler, getLoggedBasicUser, getLoggedUser, getProducts, getProductsHandler, getReportHandler, getTranslatedName, getTranslatedValue, getUserLocatorHandler, getValidationResult, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validatedelete, detach, find, flush, from, getApplicationContext, getConfigurationHandler, getDataTranslationHandler, getFormatter, getFormatter, getFormatter, getLogger, getNotificationHandler, getProfileFieldHandler, getRemoteAddress, getSessionData, getTransactionHandler, getTranslationHandler, message, message, persist, processBatch, refresh, remove, subQuery, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetData, getDataForNew, load, remove, removeAll, savepublic OrderStatus accept(AcceptOrderParams params) throws FrameworkException, TransferException, PasswordException
OrderServiceOrderStatus.PENDING_BUYER or
OrderStatus.PENDING_SELLER status, and needs
the delivery price to be already set. When the buyer hasn't yet chosen a payment type, it is required now. Also,
when no amount was reserved,
the confirmation password will be checked before performing the actual payment.accept in interface OrderServicePasswordException - The given confirmation password is invalidIllegalActionException - The given order is not in either OrderStatus.PENDING_BUYER or
OrderStatus.PENDING_SELLER statusTransferException - When there was a problem while reserving the amount, like there is no available balanceFrameworkExceptionpublic void addToCart(java.lang.Long adId,
java.math.BigDecimal quantity)
throws FrameworkException,
OutOfStockException
OrderServiceaddToCart in interface OrderServiceOutOfStockException - When the given quantity is greater than the available stockFrameworkExceptionpublic void checkCartStock(UserLocatorVO sellerVO, CurrencyVO currencyVO) throws FrameworkException, OutOfStockException
OrderServicecheckCartStock in interface OrderServiceFrameworkExceptionOutOfStockExceptionpublic java.lang.Long checkout(ShoppingCartCheckoutParams params) throws FrameworkException, EntityNotFoundException, OutOfStockException, TransferException, PasswordException
OrderServicecheckout in interface OrderServiceEntityNotFoundException - When there is no current shopping cart order with the given seller and currencyPasswordException - The given confirmation password is invalidOutOfStockException - When at least one of the expected items exceeds the available stockTransferException - When there was a problem while reserving the amount, like there is no available balanceFrameworkExceptionpublic int countCartItems()
throws FrameworkException
OrderServicecountCartItems in interface OrderServiceFrameworkExceptionpublic boolean doHasManageAccess(Order order)
CRUDServiceSecuritydoHasManageAccess in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>public boolean doHasViewAccess(Order order)
CRUDServiceSecuritydoHasViewAccess in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>public OrderData getCheckoutData(UserLocatorVO sellerVO, CurrencyVO currencyVO)
OrderServicegetCheckoutData in interface OrderServicepublic ShoppingCartDTO getMyCart()
OrderServicegetMyCart in interface OrderServicepublic UserSalesData getUserSalesData(UserLocatorVO locator) throws FrameworkException
OrderServicegetUserSalesData in interface OrderServiceFrameworkExceptionpublic boolean isAccessible(SessionData sessionData, Order entity)
CRUDServiceSecurityCRUDServiceSecurity.hasViewAccess(BaseEntity). If the only condition for an entity is
CRUDServiceSecurity.hasViewAccess(BaseEntity), this method
should return false.isAccessible in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>public void modifyQuantityOnCart(java.lang.Long adId,
java.math.BigDecimal quantity)
throws FrameworkException,
IllegalActionException,
OutOfStockException
OrderServicemodifyQuantityOnCart in interface OrderServiceIllegalActionException - When the given ad is not in the logged user's shopping cartOutOfStockException - When the new quantity is greater than the available stockFrameworkExceptionpublic void reject(RejectOrderParams params) throws FrameworkException
OrderServicereject in interface OrderServiceIllegalActionException - When the given order is not in either OrderStatus.PENDING_BUYER or
OrderStatus.PENDING_SELLER
statuses.FrameworkExceptionpublic void removeCart(UserLocatorVO sellerVO, CurrencyVO currencyVO)
OrderServiceremoveCart in interface OrderServicepublic void removeCartItem(java.lang.Long adId)
throws FrameworkException
OrderServiceremoveCartItem in interface OrderServiceIllegalActionException - When the given ad is not in the logged user's shopping cartFrameworkExceptionpublic Page<OrderVO> search(OrderQuery query)
OrderServiceOrderQuerysearch in interface OrderServicepublic void setDeliveryMethod(SetDeliveryMethodParams deliveryInfo) throws FrameworkException
OrderServiceOrderStatus.PENDING_SELLER status
and there is no delivery
information yet. Afterwards, the new status will be OrderStatus.PENDING_BUYER for final approval.setDeliveryMethod in interface OrderServiceIllegalActionException - When the referenced order is not on the OrderStatus.PENDING_SELLER status
or already has delivery
informationFrameworkExceptionpublic java.lang.Long submitToBuyer(OrderDTO order) throws FrameworkException, OutOfStockException
OrderServicesubmitToBuyer in interface OrderServiceOutOfStockException - When any of the order products have ran out of stock right before processingFrameworkExceptionprotected void checkCreateNew(OrderDataParams params)
CRUDServiceSecurityPermissionDeniedException if notcheckCreateNew in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>protected void customizeData(OrderData data)
CRUDServiceSecuritycustomizeData in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>protected OrderServiceLocal getImplementation()
CRUDServiceSecuritygetImplementation in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>