public class CleanupUnresolvedReferenceCustomObjects
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CleanupUnresolvedReferenceCustomObjects.Statistics |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<CleanupUnresolvedReferenceCustomObjects.Statistics> |
cleanup(int deleteDaysAfterLastModification)
Deletes the unresolved reference custom objects persisted by commercetools-sync-java library to
handle reference resolution.
|
CleanupUnresolvedReferenceCustomObjects |
errorCallback(java.util.function.Consumer<java.lang.Throwable> errorCallback)
Sets the
errorCallback function of the cleanup. |
static CleanupUnresolvedReferenceCustomObjects |
of(io.sphere.sdk.client.SphereClient sphereClient)
Creates new instance of
CleanupUnresolvedReferenceCustomObjects which has the
functionality to run cleanup helpers. |
CleanupUnresolvedReferenceCustomObjects |
pageSize(int pageSize)
Configures the pageSize (limit), the maximum number of results to return from the grapqhl
query, which can be set using the limit query parameter.
|
public static CleanupUnresolvedReferenceCustomObjects of(@Nonnull io.sphere.sdk.client.SphereClient sphereClient)
CleanupUnresolvedReferenceCustomObjects
which has the
functionality to run cleanup helpers.sphereClient
- the client object.CleanupUnresolvedReferenceCustomObjects
public CleanupUnresolvedReferenceCustomObjects errorCallback(@Nonnull java.util.function.Consumer<java.lang.Throwable> errorCallback)
errorCallback
function of the cleanup. This callback will be called whenever
an event occurs that leads to an error alert from the cleanup process.errorCallback
- the new value to set to the error callback.this
instance of BaseSyncOptionsBuilder
public CleanupUnresolvedReferenceCustomObjects pageSize(int pageSize)
NOTE: Changing this value might negatively impact the performance of the cleanup and must be tested properly.
pageSize
- int that indicates batch size of resources to process.this
instance of BaseSyncOptionsBuilder
public java.util.concurrent.CompletableFuture<CleanupUnresolvedReferenceCustomObjects.Statistics> cleanup(int deleteDaysAfterLastModification)
deleteDaysAfterLastModification
.
Note: Keeping the unresolved references forever can negatively influence the performance of your project, so deleting unused data ensures the best performance for your project.
deleteDaysAfterLastModification
- Days to query. The custom objects will be deleted if it
hasn't been modified for the specified amount of days.CompletableFuture
<CleanupUnresolvedReferenceCustomObjects.Statistics
> which contains the processing
time, the total number of custom objects that were deleted and failed to delete, and a
proper summary message of the statistics.