Class DefaultAssistedServiceFacade
java.lang.Object
de.hybris.platform.assistedservicefacades.impl.DefaultAssistedServiceFacade
- All Implemented Interfaces:
AssistedServiceFacade
Default implementation of the
AssistedServiceFacade interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final intprotected static final Stringstatic final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected UserModelattachCartToSession(String cartId, UserModel customer) protected voidattachLatestSessionCart(UserModel customer) voidbindCustomerToCart(String customerId, String cartId) Binds customer with provided id to cart if it's anonymous cart.voidbindCustomerToCartWithoutEmulating(String customerId, String cartId) Binds customer with provided id to cart if it's anonymous cart, but not emulate the customer.protected voidcreateCustomer(String customerId, String customerName) Creates a new customer by it email and name.protected voidcreateSessionEvent(UserModel agent, UserModel customer, EventType type) Creates session event for provided customer and agent.protected voidDetaches current cart from session and attaches newly created empty one.voidPersonify customer based on customer stored on login step and current session cart.voidemulateCustomer(String customerId, String cartId) Adds a customer and/or cart to the current session.voidemulateCustomer(String customerId, String cartId, String orderId) Adds provided customer, cart or an order to the current session.protected StringgetAccurateAgentId(String agentId) Returns ASM session object with all information about current asm session.protected Stringprotected AssistedServiceServiceReturns assisted service attributes map for page model.intReturns timeout for assisted service agent session in seconds.intReturns timer value (in seconds) for assisted service agent session, that displays inside widget.getCartListForCustomer(CustomerModel customer) Returns collection of a customer's cartsprotected CartServiceprotected CommerceCommonI18NServicegetCustomerByOrder(String orderId) Get the order's customer using orderFacade.getOrderDetailsForCodeprotected Converter<UserModel,CustomerData> getCustomers(String searchTerm, PageableData pageableData) Get list of customers which username or email starts with provided value.getCustomerSuggestions(String searchTerm) Get list of customers which username or email starts with provided value.protected EventServiceprotected ModelServiceprotected PasswordEncoderServiceprotected Converter<PointOfServiceModel,PointOfServiceData> protected SessionServicegetStoresByAgentId(String agentId) Returns the agent store listgetSuggestedCustomerData(String username) Validate session and get list of customers which username or email starts with provided value.getSuggestedCustomerList(String username) protected Converter<CustomerModel,AutoSuggestionCustomerData> protected UserServiceprotected booleanisAssistedServiceAgent(UserModel asmAgent) Verify that provided user participate in a parent AS agent group.booleanChecks if there is ASM information in the current session or no, this will be used by Session Restriction mainlybooleanWhether or not Assisted Service module is launched.protected booleanisBruteForce(UserModel asmAgent) protected BooleanisCustomerAccountActive(UserModel customer) voidStarts the Assisted Service Mode.protected voidvoidloginAssistedServiceAgent(String username, String password) Logs in Assisted Service agent using provided credentials.protected voidloginAssistedServiceAgent(String username, String password, boolean isTokenBasedLogin) voidloginAssistedServiceAgentSAML(String username, LoginToken token) Logs in Assisted Service agent using provided SAML credentials.voidloginAssistedServiceAgentSAML(String username, String password) Logs in Assisted Service agent using provided SAML credentials.voidLogs out Assisted Service agent by removing session attribute.protected voidvoidEnds the Assisted Service Mode.protected voidresetBruteForceCounter(UserModel asmAgent) protected voidsanityCheckForAgent(UserModel agent) voidsetAssistedServiceService(AssistedServiceService assistedServiceService) voidsetCartConverter(Converter<CartModel, CartData> cartConverter) voidsetCartService(CartService cartService) voidsetCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) voidsetCustomerConverter(Converter<UserModel, CustomerData> customerConverter) voidsetEventService(EventService eventService) voidsetModelService(ModelService modelService) voidsetPasswordEncoderService(PasswordEncoderService passwordEncoderService) voidsetPointOfServiceConverter(Converter<PointOfServiceModel, PointOfServiceData> pointOfServiceConverter) voidsetSessionService(SessionService sessionService) voidsetSuggestionCustomerConverter(Converter<CustomerModel, AutoSuggestionCustomerData> suggestionCustomerConverter) voidsetUserService(UserService userService) voidRemove customer and/or cart from the current session.protected voidChecks current session for ASM requirementsprotected voidverifyAgentCanLogin(UserModel asmAgent) Verify that if provided user can loginprotected voidverifyAssistedServiceAgent(UserModel asmAgent) Verify that provided user participate in a parent AS agent group.protected voidChecks current session for ASM mode launched.protected voidVerify whether AS agent can be logged in via https login form.
-
Field Details
-
ASM_CUSTOMER_PROFILE_REFERENCES
- See Also:
-
ERROR_NO_CUSTOMER_OR_CART_ID_PROVIDED
- See Also:
-
DEFAULT_SESSION_TIMER
protected static final int DEFAULT_SESSION_TIMER- See Also:
-
SESSION_CART_KEY
- See Also:
-
AGENT_TIMER_KEY
- See Also:
-
CREATE_DISABLED_KEY
- See Also:
-
EMULATE_BY_ORDER_KEY
- See Also:
-
ASM_ERROR_MESSAGE_KEY
- See Also:
-
ASM_ERROR_MESSAGE_ARGS_KEY
- See Also:
-
ASM_AGENT_STORE
- See Also:
-
CURRENT_USER
- See Also:
-
-
Constructor Details
-
DefaultAssistedServiceFacade
public DefaultAssistedServiceFacade()
-
-
Method Details
-
getAssistedServiceSessionAttributes
Description copied from interface:AssistedServiceFacadeReturns assisted service attributes map for page model.- Specified by:
getAssistedServiceSessionAttributesin interfaceAssistedServiceFacade- Returns:
- String->Object map for page model.
-
isAssistedServiceModeLaunched
public boolean isAssistedServiceModeLaunched()Description copied from interface:AssistedServiceFacadeWhether or not Assisted Service module is launched.- Specified by:
isAssistedServiceModeLaunchedin interfaceAssistedServiceFacade- Returns:
- true when assisted service mode has been launched
-
emulateCustomer
public void emulateCustomer(String customerId, String cartId, String orderId) throws AssistedServiceException Description copied from interface:AssistedServiceFacadeAdds provided customer, cart or an order to the current session.- Specified by:
emulateCustomerin interfaceAssistedServiceFacade- Parameters:
customerId- 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 up- Throws:
AssistedServiceException- 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 himself
-
isCustomerAccountActive
-
attachCartToSession
protected UserModel attachCartToSession(String cartId, UserModel customer) throws AssistedServiceWrongCartIdException -
emulateCustomer
Description copied from interface:AssistedServiceFacadeAdds a customer and/or cart to the current session.- Specified by:
emulateCustomerin interfaceAssistedServiceFacade- Parameters:
customerId- id to identify the customer by (usually email address)cartId- the id of the customer cart to pick up- Throws:
AssistedServiceException- In case of: 1) blank parameters 2) bad credentials, 3) AS agent isn't logged in yet 4) AS agent trying to emulate himself
-
stopEmulateCustomer
public void stopEmulateCustomer()Description copied from interface:AssistedServiceFacadeRemove customer and/or cart from the current session.- Specified by:
stopEmulateCustomerin interfaceAssistedServiceFacade
-
detachSessionCart
protected void detachSessionCart()Detaches current cart from session and attaches newly created empty one. -
attachLatestSessionCart
-
launchAssistedServiceMode
public void launchAssistedServiceMode()Description copied from interface:AssistedServiceFacadeStarts the Assisted Service Mode.- Specified by:
launchAssistedServiceModein interfaceAssistedServiceFacade
-
quitAssistedServiceMode
public void quitAssistedServiceMode()Description copied from interface:AssistedServiceFacadeEnds the Assisted Service Mode.- Specified by:
quitAssistedServiceModein interfaceAssistedServiceFacade
-
loginAssistedServiceAgent
public void loginAssistedServiceAgent(String username, String password) throws AssistedServiceException Description copied from interface:AssistedServiceFacadeLogs in Assisted Service agent using provided credentials.- Specified by:
loginAssistedServiceAgentin interfaceAssistedServiceFacade- Parameters:
username- uidpassword- password- Throws:
AssistedServiceException- In case of bad credentials
-
loginAssistedServiceAgentSAML
public void loginAssistedServiceAgentSAML(String username, String password) throws AssistedServiceException Description copied from interface:AssistedServiceFacadeLogs in Assisted Service agent using provided SAML credentials.- Specified by:
loginAssistedServiceAgentSAMLin interfaceAssistedServiceFacade- Parameters:
username- uidpassword- password- Throws:
AssistedServiceException- In case of bad credentials
-
loginAssistedServiceAgentSAML
public void loginAssistedServiceAgentSAML(String username, LoginToken token) throws AssistedServiceException Description copied from interface:AssistedServiceFacadeLogs in Assisted Service agent using provided SAML credentials.- Specified by:
loginAssistedServiceAgentSAMLin interfaceAssistedServiceFacade- Parameters:
username- uidtoken- token- Throws:
AssistedServiceException- In case of bad credentials
-
loginAssistedServiceAgent
protected void loginAssistedServiceAgent(String username, String password, boolean isTokenBasedLogin) throws AssistedServiceException - Throws:
AssistedServiceException
-
sanityCheckForAgent
- Throws:
AssistedServiceException
-
loginAssistedServiceAgent
- Throws:
AssistedServiceException
-
logoutAssistedServiceAgent
Description copied from interface:AssistedServiceFacadeLogs out Assisted Service agent by removing session attribute.- Specified by:
logoutAssistedServiceAgentin interfaceAssistedServiceFacade- Throws:
AssistedServiceException- In case there is no AS agent session
-
getAssistedServiceSessionTimeout
public int getAssistedServiceSessionTimeout()Description copied from interface:AssistedServiceFacadeReturns timeout for assisted service agent session in seconds.- Specified by:
getAssistedServiceSessionTimeoutin interfaceAssistedServiceFacade- Returns:
- session in seconds
-
getAssistedServiceSessionTimerValue
public int getAssistedServiceSessionTimerValue()Description copied from interface:AssistedServiceFacadeReturns timer value (in seconds) for assisted service agent session, that displays inside widget.- Specified by:
getAssistedServiceSessionTimerValuein interfaceAssistedServiceFacade- Returns:
- value in seconds
-
getCustomerByOrder
Description copied from interface:AssistedServiceFacadeGet the order's customer using orderFacade.getOrderDetailsForCode- Specified by:
getCustomerByOrderin interfaceAssistedServiceFacade- Parameters:
orderId- the id of the customer order to get customer- Returns:
- customerData
-
getSuggestedCustomerList
- Specified by:
getSuggestedCustomerListin interfaceAssistedServiceFacade- Parameters:
username- uid or customer's name- Returns:
- suggested customers
- Throws:
AssistedServiceException- In case Assisted Service Agent is not logged in or Assisted Service mode inactive
-
getSuggestedCustomerData
Description copied from interface:AssistedServiceFacadeValidate session and get list of customers which username or email starts with provided value.- Specified by:
getSuggestedCustomerDatain interfaceAssistedServiceFacade- Parameters:
username- uid or customer's name- Returns:
- suggested customers
-
getCustomers
Description copied from interface:AssistedServiceFacadeGet list of customers which username or email starts with provided value.- Specified by:
getCustomersin interfaceAssistedServiceFacade- Parameters:
searchTerm- part of uid or customer's namepageableData- the pageable data- Returns:
- list of customers
-
getCustomerSuggestions
Description copied from interface:AssistedServiceFacadeGet list of customers which username or email starts with provided value.- Specified by:
getCustomerSuggestionsin interfaceAssistedServiceFacade- Parameters:
searchTerm- part of uid or customer's name- Returns:
- list of customers
-
emulateAfterLogin
Description copied from interface:AssistedServiceFacadePersonify customer based on customer stored on login step and current session cart.- Specified by:
emulateAfterLoginin interfaceAssistedServiceFacade- Throws:
AssistedServiceException- In case of: 1) AS agent isn't logged in yet 2) AS agent trying to emulate himself
-
bindCustomerToCart
Description copied from interface:AssistedServiceFacadeBinds customer with provided id to cart if it's anonymous cart.- Specified by:
bindCustomerToCartin interfaceAssistedServiceFacade- Parameters:
customerId- email of to be newly created customer that is used as uidcartId- the id of the customer cart to pick up- Throws:
AssistedServiceException- In cas of missing cart with given cardId
-
bindCustomerToCartWithoutEmulating
public void bindCustomerToCartWithoutEmulating(String customerId, String cartId) throws AssistedServiceException Description copied from interface:AssistedServiceFacadeBinds customer with provided id to cart if it's anonymous cart, but not emulate the customer.- Specified by:
bindCustomerToCartWithoutEmulatingin interfaceAssistedServiceFacade- Parameters:
customerId- email of customer which should be bound to the cartcartId- the id of anonymous cart to be bound with user- Throws:
AssistedServiceException- In case of missing cart with given cartId OR the cart is not anonymous OR missing customer with the customerId
-
createSessionEvent
Creates session event for provided customer and agent.- Parameters:
agent-customer-type-
-
validateSession
Checks current session for ASM requirements- Throws:
AssistedServiceException- in case ASM not launched or AS agent isn't logged in
-
verifyAssistedServiceMode
Checks current session for ASM mode launched.- Throws:
AssistedServiceException- in case it's not
-
verifyFormLoginAbility
Verify whether AS agent can be logged in via https login form.- Throws:
AssistedServiceException- in case it can't
-
verifyAssistedServiceAgent
Verify that provided user participate in a parent AS agent group.- Parameters:
asmAgent-- Throws:
AssistedServiceException- in case he's not
-
verifyAgentCanLogin
Verify that if provided user can login- Parameters:
asmAgent-- Throws:
AssistedServiceException- in case they are not
-
isAssistedServiceAgent
Verify that provided user participate in a parent AS agent group.- Parameters:
asmAgent-- Returns:
- true when he is
-
isAssistedServiceAgentLoggedIn
public boolean isAssistedServiceAgentLoggedIn()Description copied from interface:AssistedServiceFacadeChecks if there is ASM information in the current session or no, this will be used by Session Restriction mainly- Specified by:
isAssistedServiceAgentLoggedInin interfaceAssistedServiceFacade- Returns:
- boolean value to indicates if there are a valid assisted service info in the session or no.
-
createCustomer
public CustomerData createCustomer(String customerId, String customerName) throws AssistedServiceException Description copied from interface:AssistedServiceFacadeCreates a new customer by it email and name.- Specified by:
createCustomerin interfaceAssistedServiceFacade- Parameters:
customerId- 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)- Returns:
- CustomerModel
- Throws:
AssistedServiceException- In case of: 1) trying to create already existing customer with given customerId 2) disabled customer creation
-
getAsmSession
Description copied from interface:AssistedServiceFacadeReturns ASM session object with all information about current asm session.- Specified by:
getAsmSessionin interfaceAssistedServiceFacade- Returns:
- asm session object
-
cleanAsmSession
protected void cleanAsmSession() -
quitAsmSession
protected void quitAsmSession() -
isBruteForce
-
resetBruteForceCounter
-
getAssistedServiceAgentStore
-
getStoresByAgentId
Description copied from interface:AssistedServiceFacadeReturns the agent store list- Specified by:
getStoresByAgentIdin interfaceAssistedServiceFacade- Parameters:
agentId- the agent unique ID- Returns:
- the agent store list
-
getAccurateAgentId
-
getCartListForCustomer
Description copied from interface:AssistedServiceFacadeReturns collection of a customer's carts- Specified by:
getCartListForCustomerin interfaceAssistedServiceFacade- Parameters:
customer- customer model whose carts to be returned- Returns:
- collection of the customer's cart models
-
getAssistedServiceService
-
setAssistedServiceService
-
getCartService
-
setCartService
-
getSessionService
-
setSessionService
-
getCommerceCommonI18NService
-
setCommerceCommonI18NService
-
getUserService
-
setUserService
-
getPasswordEncoderService
-
setPasswordEncoderService
-
getModelService
- Returns:
- the modelService
-
setModelService
- Parameters:
modelService- the modelService to set
-
getEventService
-
setEventService
-
getCartConverter
-
setCartConverter
-
getCustomerConverter
-
setCustomerConverter
-
getSuggestionCustomerConverter
-
setSuggestionCustomerConverter
public void setSuggestionCustomerConverter(Converter<CustomerModel, AutoSuggestionCustomerData> suggestionCustomerConverter) -
getPointOfServiceConverter
-
setPointOfServiceConverter
public void setPointOfServiceConverter(Converter<PointOfServiceModel, PointOfServiceData> pointOfServiceConverter)
-