package com.atlassian.stash.internal.maintenance;

import javax.annotation.Nonnull;

/**
 * Callback invoked when a maintenance task completes, whether it is {@link #onCancellation() canceled},
 * {@link #onSuccess() succeeds} or {@link #onFailure(Throwable) fails}.
 */
public interface MaintenanceCompletionCallback {

    /**
     * Indicates the maintenance task was canceled.
     */
    void onCancellation();

    /**
     * Indicates the maintenance task failed for some reason.
     *
     * @param t the exception associated with the failure
     */
    void onFailure(@Nonnull Throwable t);

    /**
     * Indicated the maintenance task successfully completed
     */
    void onSuccess();
}
