public class DefaultAssistedServiceFacade extends java.lang.Object implements AssistedServiceFacade
AssistedServiceFacade interface.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ASM_CUSTOMER_PROFILE_REFERENCES |
| Constructor and Description |
|---|
DefaultAssistedServiceFacade() |
| Modifier and Type | Method and Description |
|---|---|
protected UserModel |
attachCartToSession(java.lang.String cartId,
UserModel customer) |
protected void |
attachLatestSessionCart(UserModel customer) |
void |
bindCustomerToCart(java.lang.String customerId,
java.lang.String cartId)
Binds customer with provided id to cart if it's anonymous cart.
|
protected void |
cleanAsmSession() |
CustomerData |
createCustomer(java.lang.String customerId,
java.lang.String customerName)
Creates a new customer by it email and name.
|
protected void |
createSessionEvent(UserModel agent,
UserModel customer,
EventType type)
Creates session event for provided customer and agent.
|
protected void |
detachSessionCart()
Detaches current cart from session and attaches newly created empty one.
|
void |
emulateAfterLogin()
Personify customer based on customer stored on login step and current session cart.
|
void |
emulateCustomer(java.lang.String customerId,
java.lang.String cartId)
Adds a customer and/or cart to the current session.
|
void |
emulateCustomer(java.lang.String customerId,
java.lang.String cartId,
java.lang.String orderId)
Adds provided customer, cart or an order to the current session.
|
AssistedServiceSession |
getAsmSession()
Returns ASM session object with all information about current asm session.
|
protected java.lang.String |
getAssistedServiceAgentStore(UserModel agent) |
protected AssistedServiceService |
getAssistedServiceService() |
java.util.Map<java.lang.String,java.lang.Object> |
getAssistedServiceSessionAttributes()
Returns assisted service attributes map for page model.
|
int |
getAssistedServiceSessionTimeout()
Returns timeout for assisted service agent session in seconds.
|
int |
getAssistedServiceSessionTimerValue()
Returns timer value (in seconds) for assisted service agent session, that displays inside widget.
|
protected Converter<CartModel,CartData> |
getCartConverter() |
java.util.Collection<CartData> |
getCartListForCustomer(CustomerModel customer)
Returns collection of a customer's carts
|
protected CartService |
getCartService() |
protected CommerceCommonI18NService |
getCommerceCommonI18NService() |
CustomerData |
getCustomerByOrder(java.lang.String orderId)
Get the order's customer using orderFacade.getOrderDetailsForCode
|
protected Converter<UserModel,CustomerData> |
getCustomerConverter() |
java.util.List<CustomerData> |
getCustomers(java.lang.String searchTerm,
PageableData pageableData)
Get list of customers which username or email starts with provided value.
|
protected EventService |
getEventService() |
protected ModelService |
getModelService() |
protected PasswordEncoderService |
getPasswordEncoderService() |
protected SessionService |
getSessionService() |
java.util.List<CustomerData> |
getSuggestedCustomerList(java.lang.String username)
Validate session and get list of customers which username or email starts with provided value.
|
protected UserService |
getUserService() |
protected boolean |
isAssistedServiceAgent(UserModel asmAgent)
Verify that provided user participate in a parent AS agent group.
|
boolean |
isAssistedServiceAgentLoggedIn()
Checks if there is ASM information in the current session or no, this will be used by Session Restriction mainly
|
boolean |
isAssistedServiceModeLaunched()
Whether or not Assisted Service module is launched.
|
protected boolean |
isBruteForce(UserModel asmAgent) |
protected java.lang.Boolean |
isCustomerAccountActive(UserModel customer) |
void |
launchAssistedServiceMode()
Starts the Assisted Service Mode.
|
void |
loginAssistedServiceAgent(java.lang.String username,
java.lang.String password)
Logs in Assisted Service agent using provided credentials.
|
protected void |
loginAssistedServiceAgent(java.lang.String username,
java.lang.String password,
boolean isTokenBasedLogin) |
protected void |
loginAssistedServiceAgent(UserModel agent) |
void |
loginAssistedServiceAgentSAML(java.lang.String username,
java.lang.String password)
Logs in Assisted Service agent using provided SAML credentials.
|
void |
logoutAssistedServiceAgent()
Logs out Assisted Service agent by removing session attribute.
|
protected void |
quitAsmSession() |
void |
quitAssistedServiceMode()
Ends the Assisted Service Mode.
|
protected void |
resetBruteForceCounter(UserModel asmAgent) |
protected void |
sanityCheckForAgent(UserModel agent) |
void |
setAssistedServiceService(AssistedServiceService assistedServiceService) |
void |
setCartConverter(Converter<CartModel,CartData> cartConverter) |
void |
setCartService(CartService cartService) |
void |
setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) |
void |
setCustomerConverter(Converter<UserModel,CustomerData> customerConverter) |
void |
setEventService(EventService eventService) |
void |
setModelService(ModelService modelService) |
void |
setPasswordEncoderService(PasswordEncoderService passwordEncoderService) |
void |
setSessionService(SessionService sessionService) |
void |
setUserService(UserService userService) |
void |
stopEmulateCustomer()
Remove customer and/or cart from the current session.
|
protected void |
validateSession()
Checks current session for ASM requirements
|
protected void |
verifyAssistedServiceAgent(UserModel asmAgent)
Verify that provided user participate in a parent AS agent group.
|
protected void |
verifyAssistedServiceMode()
Checks current session for ASM mode launched.
|
protected void |
verifyFormLoginAbility()
Verify whether AS agent can be logged in via https login form.
|
public static final java.lang.String ASM_CUSTOMER_PROFILE_REFERENCES
public java.util.Map<java.lang.String,java.lang.Object> getAssistedServiceSessionAttributes()
AssistedServiceFacadegetAssistedServiceSessionAttributes in interface AssistedServiceFacadepublic boolean isAssistedServiceModeLaunched()
AssistedServiceFacadeisAssistedServiceModeLaunched in interface AssistedServiceFacadepublic void emulateCustomer(java.lang.String customerId,
java.lang.String cartId,
java.lang.String orderId)
throws AssistedServiceException
AssistedServiceFacadeemulateCustomer in interface AssistedServiceFacadecustomerId - id to identify the customer by (usually email address)cartId - the id of the customer cart to pick uporderId - the id of the customer order to pick upAssistedServiceException - In case of:
1) both customerId and cartId parameters blank
2) bad credentials,
3) AS agent isn't logged in yet
4) AS agent trying to emulate himselfprotected java.lang.Boolean isCustomerAccountActive(UserModel customer)
protected UserModel attachCartToSession(java.lang.String cartId, UserModel customer) throws AssistedServiceWrongCartIdException
public void emulateCustomer(java.lang.String customerId,
java.lang.String cartId)
throws AssistedServiceException
AssistedServiceFacadeemulateCustomer in interface AssistedServiceFacadecustomerId - id to identify the customer by (usually email address)cartId - the id of the customer cart to pick upAssistedServiceException - In case of:
1) blank parameters
2) bad credentials,
3) AS agent isn't logged in yet
4) AS agent trying to emulate himselfpublic void stopEmulateCustomer()
AssistedServiceFacadestopEmulateCustomer in interface AssistedServiceFacadeprotected void detachSessionCart()
protected void attachLatestSessionCart(UserModel customer)
public void launchAssistedServiceMode()
AssistedServiceFacadelaunchAssistedServiceMode in interface AssistedServiceFacadepublic void quitAssistedServiceMode()
AssistedServiceFacadequitAssistedServiceMode in interface AssistedServiceFacadepublic void loginAssistedServiceAgent(java.lang.String username,
java.lang.String password)
throws AssistedServiceException
AssistedServiceFacadeloginAssistedServiceAgent in interface AssistedServiceFacadeusername - uidpassword - passwordAssistedServiceException - In case of bad credentialspublic void loginAssistedServiceAgentSAML(java.lang.String username,
java.lang.String password)
throws AssistedServiceException
AssistedServiceFacadeloginAssistedServiceAgentSAML in interface AssistedServiceFacadeusername - uidpassword - passwordAssistedServiceException - In case of bad credentialsprotected void loginAssistedServiceAgent(java.lang.String username,
java.lang.String password,
boolean isTokenBasedLogin)
throws AssistedServiceException
AssistedServiceExceptionprotected void sanityCheckForAgent(UserModel agent) throws AssistedServiceException
AssistedServiceExceptionprotected void loginAssistedServiceAgent(UserModel agent) throws AssistedServiceException
AssistedServiceExceptionpublic void logoutAssistedServiceAgent()
throws AssistedServiceException
AssistedServiceFacadelogoutAssistedServiceAgent in interface AssistedServiceFacadeAssistedServiceException - In case there is no AS agent sessionpublic int getAssistedServiceSessionTimeout()
AssistedServiceFacadegetAssistedServiceSessionTimeout in interface AssistedServiceFacadepublic int getAssistedServiceSessionTimerValue()
AssistedServiceFacadegetAssistedServiceSessionTimerValue in interface AssistedServiceFacadepublic CustomerData getCustomerByOrder(java.lang.String orderId)
AssistedServiceFacadegetCustomerByOrder in interface AssistedServiceFacadeorderId - the id of the customer order to get customerpublic java.util.List<CustomerData> getSuggestedCustomerList(java.lang.String username) throws AssistedServiceException
AssistedServiceFacadegetSuggestedCustomerList in interface AssistedServiceFacadeusername - uid or customer's nameAssistedServiceException - In case Assisted Service Agent is not logged in or Assisted Service mode inactivepublic java.util.List<CustomerData> getCustomers(java.lang.String searchTerm, PageableData pageableData)
AssistedServiceFacadegetCustomers in interface AssistedServiceFacadesearchTerm - part of uid or customer's namepageableData - the pageable datapublic void emulateAfterLogin()
throws AssistedServiceException
AssistedServiceFacadeemulateAfterLogin in interface AssistedServiceFacadeAssistedServiceException - In case of:
1) AS agent isn't logged in yet
2) AS agent trying to emulate himselfpublic void bindCustomerToCart(java.lang.String customerId,
java.lang.String cartId)
throws AssistedServiceException
AssistedServiceFacadebindCustomerToCart in interface AssistedServiceFacadecustomerId - email of to be newly created customer that is used as uidcartId - the id of the customer cart to pick upAssistedServiceException - In cas of missing cart with given cardIdprotected void createSessionEvent(UserModel agent, UserModel customer, EventType type)
agent - customer - type - protected void validateSession()
throws AssistedServiceException
AssistedServiceException - in case ASM not launched or AS agent isn't logged inprotected void verifyAssistedServiceMode()
throws AssistedServiceException
AssistedServiceException - in case it's notprotected void verifyFormLoginAbility()
throws AssistedServiceException
AssistedServiceException - in case it can'tprotected void verifyAssistedServiceAgent(UserModel asmAgent) throws AssistedServiceException
asmAgent - AssistedServiceException - in case he's notprotected boolean isAssistedServiceAgent(UserModel asmAgent)
asmAgent - public boolean isAssistedServiceAgentLoggedIn()
AssistedServiceFacadeisAssistedServiceAgentLoggedIn in interface AssistedServiceFacadepublic CustomerData createCustomer(java.lang.String customerId, java.lang.String customerName) throws AssistedServiceException
AssistedServiceFacadecreateCustomer in interface AssistedServiceFacadecustomerId - email of to be newly created customer that is used as uidcustomerName - name of to be newly created customer (firstname and surname separated by space symbol)AssistedServiceException - In case of:
1) trying to create already existing customer with given customerId
2) disabled customer creationpublic AssistedServiceSession getAsmSession()
AssistedServiceFacadegetAsmSession in interface AssistedServiceFacadeprotected void cleanAsmSession()
protected void quitAsmSession()
protected boolean isBruteForce(UserModel asmAgent)
protected void resetBruteForceCounter(UserModel asmAgent)
protected java.lang.String getAssistedServiceAgentStore(UserModel agent)
public java.util.Collection<CartData> getCartListForCustomer(CustomerModel customer)
AssistedServiceFacadegetCartListForCustomer in interface AssistedServiceFacadecustomer - customer model whose carts to be returnedprotected AssistedServiceService getAssistedServiceService()
public void setAssistedServiceService(AssistedServiceService assistedServiceService)
protected CartService getCartService()
public void setCartService(CartService cartService)
protected SessionService getSessionService()
public void setSessionService(SessionService sessionService)
protected CommerceCommonI18NService getCommerceCommonI18NService()
public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
protected UserService getUserService()
public void setUserService(UserService userService)
protected PasswordEncoderService getPasswordEncoderService()
public void setPasswordEncoderService(PasswordEncoderService passwordEncoderService)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
modelService - the modelService to setprotected EventService getEventService()
public void setEventService(EventService eventService)
protected Converter<UserModel,CustomerData> getCustomerConverter()
public void setCustomerConverter(Converter<UserModel,CustomerData> customerConverter)
Copyright © 2018 SAP SE. All Rights Reserved.