package org.texttechnologylab.project.gruppe_05_1.database;


import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;

public interface SpeechIndexFactory {
    /**
     * Set the parseLegislativePeriods flag.
     * @param parseLegislativePeriods that indicates whether the legislative periods should be parsed which takes a lot longer
     * @return the SpeechIndexFactory instance
     */
    SpeechIndexFactory parseLegislativePeriods(Boolean parseLegislativePeriods);

    /**
     * Creates a new SpeechIndexFactory instance.
     * @return a new SpeechIndexFactory instance
     * @throws ParserConfigurationException if the parser configuration is invalid
     */
    SpeechIndexFactory builder() throws ParserConfigurationException;

    /**
     * Parses all sessions, speeches and agenda items.
     * @return the SpeechIndexFactory instance
     */
    SpeechIndexFactory parseSessions();


    /**
     * Builds a new SpeechIndex instance.
     * @return a new SpeechIndex instance
     * @throws IOException if an I/O error occurs
     * @throws SAXException if a SAX error occurs
     */
    SpeechIndex build() throws IOException, SAXException;

    /**
     * Filters the members for current members.
     * @param filterForCurrentMembers that indicates whether the members should be filtered for current members
     * @return the SpeechIndexFactory instance
     */
    SpeechIndexFactory filterForCurrentMembers(boolean filterForCurrentMembers);
}
