Search in sources :

Example 41 with GET

use of javax.ws.rs.GET in project jersey by jersey.

the class MessageStreamResource method getMessageStream.

/**
     * Get the new SSE message stream channel.
     *
     * @return new SSE message stream channel.
     */
@GET
@Produces(SseFeature.SERVER_SENT_EVENTS)
public EventOutput getMessageStream() {
    LOGGER.info("--> SSE connection received.");
    final EventOutput eventOutput = new EventOutput();
    broadcaster.add(eventOutput);
    return eventOutput;
}
Also used : EventOutput(org.glassfish.jersey.media.sse.EventOutput) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 42 with GET

use of javax.ws.rs.GET in project jersey by jersey.

the class TestExceptionResource method getUnmappedException.

@GET
@Path("unmapped")
public void getUnmappedException(@Suspended final AsyncResponse asyncResponse) {
    lastProcessingThread = Thread.currentThread();
    asyncResponse.resume(new UnmappedException());
}
Also used : UnmappedException(org.glassfish.jersey.tests.integration.jersey2730.exception.UnmappedException) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 43 with GET

use of javax.ws.rs.GET in project jersey by jersey.

the class TestExceptionResource method getUnmappedRuntimeException.

@GET
@Path("runtime")
public void getUnmappedRuntimeException(@Suspended final AsyncResponse asyncResponse) {
    lastProcessingThread = Thread.currentThread();
    asyncResponse.resume(new UnmappedRuntimeException());
}
Also used : UnmappedRuntimeException(org.glassfish.jersey.tests.integration.jersey2730.exception.UnmappedRuntimeException) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 44 with GET

use of javax.ws.rs.GET in project pinot by linkedin.

the class AnomaliesResource method getAnomaliesByDashboardId.

/**
   * Find anomalies by dashboard id
   * @param startTime
   * @param endTime
   * @param dashboardId
   * @param functionName
   * @return
   * @throws Exception
   */
@GET
@Path("search/dashboardId/{startTime}/{endTime}/{pageNumber}")
public AnomaliesWrapper getAnomaliesByDashboardId(@PathParam("startTime") Long startTime, @PathParam("endTime") Long endTime, @PathParam("pageNumber") int pageNumber, @QueryParam("dashboardId") String dashboardId, @QueryParam("functionName") String functionName) throws Exception {
    DashboardConfigDTO dashboardConfig = dashboardConfigDAO.findById(Long.valueOf(dashboardId));
    String metricIdsString = Joiner.on(COMMA_SEPARATOR).join(dashboardConfig.getMetricIds());
    return getAnomaliesByMetricIds(startTime, endTime, pageNumber, metricIdsString, functionName);
}
Also used : DashboardConfigDTO(com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 45 with GET

use of javax.ws.rs.GET in project pinot by linkedin.

the class AnomaliesResource method getAnomaliesByTime.

/**
   * Search anomalies only by time
   * @param startTime
   * @param endTime
   * @return
   * @throws Exception
   */
@GET
@Path("search/time/{startTime}/{endTime}/{pageNumber}")
public AnomaliesWrapper getAnomaliesByTime(@PathParam("startTime") Long startTime, @PathParam("endTime") Long endTime, @PathParam("pageNumber") int pageNumber) throws Exception {
    List<MergedAnomalyResultDTO> mergedAnomalies = mergedAnomalyResultDAO.findByTime(startTime, endTime);
    try {
        mergedAnomalies = AlertFilterHelper.applyFiltrationRule(mergedAnomalies, alertFilterFactory);
    } catch (Exception e) {
        LOG.warn("Failed to apply alert filters on anomalies in start:{}, end:{}, exception:{}", new DateTime(startTime), new DateTime(endTime), e);
    }
    AnomaliesWrapper anomaliesWrapper = constructAnomaliesWrapperFromMergedAnomalies(mergedAnomalies, pageNumber);
    return anomaliesWrapper;
}
Also used : MergedAnomalyResultDTO(com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO) AnomaliesWrapper(com.linkedin.thirdeye.dashboard.resources.v2.pojo.AnomaliesWrapper) TimeoutException(java.util.concurrent.TimeoutException) JSONException(org.json.JSONException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) DateTime(org.joda.time.DateTime) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)3467 Path (javax.ws.rs.Path)2921 Produces (javax.ws.rs.Produces)2414 ApiOperation (io.swagger.annotations.ApiOperation)709 ApiResponses (io.swagger.annotations.ApiResponses)558 ArrayList (java.util.ArrayList)468 IOException (java.io.IOException)344 Response (javax.ws.rs.core.Response)342 WebApplicationException (javax.ws.rs.WebApplicationException)335 Consumes (javax.ws.rs.Consumes)267 HashMap (java.util.HashMap)242 List (java.util.List)231 URI (java.net.URI)202 Map (java.util.Map)202 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)196 Timed (com.codahale.metrics.annotation.Timed)195 TimedResource (org.killbill.commons.metrics.TimedResource)121 TenantContext (org.killbill.billing.util.callcontext.TenantContext)117 MediaType (javax.ws.rs.core.MediaType)113 ApiResponse (io.swagger.annotations.ApiResponse)111