public class AuditContextUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TRANSPORT_IDENTIFIER_SALES_CENTER
This is the constant identifier that will represent any request that is from the sales center.
|
static java.lang.String |
TRANSPORT_IDENTIFIER_SCHEDULER
This is the constant identifier that will represent any request that is from the scheduler.
|
static java.lang.String |
TRANSPORT_IDENTIFIER_WEB
This is the constant identifier that will represent the web transport.
|
static java.lang.String |
TRANSPORT_IDENTIFIER_WEBSERVICES
This is the constant identifier that will represent any request that is from web services.
|
static java.lang.String |
TRANSPORT_REMOTE_AGENT_SALES_CENTER
This is the remote agent that will be associated with sales center requests.
|
static java.lang.String |
TRANSPORT_REMOTE_AGENT_SCHEDULER
This is the remote agent that will be associated with scheduled jobs.
|
static java.lang.String |
TRANSPORT_REMOTE_AGENT_WEBSERVICES
This is the remote agent that will be associated with web service requests.
|
Modifier and Type | Method and Description |
---|---|
static void |
addTransportDataToActivityForWeb(ActivityToken activityToken,
javax.servlet.http.HttpServletRequest request)
This method adds the transport information from the HTTP request to the session data.
|
static void |
addTransportDataToActivityTokenForForScheduler(ActivityToken activityToken)
This method sets the transport data that will be associated with a scheduled process.
|
static void |
addTransportDataToActivityTokenForSalesCenter(ActivityToken activityToken)
This method sets the transport data that will be associated with a sales center request.
|
static void |
addTransportDataToActivityTokenForWebServices(ActivityToken activityToken)
This method sets the transport data that will be associated with a web service request.
|
static void |
adjustPersonalizationIdForRegisterUser(java.lang.Integer storeId,
java.lang.Long userId)
Reserved for IBM internal use.
|
static void |
adjustPersonalizationIdForRegisterUser(java.lang.Long userId)
Reserved for IBM internal use.
|
static java.lang.String |
generatePersonalizationId()
Reserved for IBM internal use.
|
static java.lang.String |
getPersonalizationId(java.lang.Long userId)
Get the personalization ID for a specific guest or register user.
|
static java.lang.String |
getPersonalizationId(java.lang.Long userId,
java.lang.String personalizationId)
Get the personalization ID for a specific guest or register user.
|
static java.lang.Long |
getRegisteredUserId(java.lang.String personalizationId)
Get the register user ID associated with a specific personalization ID.
|
static java.util.ArrayList |
getUserIds(java.lang.String personalizationId)
Get the list of user IDs associated with a specific personalization ID.
|
public static final java.lang.String TRANSPORT_IDENTIFIER_WEB
ServletRequest
object.public static final java.lang.String TRANSPORT_IDENTIFIER_SALES_CENTER
com.ibm.commerce.SalesCenterRequest
.public static final java.lang.String TRANSPORT_REMOTE_AGENT_SALES_CENTER
com.ibm.commerce.SalesCenterClient
.public static final java.lang.String TRANSPORT_IDENTIFIER_WEBSERVICES
om.ibm.commerce.WebServiceRequest
.public static final java.lang.String TRANSPORT_REMOTE_AGENT_WEBSERVICES
com.ibm.commerce.WebServiceClient
.public static final java.lang.String TRANSPORT_IDENTIFIER_SCHEDULER
com.ibm.commerce.SchedulerRequest
.public static final java.lang.String TRANSPORT_REMOTE_AGENT_SCHEDULER
com.ibm.commerce.ScheduledProcess
.public static void addTransportDataToActivityForWeb(ActivityToken activityToken, javax.servlet.http.HttpServletRequest request)
activityToken
- This is the activity token used to start the business request.request
- This is the HTTP request used to extract the transport information.public static void addTransportDataToActivityTokenForSalesCenter(ActivityToken activityToken)
activityToken
- This is the activity token used to start the business request.public static void addTransportDataToActivityTokenForWebServices(ActivityToken activityToken)
activityToken
- This is the activity token used to start the business request.public static void addTransportDataToActivityTokenForForScheduler(ActivityToken activityToken)
activityToken
- This is the activity token used to start the business request.public static java.util.ArrayList getUserIds(java.lang.String personalizationId) throws BusinessContextException
personalizationId
- the personalization id for the searchBusinessContextException
- on any error encounteredpublic static java.lang.Long getRegisteredUserId(java.lang.String personalizationId) throws BusinessContextException
personalizationId
- the personalization id for the searchBusinessContextException
- on any error encounteredpublic static java.lang.String getPersonalizationId(java.lang.Long userId) throws BusinessContextException
userId
- the user id for the searchBusinessContextException
- on any other error encounteredpublic static java.lang.String getPersonalizationId(java.lang.Long userId, java.lang.String personalizationId) throws BusinessContextException
userId
- the user id for the searchpersonalizationId
- the new personalization id assignedBusinessContextException
- on any other error encounteredpublic static java.lang.String generatePersonalizationId()
Method to genetare UUID for personalization id purpose.
public static void adjustPersonalizationIdForRegisterUser(java.lang.Long userId) throws BusinessContextException
Adjust the personalization ID for a specific register user. This method will check to see if the input register user personalization ID has been used by another register user. If yes, then it will reassign (regenerate and store in DB) a new personalization ID for the input register user. This is necessary in the scenario that when a guest user did not register and was using another register user personalization ID to add something to shopping cart. The guest user is allowed to use the same personalization ID as the other register user. However, when the user register to be a new user, since the user will still use the guest user ID, but the type of the user is now register, he should not use the same personalization ID and should be assign a new one. If the input register user personalization ID is not used by any other register user, the method will just do nothing. If the input user ID is not a register user, the method will just do nothing. It is the responsibility of the caller to adjust the audit context personalization ID if the input user is the current run-as user.
userId
- user ID for personalization ID adjustmentBusinessContextException
- on any other error encounteredpublic static void adjustPersonalizationIdForRegisterUser(java.lang.Integer storeId, java.lang.Long userId) throws BusinessContextException
Adjust the personalization ID for a specific register user. This method will check to see if the input register user personalization ID has been used by another register user. If yes, then it will reassign (regenerate and store in DB) a new personalization ID for the input register user. This is necessary in the scenario that when a guest user did not register and was using another register user personalization ID to add something to shopping cart. The guest user is allowed to use the same personalization ID as the other register user. However, when the user register to be a new user, since the user will still use the guest user ID, but the type of the user is now register, he should not use the same personalization ID and should be assign a new one. If the input register user personalization ID is not used by any other register user, the method will just do nothing. If the input user ID is not a register user, the method will just do nothing. It is the responsibility of the caller to adjust the audit context personalization ID if the input user is the current run-as user.
storeId
- store ID for personalization ID adjustmentuserId
- user ID for personalization ID adjustmentBusinessContextException
- on any other error encountered