package com.workfusion.odf.impl.processor.extractor;

import java.util.function.Predicate;
import javax.inject.Inject;

import org.slf4j.Logger;

import com.workfusion.odf.api.domain.Document;
import com.workfusion.odf.impl.converter.extractor.AbstractRecursiveExtractor;
import com.workfusion.odf.impl.converter.extractor.mail.RecursiveMsgExtractor;
import com.workfusion.odf.processor.TransactionProcessor;
import com.workfusion.rpa.core.storage.S3Manager;

public class MsgFlatMapProcessor extends AbstractFlatMapper implements TransactionProcessor {
    private final static String S3_FOLDER = "msg_flatMap";

    @Inject
    public MsgFlatMapProcessor(S3Manager s3Manager, Logger logger) {
        super(s3Manager, logger);
    }

    @Override
    protected Predicate<Document> getDocumentFilter() {
        return Document::isMsgDocument;
    }

    @Override
    protected AbstractRecursiveExtractor getRecursiveExtractor(){
        return new RecursiveMsgExtractor(logger);
    }

    @Override
    protected String getS3Folder(){
        return S3_FOLDER;
    }

}
