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
ConstructorDescriptionDatabaseUpgradePaginatorImpl
(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate) -
Method Summary
Modifier and TypeMethodDescription<T> void
forEach
(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull Consumer<T> consumer) Executes the givenconsumer
for each element of an underlying large collection of elements.<T> void
forEach
(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull Consumer<T> consumer) Executes the givenconsumer
for each element of an underlying large collection of elements.<T> void
forEachPage
(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull Consumer<Collection<T>> elementConsumer) Executes the givenconsumer
for each page of an underlying large collection of elements.<T> void
forEachPage
(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull Consumer<Collection<T>> elementConsumer) Executes the givenconsumer
on 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:DatabaseUpgradePaginator
Executes the givenconsumer
on each page of an underlying large collection of elements. The elements are fetched using thedataSupplier
page by page, with defaultpageSize
.- Specified by:
forEachPage
in 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:DatabaseUpgradePaginator
Executes the givenconsumer
for each page of an underlying large collection of elements. The elements are fetched using thedataSupplier
page by page, with specifiedpageSize
.- Specified by:
forEachPage
in 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:DatabaseUpgradePaginator
Executes the givenconsumer
for each element of an underlying large collection of elements. The elements are fetched using thedataSupplier
page by page, with defaultpageSize
.- Specified by:
forEach
in 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:DatabaseUpgradePaginator
Executes the givenconsumer
for each element of an underlying large collection of elements. The elements are fetched using thedataSupplier
page by page, with specifiedpageSize
.- Specified by:
forEach
in 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
-