Search in sources :

Example 31 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.

the class MapController method getResponseTimeHistogramData.

@RequestMapping(value = "/getResponseTimeHistogramData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public ApplicationTimeHistogramViewModel getResponseTimeHistogramData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("from") long from, @RequestParam("to") long to) {
    final Range range = new Range(from, to);
    dateLimit.limit(range);
    Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName);
    ApplicationTimeHistogramViewModel applicationTimeHistogramViewModel = mapService.selectResponseTimeHistogramData(application, range);
    return applicationTimeHistogramViewModel;
}
Also used : ApplicationTimeHistogramViewModel(com.navercorp.pinpoint.web.view.ApplicationTimeHistogramViewModel) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 32 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.

the class AgentStatController method getAgentStatChartList.

@PreAuthorize("hasPermission(new com.navercorp.pinpoint.web.vo.AgentParam(#agentId, #to), 'agentParam', 'inspector')")
@RequestMapping(value = "/chartList", method = RequestMethod.GET)
@ResponseBody
public List<AgentStatChartGroup> getAgentStatChartList(@RequestParam("agentId") String agentId, @RequestParam("from") long from, @RequestParam("to") long to) {
    TimeWindowSampler sampler = new TimeWindowSlotCentricSampler();
    TimeWindow timeWindow = new TimeWindow(new Range(from, to), sampler);
    return this.agentStatChartService.selectAgentChartList(agentId, timeWindow);
}
Also used : TimeWindowSampler(com.navercorp.pinpoint.web.util.TimeWindowSampler) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) TimeWindowSlotCentricSampler(com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 33 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.

the class AgentStatisticsController method insertAgentCount.

@RequestMapping(value = "/insertAgentCount", method = RequestMethod.GET, params = { "agentCount", "timestamp" })
@ResponseBody
public Map<String, String> insertAgentCount(@RequestParam("agentCount") int agentCount, @RequestParam("timestamp") long timestamp) {
    if (timestamp < 0) {
        Map<String, String> result = new HashMap<>();
        result.put("result", "FAIL");
        result.put("message", "negative timestamp.");
        return result;
    }
    AgentCountStatistics agentCountStatistics = new AgentCountStatistics(agentCount, DateUtils.timestampToMidNight(timestamp));
    boolean success = agentStatisticsService.insertAgentCount(agentCountStatistics);
    if (success) {
        Map<String, String> result = new HashMap<>();
        result.put("result", "SUCCESS");
        return result;
    } else {
        Map<String, String> result = new HashMap<>();
        result.put("result", "FAIL");
        result.put("message", "insert DAO error.");
        return result;
    }
}
Also used : HashMap(java.util.HashMap) AgentCountStatistics(com.navercorp.pinpoint.web.vo.AgentCountStatistics) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 34 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project pinpoint by naver.

the class AgentStatisticsController method selectAgentCount.

@RequestMapping(value = "/selectAgentCount", method = RequestMethod.GET, params = { "from", "to" })
@ResponseBody
public List<AgentCountStatistics> selectAgentCount(@RequestParam("from") long from, @RequestParam("to") long to) {
    Range range = new Range(DateUtils.timestampToMidNight(from), DateUtils.timestampToMidNight(to), true);
    List<AgentCountStatistics> agentCountStatisticsList = agentStatisticsService.selectAgentCount(range);
    Collections.sort(agentCountStatisticsList, new Comparator<AgentCountStatistics>() {

        @Override
        public int compare(AgentCountStatistics o1, AgentCountStatistics o2) {
            if (o1.getTimestamp() > o2.getTimestamp()) {
                return -1;
            } else {
                return 1;
            }
        }
    });
    return agentCountStatisticsList;
}
Also used : AgentCountStatistics(com.navercorp.pinpoint.web.vo.AgentCountStatistics) Range(com.navercorp.pinpoint.web.vo.Range) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 35 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project goci by EBISPOT.

the class PussycatGOCIController method renderAssociations.

@RequestMapping(value = "/gwasdiagram/associations")
@ResponseBody
public String renderAssociations(@RequestParam(value = "pvaluemin", required = false) String pvalueMin, @RequestParam(value = "pvaluemax", required = false) String pvalueMax, @RequestParam(value = "datemin", required = false) String dateMin, @RequestParam(value = "datemax", required = false) String dateMax, HttpSession session) throws PussycatSessionNotReadyException, NoRenderableDataException {
    getLog().debug("Received a new rendering request - " + "putting together the query from date '" + dateMin + "' to '" + dateMax + "' and from pvalue '" + pvalueMin + "' to '" + pvalueMax + "'");
    if (pvalueMin == "") {
        pvalueMin = null;
    }
    if (pvalueMax == "") {
        pvalueMax = null;
    }
    if (dateMin == "") {
        dateMin = null;
    }
    if (dateMax == "") {
        dateMax = null;
    }
    Filter pvalueFilter = null;
    Filter dateFilter = null;
    if (pvalueMin != null || pvalueMax != null) {
        pvalueFilter = setPvalueFilter(pvalueMin, pvalueMax);
        getRenderletNexus(session).setRenderingContext(pvalueFilter);
    }
    if (dateMin != null || dateMax != null) {
        dateFilter = setDateFilter(dateMin, dateMax);
        getRenderletNexus(session).setRenderingContext(dateFilter);
    }
    if (dateFilter == null && pvalueFilter == null) {
        return getPussycatSession(session).performRendering(getRenderletNexus(session));
    } else if (dateFilter == null && pvalueFilter != null) {
        return getPussycatSession(session).performRendering(getRenderletNexus(session), pvalueFilter);
    } else if (pvalueFilter == null && dateFilter != null) {
        return getPussycatSession(session).performRendering(getRenderletNexus(session), dateFilter);
    } else {
        return getPussycatSession(session).performRendering(getRenderletNexus(session), dateFilter, pvalueFilter);
    }
}
Also used : Filter(uk.ac.ebi.spot.goci.pussycat.lang.Filter) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ResponseBody (org.springframework.web.bind.annotation.ResponseBody)491 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)454 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)84 ApiOperation (io.swagger.annotations.ApiOperation)64 ArrayList (java.util.ArrayList)55 HashMap (java.util.HashMap)50 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)47 ResponseEntity (org.springframework.http.ResponseEntity)39 CommandStringBuilder (org.apache.geode.management.internal.cli.util.CommandStringBuilder)37 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)36 RootNode (org.hisp.dhis.node.types.RootNode)33 IOException (java.io.IOException)22 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)22 CollectionNode (org.hisp.dhis.node.types.CollectionNode)19 GetMapping (org.springframework.web.bind.annotation.GetMapping)19 Date (java.util.Date)18 User (org.hisp.dhis.user.User)17 Range (com.navercorp.pinpoint.web.vo.Range)15 Text (org.orcid.pojo.ajaxForm.Text)15 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)14