@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. |
int |
addToCart(BasicAdVO ad,
java.math.BigDecimal quantity)
Adds the given product to the logged user's shopping cart, returning the total count of ads in the cart.
|
ShoppingCartDTO |
adjustAndGetMyCart()
Returns the current logged user's shopping cart, adjusting all quantities
|
OrderData |
adjustShoppingCartAndGetData(OrderVO vo)
Perform adjustments to the shopping cart quantities and returns the data for it
|
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 |
ShoppingCartCheckoutResult |
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, without adjusting any quantity
|
OrderData |
getOrderData(OrderVO vo)
Returns data of an order
|
UserSalesData |
getUserSalesData(UserLocatorVO locator)
Returns data for viewing a 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.
|
int |
modifyQuantityOnCart(BasicAdVO ad,
java.math.BigDecimal quantity)
Updates the quantity for the given product on the logged user's shopping cart returning the total count of ads in
the cart.
|
void |
reject(RejectOrderParams params)
Rejects the given order
|
int |
removeCart(UserLocatorVO sellerVO,
CurrencyVO currencyVO)
Removes the logged user's shopping cart for the given seller and currency returning the remaining count of ads in
the cart
|
int |
removeCartById(java.lang.Long id)
Same as
CRUDService.remove(Long) but returning the total count of items present the whole shopping cart |
int |
removeCartItem(BasicAdVO ad)
Removes the given product from the logged user's shopping cart returning the remaining count of ads in the 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, canViewData, 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, getBaseEntityManagerHandler, getChannelConfiguration, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validatedelete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, 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 int addToCart(BasicAdVO ad, java.math.BigDecimal quantity) throws FrameworkException, OutOfStockException
OrderServiceaddToCart in interface OrderServiceOutOfStockException - When the given quantity is greater than the available stockFrameworkExceptionpublic ShoppingCartDTO adjustAndGetMyCart() throws FrameworkException
OrderServiceadjustAndGetMyCart in interface OrderServiceFrameworkExceptionpublic OrderData adjustShoppingCartAndGetData(OrderVO vo) throws FrameworkException
OrderServiceadjustShoppingCartAndGetData in interface OrderServiceFrameworkExceptionpublic void checkCartStock(UserLocatorVO sellerVO, CurrencyVO currencyVO) throws FrameworkException, OutOfStockException
OrderServicecheckCartStock in interface OrderServiceFrameworkExceptionOutOfStockExceptionpublic ShoppingCartCheckoutResult 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 stockInsufficientBalanceException - When there was a problem while reserving the amountFrameworkExceptionTransferExceptionpublic int countCartItems()
throws FrameworkException
OrderServicecountCartItems in interface OrderServiceFrameworkExceptionprotected void customizeData(OrderData data)
CRUDServiceSecuritycustomizeData in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>public 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 OrderData getOrderData(OrderVO vo) throws FrameworkException
OrderServicegetOrderData in interface OrderServiceFrameworkExceptionpublic 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 int modifyQuantityOnCart(BasicAdVO ad, 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 int removeCart(UserLocatorVO sellerVO, CurrencyVO currencyVO)
OrderServiceremoveCart in interface OrderServicepublic int removeCartById(java.lang.Long id)
throws FrameworkException
OrderServiceCRUDService.remove(Long) but returning the total count of items present the whole shopping cartremoveCartById in interface OrderServiceFrameworkExceptionCRUDService.remove(java.lang.Long)public int removeCartItem(BasicAdVO ad) 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 OrderServiceLocal getImplementation()
CRUDServiceSecuritygetImplementation in class CRUDServiceSecurity<OrderDTO,Order,OrderData,OrderDataParams>