package com.avg.zaap.crashlibrary.publish.cap;

import java.util.Map;

/**
 * This interface denotes the common behavior for the CAP exception header generator.
 * <p>
 * Created by marek.osvald on 10.6.2016.
 */
public interface IExceptionHeaderGenerator {

    String HEADER_KEY_EXCEPTION_CODE = "EXC";
    String HEADER_KEY_EXCEPTION_FAULTING_OFFSET = "FSO";
    String HEADER_KEY_CRASHING_MODULE_NAME = "MDN";
    String HEADER_KEY_CRASHING_MODULE_VERSION = "MDV";
    String HEADER_KEY_CRASHING_PROCESS_NAME = "PFN";
    String HEADER_KEY_CRASHING_PROCESS_VERSION = "PFV";
    String HEADER_KEY_BUCKET_ID = "BCK";
//    String HEADER_KEY_OS_VERSION = "OSV";

    /**
     * Generates the CAP exception header.
     *
     * @param code           exception code
     * @param faultingOffset faulting offset in crashing module
     * @param moduleName     crashing module name
     * @param moduleVersion  crashing module version
     * @param processName    crashing process name
     * @param processVersion crashing process version
     * @param bucketID       bucket ID
     * @return CAP exception header
     */
    Map<String, String> generateHeader(String code,
                                       String faultingOffset,
                                       String moduleName,
                                       String moduleVersion,
                                       String processName,
                                       String processVersion,
                                       String bucketID);

}
