Examples of Identifiers


Examples of com.groupon.odo.controllers.models.Identifiers

    EndpointOverride getPath(Model model,
                             @PathVariable String pathIdentifier,
                             @RequestParam(required = false) String profileIdentifier,
                             @RequestParam(value = "typeFilter[]", required = false) String[] typeFilter,
                             @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(profileIdentifier, pathIdentifier);

        return PathOverrideService.getInstance().getPath(identifiers.getPathId(), clientUUID, typeFilter);
    }
View Full Code Here

Examples of com.groupon.odo.controllers.models.Identifiers

                             HttpServletResponse response
    ) throws Exception {
        String decodedProfileIdentifier = null;
        if (profileIdentifier != null)
            decodedProfileIdentifier = URLDecoder.decode(profileIdentifier, "UTF-8");
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(decodedProfileIdentifier, pathIdentifier);
        Integer pathId = identifiers.getPathId();

        // update the enabled value
        if (responseEnabled != null) {
            PathOverrideService.getInstance().setResponseEnabled(pathId, responseEnabled, clientUUID);
        }
View Full Code Here

Examples of com.groupon.odo.controllers.models.Identifiers

                                                         @RequestParam(value = "ordinal", defaultValue = "1") Integer ordinal,
                                                         @RequestParam(required = false) String profileIdentifier,
                                                         @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID,
                                                         @RequestParam(value = "arguments[]", required = false) Object[] arguments,
                                                         @RequestParam(value = "repeatNumber", required = false) Integer repeatNumber) throws Exception {
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(profileIdentifier, pathIdentifier);

        // need to get overrideId for identifiers..
        Integer overrideId = ControllerUtils.convertOverrideIdentifier(overrideIdentifier);

        // set arguments
        if (arguments != null) {
            JSONSerializer serializer = new JSONSerializer();

            OverrideService.getInstance().updateArguments(overrideId, identifiers.getPathId(), ordinal, serializer.serialize(httpRequest.getParameterValues("arguments[]")), clientUUID);
        }

        // set repeat number
        if (repeatNumber != null) {
            OverrideService.getInstance().updateRepeatNumber(overrideId, identifiers.getPathId(), ordinal, repeatNumber, clientUUID);
        }

        HashMap<String, Object> returnMap = new HashMap<String, Object>();
        returnMap.put("enabledEndpoint", OverrideService.getInstance().getEnabledEndpoint(identifiers.getPathId(), overrideId, ordinal, clientUUID));
        return returnMap;
    }
View Full Code Here

Examples of com.groupon.odo.controllers.models.Identifiers

                                           @PathVariable String pathIdentifier,
                                           @PathVariable String overrideIdentifier,
                                           @RequestParam(value = "ordinal", defaultValue = "1") Integer ordinal,
                                           @RequestParam(required = false) String profileIdentifier,
                                           @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(profileIdentifier, pathIdentifier);

        // need to get overrideId for identifiers..
        Integer overrideId = ControllerUtils.convertOverrideIdentifier(overrideIdentifier);

        OverrideService.getInstance().removeOverride(overrideId, identifiers.getPathId(), ordinal, clientUUID);

        HashMap<String, Object> returnMap = new HashMap<String, Object>();
        returnMap.put("enabledEndpoint", OverrideService.getInstance().getEnabledEndpoint(identifiers.getPathId(), overrideId, ordinal, clientUUID));
        return returnMap;
    }
View Full Code Here

Examples of com.groupon.odo.controllers.models.Identifiers

                                                                @PathVariable String pathIdentifier,
                                                                @PathVariable String overrideIdentifier,
                                                                @RequestParam(value = "ordinal", defaultValue = "1") Integer ordinal,
                                                                @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID,
                                                                @RequestParam(required = false) String profileIdentifier) throws Exception {
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(profileIdentifier, pathIdentifier);

        // need to get overrideId for identifiers..
        Integer overrideId = ControllerUtils.convertOverrideIdentifier(overrideIdentifier);

        HashMap<String, Object> returnMap = new HashMap<String, Object>();

        if (overrideId != null)
            returnMap.put("enabledEndpoint", OverrideService.getInstance().getEnabledEndpoint(identifiers.getPathId(), overrideId, ordinal, clientUUID));

        return returnMap;
    }
View Full Code Here

Examples of com.groupon.odo.controllers.models.Identifiers

     * @param pathIdentifier    actual ID or friendly name of path
     * @return
     * @throws Exception
     */
    public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
        Identifiers id = new Identifiers();

        Integer profileId = null;
        try {
            profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
        } catch (Exception e) {
            // this is OK for this since it isn't always needed
        }
        Integer pathId = convertPathIdentifier(pathIdentifier, profileId);

        id.setProfileId(profileId);
        id.setPathId(pathId);

        return id;
    }
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

    public static final String FORCE_GROUPS_PARAMETER = "prforceGroups";
    public static final String FORCE_GROUPS_COOKIE_NAME = "prforceGroups";

    public static ProctorResult determineBuckets(final HttpServletRequest request, final HttpServletResponse response, final Proctor proctor,
                                                    final String identifier, final TestType testType, final Map<String, Object> context, final boolean allowForcedGroups) {
        final Identifiers identifiers = new Identifiers(testType, identifier);
        return determineBuckets(request, response, proctor, identifiers, context, allowForcedGroups);
    }
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

    }

    @Test
    public void testMultipleTypes() {
        {
            final Identifiers identifiers = new Identifiers(ImmutableMap.<TestType, String>builder()
                                                            .put(TestType.ANONYMOUS_USER, SPECIFICATION_MATRIX)
                                                            .put(TestType.AUTHENTICATED_USER, SPECIFICATION_MATRIX)
                                                            .put(TestType.PAGE, SPECIFICATION_MATRIX)
                                                            .build());

            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */ new Account(10));
            assertEquals("kluj:kloo2,map_payload:inactive-1,oop_poop:test1,payloaded:inactive-1,payloaded_verified:inactive-1,pimple:control0", calcBuckets(result));
        }
        {
            final ImmutableMap<TestType, String> idMap = ImmutableMap.<TestType, String>builder()
                                                                .put(TestType.EMAIL_ADDRESS, SPECIFICATION_MATRIX)
                                                                .put(TestType.AUTHENTICATED_USER, SPECIFICATION_MATRIX)
                                                                .put(TestType.PAGE, SPECIFICATION_MATRIX)
                                                                .build();
            final Identifiers identifiers = new Identifiers(idMap, true);

            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));
            assertEquals(result.getBuckets().get("pimple").getValue(), 0);
            assertNotNull(result.getBuckets().get("bubble").getValue());
            assertEquals(result.getBuckets().get("dubblez").getValue(), 2);
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

        }
    }

    @Test
    public void testRandom() {
        final Identifiers identifiers = new Identifiers(Collections.<TestType, String>emptyMap(), true);

        final int[] valuesFound = new int[4];
        for (int i = 0; i < 2000; i++) {
            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));
            valuesFound[result.getBuckets().get("bubble").getValue()]++;
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

    }

    @Test
    public void testUserBuckets() {
        {
            final Identifiers identifiers = new Identifiers(TestType.ANONYMOUS_USER, "16s2o7s01001d9vj");
            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));
            assertEquals("kluj:test1,map_payload:inactive-1,oop_poop:control0,payloaded:inactive-1,payloaded_verified:inactive-1", calcBuckets(result));
            // Check and make sure UnitTestGroups respects these groups and works as expected.
            final UnitTestGroups grps = new UnitTestGroups(result);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.