view src/main/java/de/intevation/lada/rest/QueryService.java @ 827:5bdd1631a451

!!!CAUTION!!! changed services path! REST servies now listening on /rest/* Importer/Exporter now listening on /data/$FORMAT/*
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 18 Dec 2015 17:47:14 +0100
parents 5155b0b375cd
children
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out
 * the documentation coming with IMIS-Labordaten-Application for details.
 */
package de.intevation.lada.rest;

import javax.enterprise.context.RequestScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import de.intevation.lada.query.QueryTools;
import de.intevation.lada.util.rest.Response;


/**
 * REST-Service for preconfigured queries.
 * <p>
 * The services produce data in the application/json media type.
 * All HTTP methods use the authorization module to determine if the user is
 * allowed to perform the requested action.
 * A typical response holds information about the action performed and the data.
 * <pre>
 * <code>
 * {
 *  "success": [boolean];
 *  "message": [string],
 *  "data":[{
 *      "id": [string],
 *      "name": [string],
 *      "description": [string],
 *      "sql": [string],
 *      "filters": [array],
 *      "results": [array]
 *  }],
 *  "errors": [object],
 *  "warnings": [object],
 *  "readonly": [boolean],
 *  "totalCount": [number]
 * }
 * </code>
 * </pre>
 *
 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
 */
@Path("rest/query")
@RequestScoped
public class QueryService {

    /**
     * Request all configured probe queries.
     */
    @GET
    @Path("/probe")
    @Produces("application/json")
    public Response getProbe() {
        return new Response(true, 200, QueryTools.getProbeConfig());
    }

    /**
     * Request all configured messprogramm queries.
     */
    @GET
    @Path("/messprogramm")
    @Produces("application/json")
    public Response getMessprogramm() {
        return new Response(true, 200, QueryTools.getMessprogrammConfig());
    }

    /**
     * Request all configured stammdaten queries.
     */
    @GET
    @Path("/stammdaten")
    @Produces("application/json")
    public Response getStammdaten() {
        return new Response(true, 200, QueryTools.getStammdatenConfig());
    }
}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)