package com.avg.zaap.crashlibrary.offline.uploader;

import android.content.Context;

import com.avg.zaap.crashlibrary.ICrashPublishingDelegate;
import com.avg.zaap.crashlibrary.offline.publisher.metadata.ICrashMetadataReader;

import java.io.File;
import java.io.FilenameFilter;

/**
 * This interface denotes the common behavior for the offline uploader dependency factory.
 * <p/>
 * Created by marek.osvald on 27.7.2016.
 */
public interface IOfflineUploaderFactory {

    /**
     * Returns an instance of thread for given runnable.
     *
     * @param runnable runnable to initialize the thread with
     * @return an instance of thread for given runnable
     */
    Thread getThread(Runnable runnable);

    /**
     * Returns a file instance for given directory and file name.
     *
     * @param directory parent directory
     * @param fileName  file name
     * @return a file instance for given directory and file name
     */
    File openFile(File directory, String fileName);

    /**
     * Returns offline report filename filter.
     *
     * @return offline report filename filter
     */
    FilenameFilter getCrashReportFilenameFilter();

    /**
     * Returns an instance of crash publishing delegate.
     *
     * @param context Android context instance
     * @return an instance of crash publishing delegate
     */
    ICrashPublishingDelegate getCrashPublishingDelegate(Context context);

    /**
     * Returns an instance of crash metadata reader.
     *
     * @return instance of crash metadata reader
     */
    ICrashMetadataReader getCrashMetadataReader();

    /**
     * Returns an instance of delay helper.
     *
     * @return an instance of delay helper
     */
    IDelayHelper getDelayHelper();

}
