public abstract class ESGenericIdDAO extends Object implements IGenericIdDAO
Constructor and Description |
---|
ESGenericIdDAO() |
Modifier and Type | Method and Description |
---|---|
void |
addToIndicesMap(String type,
String index) |
void |
delete(String typeName,
String id)
Delete an instance from the given class.
|
void |
deleteIndex(String indexName) |
<T> T |
findById(String typeName,
String id,
Class<T> clazz)
Find an instance from the given class.
|
<T> List<T> |
findByIds(String typeName,
Class<T> clazz,
String... ids)
Find instances by id
|
org.elasticsearch.client.Client |
getClient() |
ElasticSearchClient |
getEsClient() |
String |
getIndexForType(String type) |
com.fasterxml.jackson.databind.ObjectMapper |
getJsonMapper() |
static String |
indexTypeFromClass(Class<?> clazz) |
protected void |
saveResourceData(String typeName,
Object data,
String id) |
void |
setJsonMapper(com.fasterxml.jackson.databind.ObjectMapper jsonMapper) |
public org.elasticsearch.client.Client getClient()
public ElasticSearchClient getEsClient()
public com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
public void setJsonMapper(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
public <T> T findById(String typeName, String id, Class<T> clazz)
IGenericIdDAO
findById
in interface IGenericIdDAO
id
- The id of the object.clazz
- The class of the object to find.public <T> List<T> findByIds(String typeName, Class<T> clazz, String... ids)
IGenericIdDAO
findByIds
in interface IGenericIdDAO
clazz
- The class for which to find an instance.ids
- array of id of the data to find.protected void saveResourceData(String typeName, Object data, String id) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
public void delete(String typeName, String id)
IGenericIdDAO
delete
in interface IGenericIdDAO
id
- The id of the object to delete.public void deleteIndex(String indexName)
Copyright © 2017. All rights reserved.