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 AnyObjectDAOanyObjectDAOprotected static char[]ELASTICSEARCH_REGEX_CHARSprotected GroupDAOgroupDAOprotected UserDAOuserDAO
-
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 voidcustomizeDocument(Map<String,Object> builder, long instant, JsonNode message, String domain)protected voidcustomizeDocument(Map<String,Object> builder, AnyObject anyObject)protected voidcustomizeDocument(Map<String,Object> builder, Group group)protected voidcustomizeDocument(Map<String,Object> builder, Realm realm)protected voidcustomizeDocument(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 StringescapeForLikeRegex(char c)static StringgetAnyIndex(String domain, AnyTypeKind kind)static StringgetAuditIndex(String domain)static StringgetRealmIndex(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
-
-