Interface PunchOutSessionService
- All Known Implementing Classes:
DefaultPunchOutSessionService
public interface PunchOutSessionService
This service handles the basic operations on
PunchOutService instances.-
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(PunchOutSession punchOutSession) Activates aPunchOutSessionfor the current user session.Retrieves the currently loadedPunchOutSession.Gets the currently active punchOut session.voidinitAndActivatePunchOutSession(CXML request) initiates and activates a punchout sessionloadPunchOutSession(String punchOutSessionId) Loads and activates aPunchOutSessionby its ID.loadStoredPunchOutSessionModel(String punchOutSessionId) Loads a givenStoredPunchOutSessionModelby sid.retrieveUserId(PunchOutSession punchoutSession) Retrieves the userId from given Punchout Session.voidSaves currentStoredPunchOutSessionModelin the db.voidsetCurrentCartFromPunchOutSetup(String punchOutSessionId) Set the cart for the current session using the cart saved in a given punch out session.
-
Method Details
-
saveCurrentPunchoutSession
void saveCurrentPunchoutSession()Saves currentStoredPunchOutSessionModelin the db. -
loadStoredPunchOutSessionModel
Loads a givenStoredPunchOutSessionModelby sid.- Parameters:
punchOutSessionId- The sid to search.- Returns:
- The
StoredPunchOutSessionModel, or null if stored session does not exists.
-
activate
Activates aPunchOutSessionfor the current user session.- Parameters:
punchOutSession- the new punchOut session
-
loadPunchOutSession
Loads and activates aPunchOutSessionby its ID.- Parameters:
punchOutSessionId- the punchOut session ID- Returns:
- the newly loaded session
- Throws:
PunchOutSessionNotFoundException- when the session is not found
-
setCurrentCartFromPunchOutSetup
Set the cart for the current session using the cart saved in a given punch out session. This is necessary as the punchOut provider may use different sessions for sequential calls (e.g.: edit setup request and edit seamless login).
Notice that this should only be called after punch out user is authenticated.- Parameters:
punchOutSessionId- The punch out session ID.
-
getCurrentPunchOutSession
PunchOutSession getCurrentPunchOutSession()Retrieves the currently loadedPunchOutSession.- Returns:
- the punchOut session or
nullif none has been loaded yet
-
getCurrentPunchOutSessionId
String getCurrentPunchOutSessionId()Gets the currently active punchOut session.- Returns:
- the active punchOut session ID
-
initAndActivatePunchOutSession
initiates and activates a punchout session- Parameters:
request- the cXML request
-
retrieveUserId
Retrieves the userId from given Punchout Session.- Parameters:
punchoutSession- The session of the current punchout user.- Returns:
- The userId, if the information contained in the encryptedText passes the security verification (null
- Throws:
PunchOutException- If some of the required arguments are missing or empty.
-