Class ElasticsearchUtils
- java.lang.Object
-
- org.apache.syncope.ext.elasticsearch.client.ElasticsearchUtils
-
public class ElasticsearchUtils extends Object
Utility methods for usage with Elasticsearch.
-
-
Field Summary
Fields Modifier and Type Field Description protected AnyObjectDAO
anyObjectDAO
protected static char[]
ELASTICSEARCH_REGEX_CHARS
protected GroupDAO
groupDAO
protected UserDAO
userDAO
-
Constructor Summary
Constructors Constructor Description ElasticsearchUtils(UserDAO userDAO, GroupDAO groupDAO, AnyObjectDAO anyObjectDAO)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
customizeDocument(Map<String,Object> builder, long instant, JsonNode message, String domain)
protected void
customizeDocument(Map<String,Object> builder, AnyObject anyObject)
protected void
customizeDocument(Map<String,Object> builder, Group group)
protected void
customizeDocument(Map<String,Object> builder, Realm realm)
protected void
customizeDocument(Map<String,Object> builder, User user)
Map<String,Object>
document(long instant, JsonNode message, String domain)
Map<String,Object>
document(Any<?> any)
Returns the document specialized with content from the provided any.Map<String,Object>
document(Realm realm)
static String
escapeForLikeRegex(char c)
static String
getAnyIndex(String domain, AnyTypeKind kind)
static String
getAuditIndex(String domain)
static String
getRealmIndex(String domain)
-
-
-
Field Detail
-
ELASTICSEARCH_REGEX_CHARS
protected static final char[] ELASTICSEARCH_REGEX_CHARS
-
userDAO
protected final UserDAO userDAO
-
groupDAO
protected final GroupDAO groupDAO
-
anyObjectDAO
protected final AnyObjectDAO anyObjectDAO
-
-
Constructor Detail
-
ElasticsearchUtils
public ElasticsearchUtils(UserDAO userDAO, GroupDAO groupDAO, AnyObjectDAO anyObjectDAO)
-
-
Method Detail
-
getAnyIndex
public static String getAnyIndex(String domain, AnyTypeKind kind)
-
escapeForLikeRegex
public static String escapeForLikeRegex(char c)
-
document
@Transactional public Map<String,Object> document(Any<?> any)
Returns the document specialized with content from the provided any.- Parameters:
any
- user, group or any object to index- Returns:
- document specialized with content from the provided any
-
customizeDocument
protected void customizeDocument(Map<String,Object> builder, AnyObject anyObject)
-
document
public Map<String,Object> document(long instant, JsonNode message, String domain) throws IOException
- Throws:
IOException
-
customizeDocument
protected void customizeDocument(Map<String,Object> builder, long instant, JsonNode message, String domain) throws IOException
- Throws:
IOException
-
-