[TE] add the endpoint for dataset auto-complete
This PR adds the endpoint for the dataset auto-complete.
@@ -249,6 +249,21 @@ public class DataResource {
return result;
}
+ /**
+ * Gets datasets where name like.
+ *
+ * @param name the name
+ * @return the dataset where name like
+ */
+ @GET
+ @Path("autocomplete/dataset")
+ public List<DatasetConfigDTO> getDatasetsWhereNameLike(@QueryParam("name") String name) {
+ List<DatasetConfigDTO> result = this.datasetConfigDAO.findByPredicate(Predicate.LIKE("dataset", "%" + name.trim() + "%"));
+ result.sort(Comparator.comparing(DatasetConfigDTO::getDataset));
+ return result;
+ }
+
+
/**
* Gets detection config creators where name like.
*
