Interface PunchOutSessionService
-
- All Known Implementing Classes:
DefaultPunchOutSessionService
public interface PunchOutSessionServiceThis service handles the basic operations onPunchOutServiceinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivate(PunchOutSession punchOutSession)Activates aPunchOutSessionfor the current user session.PunchOutSessiongetCurrentPunchOutSession()Retrieves the currently loadedPunchOutSession.java.lang.StringgetCurrentPunchOutSessionId()Gets the currently active punchOut session.PunchOutSessionloadPunchOutSession(java.lang.String punchOutSessionId)Loads and activates aPunchOutSessionby its ID.StoredPunchOutSessionModelloadStoredPunchOutSessionModel(java.lang.String punchOutSessionId)Loads a givenStoredPunchOutSessionModelby sid.voidsaveCurrentPunchoutSession()Saves currentStoredPunchOutSessionModelin the db.voidsetCurrentCartFromPunchOutSetup(java.lang.String punchOutSessionId)Set the cart for the current session using the cart saved in a given punch out session.
-
-
-
Method Detail
-
saveCurrentPunchoutSession
void saveCurrentPunchoutSession()
Saves currentStoredPunchOutSessionModelin the db.
-
loadStoredPunchOutSessionModel
StoredPunchOutSessionModel loadStoredPunchOutSessionModel(java.lang.String punchOutSessionId)
Loads a givenStoredPunchOutSessionModelby sid.- Parameters:
punchOutSessionId- The sid to search.- Returns:
- The
StoredPunchOutSessionModel, or null if stored session does not exists.
-
activate
void activate(PunchOutSession punchOutSession)
Activates aPunchOutSessionfor the current user session.- Parameters:
punchOutSession- the new punchOut session
-
loadPunchOutSession
PunchOutSession loadPunchOutSession(java.lang.String punchOutSessionId)
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
void setCurrentCartFromPunchOutSetup(java.lang.String punchOutSessionId)
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
java.lang.String getCurrentPunchOutSessionId()
Gets the currently active punchOut session.- Returns:
- the active punchOut session ID
-
-