Class DatabaseUpgradePaginatorImpl
java.lang.Object
com.atlassian.bamboo.upgrade.utils.impl.DatabaseUpgradePaginatorImpl
- All Implemented Interfaces:
DatabaseUpgradePaginator
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.upgrade.utils.DatabaseUpgradePaginator
DatabaseUpgradePaginator.PaginatedDataSupplier<T> -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseUpgradePaginatorImpl(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate) -
Method Summary
Modifier and TypeMethodDescription<T> voidforEach(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull Consumer<T> consumer) Executes the givenconsumerfor each element of an underlying large collection of elements.<T> voidforEach(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull Consumer<T> consumer) Executes the givenconsumerfor each element of an underlying large collection of elements.<T> voidforEachPage(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull Consumer<Collection<T>> elementConsumer) Executes the givenconsumerfor each page of an underlying large collection of elements.<T> voidforEachPage(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull Consumer<Collection<T>> elementConsumer) Executes the givenconsumeron each page of an underlying large collection of elements.
-
Constructor Details
-
DatabaseUpgradePaginatorImpl
@Autowired public DatabaseUpgradePaginatorImpl(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
-
-
Method Details
-
forEachPage
public <T> void forEachPage(@NotNull @NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull @NotNull Consumer<Collection<T>> elementConsumer) Description copied from interface:DatabaseUpgradePaginatorExecutes the givenconsumeron each page of an underlying large collection of elements. The elements are fetched using thedataSupplierpage by page, with defaultpageSize.- Specified by:
forEachPagein interfaceDatabaseUpgradePaginator- Type Parameters:
T- type of elements iterated over- Parameters:
dataSupplier- a supplier for fetching paginated data from the actual data sourceelementConsumer- action to perform for each page; every call will be wrapped in a separate transaction
-
forEachPage
public <T> void forEachPage(@NotNull @NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull @NotNull Consumer<Collection<T>> elementConsumer) Description copied from interface:DatabaseUpgradePaginatorExecutes the givenconsumerfor each page of an underlying large collection of elements. The elements are fetched using thedataSupplierpage by page, with specifiedpageSize.- Specified by:
forEachPagein interfaceDatabaseUpgradePaginator- Type Parameters:
T- type of elements iterated over- Parameters:
dataSupplier- a supplier for fetching paginated data from the actual data sourcepageSize- size of each fetched pageelementConsumer- action to perform for each page; every call will be wrapped in a separate transaction
-
forEach
public <T> void forEach(@NotNull @NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull @NotNull Consumer<T> consumer) Description copied from interface:DatabaseUpgradePaginatorExecutes the givenconsumerfor each element of an underlying large collection of elements. The elements are fetched using thedataSupplierpage by page, with defaultpageSize.- Specified by:
forEachin interfaceDatabaseUpgradePaginator- Type Parameters:
T- type of elements iterated over- Parameters:
dataSupplier- a supplier for fetching paginated data from the actual data sourceconsumer- action to perform for each element; executed in transactions, one transaction per page
-
forEach
public <T> void forEach(@NotNull @NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull @NotNull Consumer<T> consumer) Description copied from interface:DatabaseUpgradePaginatorExecutes the givenconsumerfor each element of an underlying large collection of elements. The elements are fetched using thedataSupplierpage by page, with specifiedpageSize.- Specified by:
forEachin interfaceDatabaseUpgradePaginator- Type Parameters:
T- type of elements iterated over- Parameters:
dataSupplier- a supplier for fetching paginated data from the actual data sourcepageSize- size of each fetched pageconsumer- action to perform for each element; executed in transactions, one transaction per page
-