ATEST-521
This commit is contained in:
@ -43,6 +43,7 @@ import ch.psi.daq.domain.query.operation.Compression;
|
||||
import ch.psi.daq.domain.query.operation.QueryField;
|
||||
import ch.psi.daq.domain.query.response.Response;
|
||||
import ch.psi.daq.domain.query.response.ResponseFormat;
|
||||
import ch.psi.daq.domain.query.transform.image.resize.ValueAggregation;
|
||||
import ch.psi.daq.domain.request.validate.RequestProviderValidator;
|
||||
import ch.psi.daq.queryrest.query.QueryManager;
|
||||
import ch.psi.daq.queryrest.response.AbstractHTTPResponse;
|
||||
@ -53,6 +54,7 @@ import ch.psi.daq.queryrest.response.json.JSONHTTPResponse;
|
||||
public class QueryRestController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(QueryRestController.class);
|
||||
public static final String PARAMETERS_ROOT_PATH = "params";
|
||||
|
||||
@Resource
|
||||
private ApplicationContext appContext;
|
||||
@ -215,7 +217,18 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link Ordering}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "ordering", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Ordering> getOrderingValuesDeprecated() {
|
||||
return Lists.newArrayList(Ordering.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link Ordering}s available.
|
||||
*
|
||||
* @return list of {@link Ordering}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/ordering", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Ordering> getOrderingValues() {
|
||||
return Lists.newArrayList(Ordering.values());
|
||||
}
|
||||
@ -225,8 +238,20 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link Ordering}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "responseformat", method = {RequestMethod.GET},
|
||||
produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<ResponseFormat> getResponseFormatValuesDeprecated() {
|
||||
return Lists.newArrayList(ResponseFormat.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link ResponseFormat}s available.
|
||||
*
|
||||
* @return list of {@link Ordering}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/responseformat", method = {RequestMethod.GET},
|
||||
produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<ResponseFormat> getResponseFormatValues() {
|
||||
return Lists.newArrayList(ResponseFormat.values());
|
||||
}
|
||||
@ -236,7 +261,20 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link QueryField}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "queryfields", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<QueryField> getQueryFieldValuesDeprecated() {
|
||||
return Arrays.stream(QueryField.values())
|
||||
.filter(queryField -> queryField.isPublish())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link QueryField}s available.
|
||||
*
|
||||
* @return list of {@link QueryField}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/queryfields", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<QueryField> getQueryFieldValues() {
|
||||
return Arrays.stream(QueryField.values())
|
||||
.filter(queryField -> queryField.isPublish())
|
||||
@ -248,8 +286,19 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link Aggregation}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "aggregations", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Aggregation> getAggregationsValues() {
|
||||
public @ResponseBody List<Aggregation> getAggregationValuesDeprecated() {
|
||||
return Lists.newArrayList(Aggregation.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link Aggregation}s available.
|
||||
*
|
||||
* @return list of {@link Aggregation}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/aggregations", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Aggregation> getAggregationValues() {
|
||||
return Lists.newArrayList(Aggregation.values());
|
||||
}
|
||||
|
||||
@ -258,9 +307,21 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link AggregationType}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "aggregationtypes", method = {RequestMethod.GET},
|
||||
produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<AggregationType> getAggregationTypesValues() {
|
||||
public @ResponseBody List<AggregationType> getAggregationTypeValuesDeprecated() {
|
||||
return Lists.newArrayList(AggregationType.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link AggregationType}s available.
|
||||
*
|
||||
* @return list of {@link AggregationType}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/aggregationtypes", method = {RequestMethod.GET},
|
||||
produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<AggregationType> getAggregationTypeValues() {
|
||||
return Lists.newArrayList(AggregationType.values());
|
||||
}
|
||||
|
||||
@ -269,8 +330,19 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link Backend}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "backends", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Backend> getDBModeValues() {
|
||||
public @ResponseBody List<Backend> getBackendValuesDeprecated() {
|
||||
return Lists.newArrayList(Backend.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link Backend} values.
|
||||
*
|
||||
* @return list of {@link Backend}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/backends", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Backend> getBackendValues() {
|
||||
return Lists.newArrayList(Backend.values());
|
||||
}
|
||||
|
||||
@ -279,8 +351,29 @@ public class QueryRestController {
|
||||
*
|
||||
* @return list of {@link Compression}s as String array
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "compression", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Compression> getCompressionValuesDeprecated() {
|
||||
return Lists.newArrayList(Compression.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link Compression}s available.
|
||||
*
|
||||
* @return list of {@link Compression}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/compression", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<Compression> getCompressionValues() {
|
||||
return Lists.newArrayList(Compression.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current list of {@link Compression}s available.
|
||||
*
|
||||
* @return list of {@link Compression}s as String array
|
||||
*/
|
||||
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/valueaggregations", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public @ResponseBody List<ValueAggregation> getValueAggregations() {
|
||||
return Lists.newArrayList(ValueAggregation.values());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user