com.indeed.proctor.consumer
Class ProctorConsumerUtils

java.lang.Object
  extended by com.indeed.proctor.consumer.ProctorConsumerUtils

public class ProctorConsumerUtils
extends Object


Field Summary
static String FORCE_GROUPS_COOKIE_NAME
           
static String FORCE_GROUPS_PARAMETER
          plain old "forceGroups" is already in use by JASX for SERP groups
 
Constructor Summary
ProctorConsumerUtils()
           
 
Method Summary
static ProctorResult determineBuckets(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Proctor proctor, Identifiers identifiers, Map<String,Object> context, boolean allowForcedGroups)
           
static ProctorResult determineBuckets(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Proctor proctor, String identifier, TestType testType, Map<String,Object> context, boolean allowForcedGroups)
           
static String getForceGroupsStringFromRequest(javax.servlet.http.HttpServletRequest request)
           
static Map<String,Integer> parseForcedGroups(javax.servlet.http.HttpServletRequest request)
          Consumer is required to do any privilege checks before getting here
static Map<String,Integer> parseForceGroupsList(String payload)
           
static void setForcedGroupsCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Integer> forceGroups)
          Set a cookie that will be parsed by parseForcedGroups(HttpServletRequest).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORCE_GROUPS_PARAMETER

public static final String FORCE_GROUPS_PARAMETER
plain old "forceGroups" is already in use by JASX for SERP groups

See Also:
Constant Field Values

FORCE_GROUPS_COOKIE_NAME

public static final String FORCE_GROUPS_COOKIE_NAME
See Also:
Constant Field Values
Constructor Detail

ProctorConsumerUtils

public ProctorConsumerUtils()
Method Detail

determineBuckets

public static ProctorResult determineBuckets(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             Proctor proctor,
                                             String identifier,
                                             TestType testType,
                                             Map<String,Object> context,
                                             boolean allowForcedGroups)

determineBuckets

public static ProctorResult determineBuckets(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             Proctor proctor,
                                             Identifiers identifiers,
                                             Map<String,Object> context,
                                             boolean allowForcedGroups)

parseForcedGroups

@Nonnull
public static Map<String,Integer> parseForcedGroups(@Nonnull
                                                            javax.servlet.http.HttpServletRequest request)
Consumer is required to do any privilege checks before getting here

Returns:
a map of test names to bucket values specified by the request. Returns an empty Map if nothing was specified

getForceGroupsStringFromRequest

@Nullable
public static String getForceGroupsStringFromRequest(@Nonnull
                                                              javax.servlet.http.HttpServletRequest request)

parseForceGroupsList

@Nonnull
public static Map<String,Integer> parseForceGroupsList(@Nonnull
                                                               String payload)

setForcedGroupsCookie

public static void setForcedGroupsCookie(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         Map<String,Integer> forceGroups)
Set a cookie that will be parsed by parseForcedGroups(HttpServletRequest). Cookie expires at end of browser session



Copyright © 2014. All Rights Reserved.