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