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

import java.util.HashMap;
import java.util.Map;

/**
 * This class serves as te default CAP exception header generator.
 * <p/>
 * Created by marek.osvald on 10.6.2016.
 */
public class ExceptionHeaderGenerator implements IExceptionHeaderGenerator {

    @Override
    public Map<String, String> generateHeader(String code,
                                              String faultingOffset,
                                              String moduleName,
                                              String moduleVersion,
                                              String processName,
                                              String processVersion,
                                              String bucketID) {
        Map<String, String> exceptionHeader = new HashMap<>();

        exceptionHeader.put(HEADER_KEY_EXCEPTION_CODE, code);
        exceptionHeader.put(HEADER_KEY_EXCEPTION_FAULTING_OFFSET, faultingOffset);
        exceptionHeader.put(HEADER_KEY_CRASHING_MODULE_NAME, moduleName);
        exceptionHeader.put(HEADER_KEY_CRASHING_MODULE_VERSION, moduleVersion);
        exceptionHeader.put(HEADER_KEY_CRASHING_PROCESS_NAME, processName);
        exceptionHeader.put(HEADER_KEY_CRASHING_PROCESS_VERSION, processVersion);
        exceptionHeader.put(HEADER_KEY_BUCKET_ID, bucketID);
//        exceptionHeader.put(HEADER_KEY_OS_VERSION, Build.VERSION.RELEASE);

        return exceptionHeader;
    }

}
