Class MicrosoftGraphQueryTranslator
java.lang.Object
com.atlassian.crowd.directory.query.MicrosoftGraphQueryTranslator
Translates Crowd queries into filters used by Microsoft Graph.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final ODataSelect
static final String
static final String
static final ODataSelect
static final ODataSelect
static final String
static final String
static final String
static final ODataExpand
static final ODataSelect
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvert
(EntityQuery query, String usernameAttribute) Converts a Crowd EntityQuery to a GraphQuery that should be used to fetch the first page of results.resolveAzureAdColumnsForSingleEntityTypeQuery
(EntityDescriptor entity, FetchMode fetchMode) resolveAzureAdColumnsForSingleEntityTypeQuery
(EntityDescriptor entity, Class<?> returnType) resolveAzureAdNavigationPropertiesForSingleEntityTypeQuery
(EntityDescriptor entity, FetchMode fetchMode) translateColumnsForUsersAndGroupsQuery
(FetchMode fetchMode) translateSearchRestriction
(EntityDescriptor entityDescriptor, SearchRestriction restriction, String usernameAttribute) Converts a search restriction to an ODataFilter, which can be used in a graph query
-
Field Details
-
USERNAME
- See Also:
-
FIRST_NAME
- See Also:
-
LAST_NAME
- See Also:
-
DISPLAY_NAME
- See Also:
-
MAIL
- See Also:
-
ID
- See Also:
-
ACCOUNT_ENABLED
- See Also:
-
USER_SELECT
-
MEMBERS_EXPAND
-
GROUPNAME_SELECT
-
GROUP_SELECT
-
DELTA_QUERY_GROUP_SELECT
-
-
Constructor Details
-
MicrosoftGraphQueryTranslator
public MicrosoftGraphQueryTranslator()
-
-
Method Details
-
convert
Converts a Crowd EntityQuery to a GraphQuery that should be used to fetch the first page of results. This will map the search restrictions, the columns to fetch, the start index and the amount of results to fetch- Parameters:
query
- the Crowd query to convertusernameAttribute
- name of the attribute that username restriction should be matched to- Returns:
- a GraphQuery for fetching the first page of results
-
resolveAzureAdColumnsForSingleEntityTypeQuery
public ODataSelect resolveAzureAdColumnsForSingleEntityTypeQuery(EntityDescriptor entity, Class<?> returnType) - Parameters:
entity
- the entity for which we're queryingreturnType
- the return type of the Crowd query- Returns:
- an ODataSelect with the columns appropriate for the given entity and return type
-
translateSearchRestriction
public ODataFilter translateSearchRestriction(EntityDescriptor entityDescriptor, SearchRestriction restriction, String usernameAttribute) Converts a search restriction to an ODataFilter, which can be used in a graph query- Parameters:
entityDescriptor
- the entityDescriptor of the entity that will be queried forrestriction
- the restriction to translateusernameAttribute
- name of the attribute that username restriction should be matched to- Returns:
- the translated filter
-
resolveAzureAdColumnsForSingleEntityTypeQuery
public ODataSelect resolveAzureAdColumnsForSingleEntityTypeQuery(EntityDescriptor entity, FetchMode fetchMode) - Parameters:
entity
- the entity for which we're queryingfetchMode
- the types of columns that should be fetched- Returns:
- an ODataSelect with the columns appropriate for the given entity and fetch mode
-
translateColumnsForUsersAndGroupsQuery
- Parameters:
fetchMode
- the types of columns that should be fetched- Returns:
- an ODataSelect with the columns appropriate for a query that will fetch both users and groups and the specified fetch mode
-