@Test public void getEventsQueueLength() throws Exception { assertThat(resource.getEventsQueueLength().getStatus(), is(HttpStatus.SC_OK)); }
@GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed public Response getEventsQueueLength() { try { return httpHeader.headers().entity(events.queuesLength()).build(); } catch (Exception exception) { LOGGER.error("getEventsQueueLength failed with error:", exception); throw exception; } }
EventsResource { @GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed public Response getEventsQueueLength() { try { return httpHeader.headers().entity(events.queuesLength()).build(); } catch (Exception exception) { LOGGER.error("getEventsQueueLength failed with error:", exception); throw exception; } } }
EventsResource { @GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed public Response getEventsQueueLength() { try { return httpHeader.headers().entity(events.queuesLength()).build(); } catch (Exception exception) { LOGGER.error("getEventsQueueLength failed with error:", exception); throw exception; } } @Inject  EventsResource(final Events events, final HttpHeader httpHeader); }
EventsResource { @GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed public Response getEventsQueueLength() { try { return httpHeader.headers().entity(events.queuesLength()).build(); } catch (Exception exception) { LOGGER.error("getEventsQueueLength failed with error:", exception); throw exception; } } @Inject  EventsResource(final Events events, final HttpHeader httpHeader); @POST @Path("applications/{applicationName}/experiments/{experimentLabel}/users/{userID}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = "Submit a single event or a batch of events for the specified assigned user(customer)", notes = "*NOTE*: For a given user, please make sure that you have the user assignment done using the " + "assignments API before using this API. An event is either an impression, indicating the user " + "has been exposed to the treatment, or an action, indicating that the user has done something " + "that you want to track. Please record impressions first and then action - use event " + "name = \"IMPRESSION\" for impressions.") @Timed Response recordEvents(
            @PathParam("applicationName")
            @ApiParam(value = "Application Name")
            final Application.Name applicationName,

            @PathParam("experimentLabel")
            @ApiParam(value = "Experiment Label")
            final Experiment.Label experimentLabel,

            @PathParam("userID")
            @ApiParam(value = "Customer User ID that is already assigned using assignments API")
            final User.ID userID,

            @ApiParam(name = "eventList", required = true, value = "For impression", defaultValue = DEFAULT_EVENT)
            final EventList eventList); @POST @Path("applications/{applicationName}/experiments/{experimentLabel}/users") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Timed Response recordUsersEvents(
            @PathParam("applicationName")
            final Application.Name applicationName,

            @PathParam("experimentLabel")
            final Experiment.Label experimentLabel,

            final Map<User.ID, List<Event>> eventList); @POST @Path("applications/{applicationName}/experiments") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Timed Response recordExperimentsEvents(
            @PathParam("applicationName") final Application.Name applicationName,
            final Map<Experiment.Label, Map<User.ID, List<Event>>> eventList); @GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed Response getEventsQueueLength(); }
EventsResource { @GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed public Response getEventsQueueLength() { try { return httpHeader.headers().entity(events.queuesLength()).build(); } catch (Exception exception) { LOGGER.error("getEventsQueueLength failed with error:", exception); throw exception; } } @Inject  EventsResource(final Events events, final HttpHeader httpHeader); @POST @Path("applications/{applicationName}/experiments/{experimentLabel}/users/{userID}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = "Submit a single event or a batch of events for the specified assigned user(customer)", notes = "*NOTE*: For a given user, please make sure that you have the user assignment done using the " + "assignments API before using this API. An event is either an impression, indicating the user " + "has been exposed to the treatment, or an action, indicating that the user has done something " + "that you want to track. Please record impressions first and then action - use event " + "name = \"IMPRESSION\" for impressions.") @Timed Response recordEvents(
            @PathParam("applicationName")
            @ApiParam(value = "Application Name")
            final Application.Name applicationName,

            @PathParam("experimentLabel")
            @ApiParam(value = "Experiment Label")
            final Experiment.Label experimentLabel,

            @PathParam("userID")
            @ApiParam(value = "Customer User ID that is already assigned using assignments API")
            final User.ID userID,

            @ApiParam(name = "eventList", required = true, value = "For impression", defaultValue = DEFAULT_EVENT)
            final EventList eventList); @POST @Path("applications/{applicationName}/experiments/{experimentLabel}/users") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Timed Response recordUsersEvents(
            @PathParam("applicationName")
            final Application.Name applicationName,

            @PathParam("experimentLabel")
            final Experiment.Label experimentLabel,

            final Map<User.ID, List<Event>> eventList); @POST @Path("applications/{applicationName}/experiments") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Timed Response recordExperimentsEvents(
            @PathParam("applicationName") final Application.Name applicationName,
            final Map<Experiment.Label, Map<User.ID, List<Event>>> eventList); @GET @Path("queueLength") @Produces(APPLICATION_JSON) @Timed Response getEventsQueueLength();  }