Filestorage version.

This commit is contained in:
Fabian Märki
2017-06-30 17:33:46 +02:00
parent 9af13c5baa
commit 9c9e1bebb5

View File

@ -1,5 +1,6 @@
package ch.psi.daq.queryrest.controller; package ch.psi.daq.queryrest.controller;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -103,7 +104,8 @@ public class QueryRestController {
*/ */
@RequestMapping(value = DomainConfig.PATH_CHANNELS + "/{channelName}", method = {RequestMethod.GET}, @RequestMapping(value = DomainConfig.PATH_CHANNELS + "/{channelName}", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE}) produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody Collection<ChannelsResponse> getChannels(@PathVariable(value = "channelName") String channelName) public @ResponseBody Collection<ChannelsResponse> getChannels(
@PathVariable(value = "channelName") String channelName)
throws Throwable { throws Throwable {
return getChannels(new ChannelsRequest(channelName)); return getChannels(new ChannelsRequest(channelName));
} }
@ -229,7 +231,8 @@ public class QueryRestController {
* *
* @return list of {@link Ordering}s as String array * @return list of {@link Ordering}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/ordering", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/ordering", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<Ordering> getOrderingValues() { public @ResponseBody List<Ordering> getOrderingValues() {
return Lists.newArrayList(Ordering.values()); return Lists.newArrayList(Ordering.values());
} }
@ -275,7 +278,8 @@ public class QueryRestController {
* *
* @return list of {@link QueryField}s as String array * @return list of {@link QueryField}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/queryfields", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/queryfields", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<QueryField> getQueryFieldValues() { public @ResponseBody List<QueryField> getQueryFieldValues() {
return Arrays.stream(QueryField.values()) return Arrays.stream(QueryField.values())
.filter(queryField -> queryField.isPublish()) .filter(queryField -> queryField.isPublish())
@ -298,7 +302,8 @@ public class QueryRestController {
* *
* @return list of {@link Aggregation}s as String array * @return list of {@link Aggregation}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/aggregations", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/aggregations", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<Aggregation> getAggregationValues() { public @ResponseBody List<Aggregation> getAggregationValues() {
return Lists.newArrayList(Aggregation.values()); return Lists.newArrayList(Aggregation.values());
} }
@ -334,7 +339,7 @@ public class QueryRestController {
@Deprecated @Deprecated
@RequestMapping(value = "backends", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = "backends", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<Backend> getBackendValuesDeprecated() { public @ResponseBody List<Backend> getBackendValuesDeprecated() {
return Lists.newArrayList(Backend.values()); return getBackendValues();
} }
/** /**
@ -342,9 +347,13 @@ public class QueryRestController {
* *
* @return list of {@link Backend}s as String array * @return list of {@link Backend}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/backends", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/backends", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<Backend> getBackendValues() { public @ResponseBody List<Backend> getBackendValues() {
return Lists.newArrayList(Backend.values()); List<Backend> filtered = new ArrayList<>(Lists.newArrayList(Backend.values()));
filtered.remove(Backend.SF_DATABUFFER_OLD);
return filtered;
// return Lists.newArrayList(Backend.values());
} }
/** /**
@ -363,7 +372,8 @@ public class QueryRestController {
* *
* @return list of {@link Compression}s as String array * @return list of {@link Compression}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/compression", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/compression", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<Compression> getCompressionValues() { public @ResponseBody List<Compression> getCompressionValues() {
return Lists.newArrayList(Compression.values()); return Lists.newArrayList(Compression.values());
} }
@ -373,7 +383,8 @@ public class QueryRestController {
* *
* @return list of {@link ValueAggregation}s as String array * @return list of {@link ValueAggregation}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/valueaggregations", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/valueaggregations", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<ValueAggregation> getValueAggregations() { public @ResponseBody List<ValueAggregation> getValueAggregations() {
return Lists.newArrayList(ValueAggregation.values()); return Lists.newArrayList(ValueAggregation.values());
} }
@ -383,7 +394,8 @@ public class QueryRestController {
* *
* @return list of {@link ValueAggregation}s as String array * @return list of {@link ValueAggregation}s as String array
*/ */
@RequestMapping(value = PARAMETERS_ROOT_PATH + "/colormodeltypes", method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE}) @RequestMapping(value = PARAMETERS_ROOT_PATH + "/colormodeltypes", method = {RequestMethod.GET},
produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody List<ColorModelType> getColorModelTypes() { public @ResponseBody List<ColorModelType> getColorModelTypes() {
return Lists.newArrayList(ColorModelType.values()); return Lists.newArrayList(ColorModelType.values());
} }