/** * @author ishaikh * */ package com.transformuk.bdt.controller; import java.util.List; import org.apache.log4j.Logger; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.transformuk.bdt.domain.Bfsf; import com.transformuk.bdt.service.BfsfServiceImpl; @RestController @RequestMapping("/bfsf") public class BfsfController { @Autowired BfsfServiceImpl bfsfService; private static final Logger logger = Logger.getLogger(BfsfController.class); @RequestMapping(value = "/all", produces = "application/json; charset=utf-8") @ResponseBody public List<Bfsf> fetchAllBfsf() throws Exception { QueryBuilder qb = QueryBuilders.matchAllQuery(); if(logger.isDebugEnabled()){ logger.debug("fetching bfsf by query: "+qb.toString()); } return bfsfService.searchBfsfByQueryBuilder(qb); } }