public class TransactionalStateSupport extends Object
SessionStateSupport
but the attributes are only available
though the course of a single transaction rather than for a full session. The scope of a transaction is a single set of interactions
between the server and an adapter to accomplish a single task
(i.e. looking up a login context, even when spanning multiple HTTP request/response interactions, is a single transactional context).
SessionStateSupport
but with an additional qualifier on the key to distinguish one transaction from another. This enables better support for
concurrent and nested transactions. The transactional qualifier is a short opaque value encoded into the resume path that is passed to the
adapter in front channel invocations.
SessionStateSupport
.
Constructor and Description |
---|
TransactionalStateSupport(String resumePath)
Creates a new TransactionalStateSupport object for a user's transactional context.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Retrieves a named attribute from the user's transactional context.
|
String |
getTransactionalContextId()
Gets the transactional qualifier id that was embedded/encoded into the resume path.
|
boolean |
hasTransactionalContextId()
Indicates if a transactional qualifier id embedded/encoded into the resume path.
|
Object |
removeAttribute(String name,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Removes the named attribute from the user's transactional context.
|
void |
setAttribute(String name,
Object value,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Sets a named attribute for the user's transactional context.
|
public TransactionalStateSupport(String resumePath)
resumePath
- the resumePath parameter passed from the plugin interface.
One such example is IdpAuthenticationAdapter.lookupAuthN(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, String, org.sourceid.saml20.adapter.idp.authn.AuthnPolicy, String)
public void setAttribute(String name, Object value, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
name
- the name of the attributevalue
- value the attribute valuereq
- resp
- public Object getAttribute(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
name
- the name of the attributereq
- resp
- setAttribute(String, Object, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
or null if the attribute was never set, was removed via removeAttribute(String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
or if transactional context has been lost.public Object removeAttribute(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
name
- the name of the attributereq
- resp
- public String getTransactionalContextId()
public boolean hasTransactionalContextId()
Copyright 2019 Ping Identity Corp. All rights reserved.