public class ExperimentBaseEvaluateCmdImpl extends TaskCommandImpl implements ExperimentBaseEvaluateCmd
ExperimentBaseEvaluateCmd
interface to provide
the task command that contains common methods used in evaluation of experiments. This
command is extended by a custom implementation for each type of store element, which
is the object used to display content in the store front. An e-Marketing Spot is an
example of a store element in which marketing content is delivered to customers.
Functionalities provided by common methods implemented in this command include
database operations on the
EXPRESULT
table, and result generation for experiments given their business rule definitions.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static int |
DEFAULT_FREQUENCY_SIZE
Default size of display frequency in an experiment.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
ExperimentBaseEvaluateCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Short |
generateExperimentResult(ExperimentRuleDefinition ruleDefinition)
This method returns the ID of a control or test element in the given rule definition
object based on the comparison result between the element's display frequency and
the randomly generated number.
|
java.lang.Short |
getExperimentResultFromDB(java.lang.Integer experimentId,
java.lang.Long userId,
java.lang.String sessionId,
boolean isUserFallBack)
This method returns the ID of the control or test element to be returned as the
result of the experiment evaluation from the database, based on the given
experiment, and user or session, depending on the fallback flag.
|
java.lang.Short |
getExperimentResultFromDB(java.lang.Integer experimentId,
java.lang.String sessionId)
This method returns the ID of the control or test element to be returned as the
result of the experiment evaluation from the database, based on the given
experiment and session ID.
|
void |
insertExperimentResultToDB(java.lang.Integer experimentId,
java.lang.Long userId,
java.lang.String sessionId,
java.lang.Short resultNumber)
This method inserts a new record to the
EXPRESULT table in
the database which holds the experiment result uniquely identified by the
experiment, session and user.
|
void |
performExecute()
This method evaluates all of the currently active experiments that are scheduled to
the given store element during the given time, and gathers all of the experiment
results which can be accessed through parameters, by invoking the
getPostInvokeParameters method in this command.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public static final java.lang.String COPYRIGHT
public static final int DEFAULT_FREQUENCY_SIZE
public java.lang.Short generateExperimentResult(ExperimentRuleDefinition ruleDefinition)
generateExperimentResult
in interface ExperimentBaseEvaluateCmd
ruleDefinition
- An instance of
com.ibm.commerce.tools.experimentation.ExperimentRuleDefinition
object which contains the definition of experiment rule.public java.lang.Short getExperimentResultFromDB(java.lang.Integer experimentId, java.lang.String sessionId)
getExperimentResultFromDB
in interface ExperimentBaseEvaluateCmd
experimentId
- The ID of the experiment.sessionId
- The ID of the current session.public java.lang.Short getExperimentResultFromDB(java.lang.Integer experimentId, java.lang.Long userId, java.lang.String sessionId, boolean isUserFallBack)
getExperimentResultFromDB
in interface ExperimentBaseEvaluateCmd
experimentId
- The ID of the experiment.userId
- The ID of the user.sessionId
- The ID of the current session.isUserFallBack
- True if the result will be found based on the session and use
the user as fallback; false otherwise.public void insertExperimentResultToDB(java.lang.Integer experimentId, java.lang.Long userId, java.lang.String sessionId, java.lang.Short resultNumber)
insertExperimentResultToDB
in interface ExperimentBaseEvaluateCmd
experimentId
- The ID of the experiment.userId
- The ID of the user.sessionId
- The ID of the current session.resultNumber
- The ID of the selected control or test element.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
- Thrown whenever an exception occurs while parsing and
evaluating the experiment rules.