Interface AssistedServiceFacade
-
- All Known Implementing Classes:
DefaultAssistedServiceFacade
public interface AssistedServiceFacade
Facade interface for assisted service functionality.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bindCustomerToCart(java.lang.String customerId, java.lang.String cartId)
Binds customer with provided id to cart if it's anonymous cart.CustomerData
createCustomer(java.lang.String customerId, java.lang.String customerName)
Creates a new customer by it email and name.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.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.java.util.Collection<CartData>
getCartListForCustomer(CustomerModel customer)
Returns collection of a customer's cartsCustomerData
getCustomerByOrder(java.lang.String orderId)
Get the order's customer using orderFacade.getOrderDetailsForCodejava.util.List<CustomerData>
getCustomers(java.lang.String searchTerm, PageableData pageableData)
Get list of customers which username or email starts with provided value.java.util.List<CustomerData>
getSuggestedCustomerList(java.lang.String username)
Validate session and get list of customers which username or email starts with provided value.boolean
isAssistedServiceAgentLoggedIn()
Checks if there is ASM information in the current session or no, this will be used by Session Restriction mainlyboolean
isAssistedServiceModeLaunched()
Whether or not Assisted Service module is launched.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.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.void
quitAssistedServiceMode()
Ends the Assisted Service Mode.void
stopEmulateCustomer()
Remove customer and/or cart from the current session.
-
-
-
Method Detail
-
emulateCustomer
void emulateCustomer(java.lang.String customerId, java.lang.String cartId) throws AssistedServiceException
Adds a customer and/or cart to the current session.- 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
-
emulateCustomer
void emulateCustomer(java.lang.String customerId, java.lang.String cartId, java.lang.String orderId) throws AssistedServiceException
Adds provided customer, cart or an order to the current session.- 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
-
stopEmulateCustomer
void stopEmulateCustomer()
Remove customer and/or cart from the current session.
-
launchAssistedServiceMode
void launchAssistedServiceMode()
Starts the Assisted Service Mode.
-
quitAssistedServiceMode
void quitAssistedServiceMode()
Ends the Assisted Service Mode.
-
loginAssistedServiceAgent
void loginAssistedServiceAgent(java.lang.String username, java.lang.String password) throws AssistedServiceException
Logs in Assisted Service agent using provided credentials.- Parameters:
username
- uidpassword
- password- Throws:
AssistedServiceException
- In case of bad credentials
-
loginAssistedServiceAgentSAML
void loginAssistedServiceAgentSAML(java.lang.String username, java.lang.String password) throws AssistedServiceException
Logs in Assisted Service agent using provided SAML credentials.- Parameters:
username
- uidpassword
- password- Throws:
AssistedServiceException
- In case of bad credentials
-
logoutAssistedServiceAgent
void logoutAssistedServiceAgent() throws AssistedServiceException
Logs out Assisted Service agent by removing session attribute.- Throws:
AssistedServiceException
- In case there is no AS agent session
-
isAssistedServiceModeLaunched
boolean isAssistedServiceModeLaunched()
Whether or not Assisted Service module is launched.- Returns:
- true when assisted service mode has been launched
-
getAssistedServiceSessionTimeout
int getAssistedServiceSessionTimeout()
Returns timeout for assisted service agent session in seconds.- Returns:
- session in seconds
-
getAssistedServiceSessionTimerValue
int getAssistedServiceSessionTimerValue()
Returns timer value (in seconds) for assisted service agent session, that displays inside widget.- Returns:
- value in seconds
-
getAssistedServiceSessionAttributes
java.util.Map<java.lang.String,java.lang.Object> getAssistedServiceSessionAttributes()
Returns assisted service attributes map for page model.- Returns:
- String->Object map for page model.
-
getSuggestedCustomerList
java.util.List<CustomerData> getSuggestedCustomerList(java.lang.String username) throws AssistedServiceException
Validate session and get list of customers which username or email starts with provided value.- 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
-
getCustomers
java.util.List<CustomerData> getCustomers(java.lang.String searchTerm, PageableData pageableData)
Get list of customers which username or email starts with provided value.- Parameters:
searchTerm
- part of uid or customer's namepageableData
- the pageable data- Returns:
- list of customers
-
emulateAfterLogin
void emulateAfterLogin() throws AssistedServiceException
Personify customer based on customer stored on login step and current session cart.- Throws:
AssistedServiceException
- In case of: 1) AS agent isn't logged in yet 2) AS agent trying to emulate himself
-
bindCustomerToCart
void bindCustomerToCart(java.lang.String customerId, java.lang.String cartId) throws AssistedServiceException
Binds customer with provided id to cart if it's anonymous cart.- 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
-
createCustomer
CustomerData createCustomer(java.lang.String customerId, java.lang.String customerName) throws AssistedServiceException
Creates a new customer by it email and name.- 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
-
isAssistedServiceAgentLoggedIn
boolean isAssistedServiceAgentLoggedIn()
Checks if there is ASM information in the current session or no, this will be used by Session Restriction mainly- Returns:
- boolean value to indicates if there are a valid assisted service info in the session or no.
-
getCartListForCustomer
java.util.Collection<CartData> getCartListForCustomer(CustomerModel customer)
Returns collection of a customer's carts- Parameters:
customer
- customer model whose carts to be returned- Returns:
- collection of the customer's cart models
-
getAsmSession
AssistedServiceSession getAsmSession()
Returns ASM session object with all information about current asm session.- Returns:
- asm session object
-
getCustomerByOrder
CustomerData getCustomerByOrder(java.lang.String orderId)
Get the order's customer using orderFacade.getOrderDetailsForCode- Parameters:
orderId
- the id of the customer order to get customer- Returns:
- customerData
-
-