package stroom.importexport.api;

import io.vavr.Tuple2;
import stroom.docref.DocRef;
import stroom.importexport.shared.ImportState;
import stroom.importexport.shared.ImportState.ImportMode;
import stroom.util.shared.Message;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface ImportExportActionHandler {
    class ImpexDetails {
        private String locationRef;
        private DocRef docRef;

        public ImpexDetails(){}

        public ImpexDetails(DocRef docRef){
            this.docRef = docRef;
        }

        public ImpexDetails(DocRef docRef, String locationRef){
            this.docRef = docRef;
            this.locationRef = locationRef;
        }

        public void setDocRef(DocRef docRef) {
            this.docRef = docRef;
        }

        public void setLocationRef(String locationRef) {
            this.locationRef = locationRef;
        }

        public String getLocationRef() {
            return locationRef;
        }

        public DocRef getDocRef() {
            return docRef;
        }
    }
    /**
     *
     * @param docRef
     * @param dataMap
     * @param importState
     * @param importMode
     * @return a tuple containing the imported DocRef and a String location where it is imported to
     */
    ImpexDetails importDocument(DocRef docRef, Map<String, byte[]> dataMap, final ImportState importState, final ImportMode importMode);

    Map<String, byte[]> exportDocument(DocRef docRef, boolean omitAuditFields, List<Message> messageList);

    Set<DocRef> listDocuments();

    Map<DocRef, Set<DocRef>> getDependencies();

    String getType();

    Set<DocRef> findAssociatedNonExplorerDocRefs(DocRef docRef);
}

@@ -333,16 +333,910 @@
 ndler %7B%0A
+    /**%0A     *%0A     * @param docRef%0A     * @param dataMap%0A     * @param importState%0A     * @param importMode%0A     * @return a tuple containing the imported DocRef and a String location where it is imported to%0A     */%0A    ImpexDetails importDocument(DocRef docRef, Map%3CString, byte%5B%5D%3E dataMap, final ImportState importState, final ImportMode importMode);%0A%0A    Map%3CString, byte%5B%5D%3E exportDocument(DocRef docRef, boolean omitAuditFields, List%3CMessage%3E messageList);%0A%0A    Set%3CDocRef%3E listDocuments();%0A%0A    Map%3CDocRef, Set%3CDocRef%3E%3E getDependencies();%0A%0A    String getType();%0A%0A    Set%3CDocRef%3E findAssociatedNonExplorerDocRefs(DocRef docRef);%0A%0A    ///////////////////////////////////////////////%0A    //End of ImportExportActionHandler interface //%0A    ///////////////////////////////////////////////%0A%0A%0A    /**%0A     * Class used to represent the result of operations of ImportExportActionHandler%0A     */%0A
     clas
@@ -1252,16 +1252,16 @@
 tails %7B%0A
-
         
@@ -1960,646 +1960,12 @@
   %7D%0A
+
     %7D%0A
-    /**%0A     *%0A     * @param docRef%0A     * @param dataMap%0A     * @param importState%0A     * @param importMode%0A     * @return a tuple containing the imported DocRef and a String location where it is imported to%0A     */%0A    ImpexDetails importDocument(DocRef docRef, Map%3CString, byte%5B%5D%3E dataMap, final ImportState importState, final ImportMode importMode);%0A%0A    Map%3CString, byte%5B%5D%3E exportDocument(DocRef docRef, boolean omitAuditFields, List%3CMessage%3E messageList);%0A%0A    Set%3CDocRef%3E listDocuments();%0A%0A    Map%3CDocRef, Set%3CDocRef%3E%3E getDependencies();%0A%0A    String getType();%0A%0A    Set%3CDocRef%3E findAssociatedNonExplorerDocRefs(DocRef docRef);%0A
 %7D%0A

Move inner class to improve legibility