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));
} }
@ -223,13 +225,14 @@ public class QueryRestController {
public @ResponseBody List<Ordering> getOrderingValuesDeprecated() { public @ResponseBody List<Ordering> getOrderingValuesDeprecated() {
return Lists.newArrayList(Ordering.values()); return Lists.newArrayList(Ordering.values());
} }
/** /**
* Returns the current list of {@link Ordering}s available. * Returns the current list of {@link Ordering}s available.
* *
* @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());
} }
@ -245,7 +248,7 @@ public class QueryRestController {
public @ResponseBody List<ResponseFormat> getResponseFormatValuesDeprecated() { public @ResponseBody List<ResponseFormat> getResponseFormatValuesDeprecated() {
return Lists.newArrayList(ResponseFormat.values()); return Lists.newArrayList(ResponseFormat.values());
} }
/** /**
* Returns the current list of {@link ResponseFormat}s available. * Returns the current list of {@link ResponseFormat}s available.
* *
@ -269,13 +272,14 @@ public class QueryRestController {
.filter(queryField -> queryField.isPublish()) .filter(queryField -> queryField.isPublish())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
/** /**
* Returns the current list of {@link QueryField}s available. * Returns the current list of {@link QueryField}s available.
* *
* @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())
@ -292,13 +296,14 @@ public class QueryRestController {
public @ResponseBody List<Aggregation> getAggregationValuesDeprecated() { public @ResponseBody List<Aggregation> getAggregationValuesDeprecated() {
return Lists.newArrayList(Aggregation.values()); return Lists.newArrayList(Aggregation.values());
} }
/** /**
* Returns the current list of {@link Aggregation}s available. * Returns the current list of {@link Aggregation}s available.
* *
* @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());
} }
@ -314,7 +319,7 @@ public class QueryRestController {
public @ResponseBody List<AggregationType> getAggregationTypeValuesDeprecated() { public @ResponseBody List<AggregationType> getAggregationTypeValuesDeprecated() {
return Lists.newArrayList(AggregationType.values()); return Lists.newArrayList(AggregationType.values());
} }
/** /**
* Returns the current list of {@link AggregationType}s available. * Returns the current list of {@link AggregationType}s available.
* *
@ -334,17 +339,21 @@ 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();
} }
/** /**
* Returns the current list of {@link Backend} values. * Returns the current list of {@link Backend} values.
* *
* @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());
} }
/** /**
@ -357,33 +366,36 @@ public class QueryRestController {
public @ResponseBody List<Compression> getCompressionValuesDeprecated() { public @ResponseBody List<Compression> getCompressionValuesDeprecated() {
return Lists.newArrayList(Compression.values()); return Lists.newArrayList(Compression.values());
} }
/** /**
* Returns the current list of {@link Compression}s available. * Returns the current list of {@link Compression}s available.
* *
* @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());
} }
/** /**
* Returns the current list of {@link ValueAggregation}s available. * Returns the current list of {@link ValueAggregation}s available.
* *
* @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());
} }
/** /**
* Returns the current list of {@link ValueAggregation}s available. * Returns the current list of {@link ValueAggregation}s available.
* *
* @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());
} }