Class ExperimentVariantsTracker

  • All Implemented Interfaces:
    java.io.Serializable, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener

    public class ExperimentVariantsTracker
    extends java.lang.Object
    implements javax.servlet.http.HttpSessionBindingListener, java.io.Serializable
    Class responsible for dealing with the storage of the ActiveExperimentVariant.
    Since:
    14.0.0
    Version:
    $Revision$ $Date$
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void abandonExperiment​(javax.servlet.http.HttpSession session, java.lang.String experimentId, java.lang.String trackId)
      Abandon the given experiment in the current session.
      static ActiveExperimentVariant applyExperiment​(javax.servlet.http.HttpSession session, java.lang.String experimentId, java.lang.String trackId)
      Apply the given experiment to the current session.
      static void completeExperiment​(javax.servlet.http.HttpSession session, java.lang.String experimentId, java.lang.String trackId)
      Complete the given experiment in the current session.
      static java.util.Collection<ActiveExperimentVariant> getActiveExperiments​(javax.servlet.http.HttpSession session)
      Returns all valid ActiveExperimentVariant in the current session.
      void valueBound​(javax.servlet.http.HttpSessionBindingEvent event)  
      void valueUnbound​(javax.servlet.http.HttpSessionBindingEvent event)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExperimentVariantsTracker

        public ExperimentVariantsTracker()
    • Method Detail

      • valueBound

        public void valueBound​(javax.servlet.http.HttpSessionBindingEvent event)
        Specified by:
        valueBound in interface javax.servlet.http.HttpSessionBindingListener
      • valueUnbound

        public void valueUnbound​(javax.servlet.http.HttpSessionBindingEvent event)
        Specified by:
        valueUnbound in interface javax.servlet.http.HttpSessionBindingListener
      • applyExperiment

        public static ActiveExperimentVariant applyExperiment​(javax.servlet.http.HttpSession session,
                                                              java.lang.String experimentId,
                                                              java.lang.String trackId)
                                                       throws PortalException
        Apply the given experiment to the current session.
        Parameters:
        session - the current session.
        experimentId - the experiment identifier to apply to the session.
        trackId - the track identifier of the user that will apply the experiment.
        Returns:
        the applied ActiveExperimentVariant or null if no experiment was applied.
        Throws:
        PortalException
        Since:
        14.0.0
      • completeExperiment

        public static void completeExperiment​(javax.servlet.http.HttpSession session,
                                              java.lang.String experimentId,
                                              java.lang.String trackId)
                                       throws PortalException
        Complete the given experiment in the current session.
        Parameters:
        session - the current session.
        experimentId - the experiment identifier to apply to the session.
        trackId - the track identifier of the user that will complete the experiment.
        Throws:
        PortalException
        Since:
        14.0.0
      • abandonExperiment

        public static void abandonExperiment​(javax.servlet.http.HttpSession session,
                                             java.lang.String experimentId,
                                             java.lang.String trackId)
                                      throws PortalException
        Abandon the given experiment in the current session.
        Parameters:
        session - the current session.
        experimentId - the experiment identifier to apply to the session.
        trackId - the track identifier of the user that will abandon the experiment.
        Throws:
        PortalException
        Since:
        14.0.0