package com.avg.zaap.crashlibrary.publish;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.avg.zaap.crashlibrary.ReportData;

/**
 * This interface is used as the callback between
 * {@link com.avg.zaap.crashlibrary.CrashReportingService} and crash publishers.
 * <p/>
 * Created by marek.osvald on 30.6.2016.
 */
public interface ICrashPublisherCallback {

    /**
     * This method is called whenever a publishing finishes successfully.
     *
     * @param id         crash publisher identifier
     * @param reportData crash report metadata structure
     */
    void onCrashPublisherSuccess(@NonNull String id, @NonNull ReportData reportData);

    /**
     * This method is called whenever a publishing fails for some reason.
     *
     * @param id         crash publisher identifier
     * @param reportData crash report metadata structure
     * @param cause      cause of the failure
     */
    void onCrashPublisherFailure(@NonNull String id, @NonNull ReportData reportData, @Nullable Throwable cause);

}
