public final class QueryHelper extends Object
Query
Modifier and Type | Class and Description |
---|---|
private static class |
QueryHelper.ObjectToReturn |
static class |
QueryHelper.Visibility
The user and its groups for checking visibility
|
Modifier | Constructor and Description |
---|---|
private |
QueryHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
_appendGroupAccessCondition(StringBuilder query,
String groupId,
String groupDirectory,
String accessNodeName) |
private static void |
_appendGroupsCondition(StringBuilder query,
Set<GroupIdentity> groups,
boolean readAccess) |
private static void |
_appendPrivatePredicate(StringBuilder query,
String login,
String populationId) |
private static void |
_appendPublicPredicate(StringBuilder query) |
private static void |
_appendSharedPredicate(StringBuilder query,
String login,
String populationId,
Set<GroupIdentity> groups,
boolean readAccess) |
private static void |
_appendUserAccessCondition(StringBuilder query,
String login,
String populationId,
String accessNodeName) |
private static void |
_appendUserCondition(StringBuilder query,
String login,
String populationId) |
private static StringBuilder |
_getParentPath(QueryContainer queryContainer) |
private static String |
_getXPathQuery(QueryContainer queryContainer,
boolean onlyDirectChildren,
QueryHelper.ObjectToReturn objectToReturn,
Optional<QueryHelper.Visibility> visibility,
Optional<String> type,
Boolean readAccess) |
(package private) static String |
getXPathForQueriesForAdministrator(QueryContainer queryContainer,
boolean onlyDirectChildren,
Optional<String> type)
Creates the XPath query to get all queries for administrator
|
(package private) static String |
getXPathForQueriesInReadAccess(QueryContainer queryContainer,
boolean onlyDirectChildren,
QueryHelper.Visibility visibility,
Optional<String> type)
Creates the XPath query to get all queries in READ access
|
(package private) static String |
getXPathForQueriesInWriteAccess(QueryContainer queryContainer,
boolean onlyDirectChildren,
QueryHelper.Visibility visibility,
Optional<String> type)
Creates the XPath query to get all queries in WRITE access
|
(package private) static String |
getXPathForQueryContainers(QueryContainer queryContainer)
Creates the XPath query to get all query containers
|
private QueryHelper()
static String getXPathForQueryContainers(QueryContainer queryContainer)
queryContainer
- The QueryContainer
, defining the context from which getting childrenstatic String getXPathForQueriesForAdministrator(QueryContainer queryContainer, boolean onlyDirectChildren, Optional<String> type)
queryContainer
- The QueryContainer
, defining the context from which getting childrenonlyDirectChildren
- true
in order to have only direct child queries from parent path, false
otherwise to have all queries at any level underneath the parent pathtype
- The query typestatic String getXPathForQueriesInReadAccess(QueryContainer queryContainer, boolean onlyDirectChildren, QueryHelper.Visibility visibility, Optional<String> type)
queryContainer
- The QueryContainer
, defining the context from which getting childrenonlyDirectChildren
- true
in order to have only direct child queries from parent path, false
otherwise to have all queries at any level underneath the parent pathvisibility
- The user and its groups for checking visibilitytype
- The query typestatic String getXPathForQueriesInWriteAccess(QueryContainer queryContainer, boolean onlyDirectChildren, QueryHelper.Visibility visibility, Optional<String> type)
queryContainer
- The QueryContainer
, defining the context from which getting childrenonlyDirectChildren
- true
in order to have only direct child queries from parent path, false
otherwise to have all queries at any level underneath the parent pathvisibility
- The user and its groups for checking visibilitytype
- The query typeprivate static StringBuilder _getParentPath(QueryContainer queryContainer)
private static String _getXPathQuery(QueryContainer queryContainer, boolean onlyDirectChildren, QueryHelper.ObjectToReturn objectToReturn, Optional<QueryHelper.Visibility> visibility, Optional<String> type, Boolean readAccess)
private static void _appendPublicPredicate(StringBuilder query)
private static void _appendPrivatePredicate(StringBuilder query, String login, String populationId)
private static void _appendSharedPredicate(StringBuilder query, String login, String populationId, Set<GroupIdentity> groups, boolean readAccess)
private static void _appendUserCondition(StringBuilder query, String login, String populationId)
private static void _appendGroupsCondition(StringBuilder query, Set<GroupIdentity> groups, boolean readAccess)
private static void _appendUserAccessCondition(StringBuilder query, String login, String populationId, String accessNodeName)
private static void _appendGroupAccessCondition(StringBuilder query, String groupId, String groupDirectory, String accessNodeName)