Class AzureAdPagingWrapper
java.lang.Object
com.atlassian.crowd.directory.rest.AzureAdPagingWrapper
Wrapper class to facilitate paging results from Microsoft Graph
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<V extends PageableDeltaQueryGraphList<T>,
T>
GraphDeltaQueryResult<T>fetchAllDeltaQueryResults
(V firstPage) <V extends PageableGraphList<T>,
T>
List<T>fetchAllMatchingResults
(V firstPage, Predicate<T> filter) Will fetch all results from Microsoft Graph that match the specified predicate<V extends PageableGraphList<T>,
T>
List<T>fetchAllResults
(V firstPage) Will fetch all results from Microsoft Graph<V extends PageableGraphList<T>,
T>
List<T>fetchAppropriateAmountOfResults
(V firstPage, int startIndex, int maxResults) Will fetch results from Microsoft Graph until the desired amount of results is reached or until the results are exhausted<V extends PageableGraphList<T>,
T>
Optional<T>pageForElement
(V firstPage, Predicate<T> predicate) Retrieves the first element matching the specified predicate, if any, paging for it if necessary
-
Constructor Details
-
AzureAdPagingWrapper
-
-
Method Details
-
fetchAppropriateAmountOfResults
public <V extends PageableGraphList<T>,T> List<T> fetchAppropriateAmountOfResults(V firstPage, int startIndex, int maxResults) throws OperationFailedException Will fetch results from Microsoft Graph until the desired amount of results is reached or until the results are exhausted- Type Parameters:
V
- Class representing a page of resultsT
- Class representing the entries contained in a page- Parameters:
firstPage
- The first page of the resultsmaxResults
- the amount of results that should be fetched in the same format as used byEntityQuery
- Returns:
- list of search result entries of size up to maxResults
- Throws:
OperationFailedException
-
fetchAllMatchingResults
public <V extends PageableGraphList<T>,T> List<T> fetchAllMatchingResults(V firstPage, Predicate<T> filter) throws OperationFailedException Will fetch all results from Microsoft Graph that match the specified predicate- Type Parameters:
V
- Class representing a page of resultsT
- Class representing the entries contained in a page- Parameters:
firstPage
- The first page of the resultsfilter
- the filter that results should match- Returns:
- list of search result entries matching the specified predicate
- Throws:
OperationFailedException
-
fetchAllResults
public <V extends PageableGraphList<T>,T> List<T> fetchAllResults(V firstPage) throws OperationFailedException Will fetch all results from Microsoft Graph- Type Parameters:
V
- Class representing a page of resultsT
- Class representing the entries contained in a page- Parameters:
firstPage
- The first page of the results- Returns:
- list of search result entries matching the specified predicate
- Throws:
OperationFailedException
-
pageForElement
public <V extends PageableGraphList<T>,T> Optional<T> pageForElement(V firstPage, Predicate<T> predicate) throws OperationFailedException Retrieves the first element matching the specified predicate, if any, paging for it if necessary- Type Parameters:
V
- Class representing a page of resultsT
- Class representing the entries contained in a page- Parameters:
firstPage
- The first page of the resultspredicate
- The predicate against which search items will be matched- Returns:
- an Optional containing the matching element if found
- Throws:
OperationFailedException
-
fetchAllDeltaQueryResults
public <V extends PageableDeltaQueryGraphList<T>,T> GraphDeltaQueryResult<T> fetchAllDeltaQueryResults(V firstPage) throws OperationFailedException - Throws:
OperationFailedException
-