Minor Refactoring
This commit is contained in:
parent
6b6d63c128
commit
1f2084578d
|
@ -17,7 +17,7 @@ import java.io.IOException;
|
|||
*/
|
||||
public abstract class ElasticRepository<T extends ElasticEntity,C extends Criteria> implements Repository<T,C> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ElasticRepository.class);
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
private final ObjectMapper mapper;
|
||||
private RestHighLevelClient client;
|
||||
|
||||
public RestHighLevelClient getClient() {
|
||||
|
@ -33,6 +33,7 @@ public abstract class ElasticRepository<T extends ElasticEntity,C extends Criter
|
|||
logger.warn("Unable to connect to Elastic Services");
|
||||
this.client = null;
|
||||
}
|
||||
this.mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
public <T> T transformFromString(String value, Class<T> tClass) {
|
||||
|
|
|
@ -168,7 +168,7 @@ public class DatasetManager {
|
|||
datasets = null;
|
||||
}
|
||||
|
||||
UserInfo userInfo = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());//builderFactory.getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||
|
||||
// QueryableList<eu.eudat.data.entities.Dataset> items = databaseRepository.getDatasetDao().getWithCriteria(datasetTableRequest.getCriteria()).withHint(HintedModelFactory.getHint(DatasetListingModel.class));
|
||||
QueryableList<eu.eudat.data.entities.Dataset> items;
|
||||
if (datasets != null && !datasets.isEmpty()) {
|
||||
|
@ -186,6 +186,7 @@ public class DatasetManager {
|
|||
if (principal.getId() == null) {
|
||||
throw new UnauthorisedException("You are not allowed to access those datasets");
|
||||
}
|
||||
UserInfo userInfo = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());//builderFactory.getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||
if (datasetTableRequest.getCriteria().getRole() != null) {
|
||||
roles.add(datasetTableRequest.getCriteria().getRole());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue