001package org.intellimate.izou.system.context;
002
003import org.intellimate.izou.events.EventModel;
004import org.intellimate.izou.identification.Identification;
005import org.intellimate.izou.identification.IllegalIDException;
006import org.intellimate.izou.output.OutputExtensionModel;
007import org.intellimate.izou.output.OutputPluginModel;
008
009import java.util.List;
010import java.util.concurrent.CompletableFuture;
011
012/**
013 * @author Leander Kurscheidt
014 * @version 1.0
015 */
016public interface Output {
017    /**
018     * adds output extension to desired outputPlugin
019     *
020     * adds output extension to desired outputPlugin, so that the output-plugin can start and stop the outputExtension
021     * task as needed. The outputExtension is specific to the output-plugin
022     *
023     * @param outputExtension the outputExtension to be added
024     * @throws IllegalIDException not yet implemented
025     */
026    void addOutputExtension(OutputExtensionModel outputExtension) throws IllegalIDException;
027
028    /**
029     * removes the output-extension of id: extensionId from outputPluginList
030     *
031     * @param outputExtension the OutputExtension to remove
032     */
033    void removeOutputExtension(OutputExtensionModel outputExtension);
034
035    /**
036     * adds outputPlugin to outputPluginList, starts a new thread for the outputPlugin, and stores the future object in a HashMap
037     * @param outputPlugin OutputPlugin to add
038     * @throws IllegalIDException not yet implemented
039     */
040    void addOutputPlugin(OutputPluginModel outputPlugin) throws IllegalIDException;
041
042    /**
043     * removes the OutputPlugin and stops the thread
044     * @param outputPlugin the outputPlugin to remove
045     */
046    void removeOutputPlugin(OutputPluginModel outputPlugin);
047
048    /**
049     * returns all the associated OutputExtensions
050     * @param outputPlugin the OutputPlugin to search for
051     * @return a List of Identifications
052     */
053    List<Identification> getAssociatedOutputExtension(OutputPluginModel<?, ?> outputPlugin);
054
055    /**
056     * starts every associated OutputExtension
057     * @param outputPlugin the OutputPlugin to generate the Data for
058     * @param t the argument or null
059     * @param event the Event to generate for
060     * @param <T> the type of the argument
061     * @param <X> the return type
062     * @return a List of Future-Objects
063     */
064    public <T, X> List<CompletableFuture<X>> generateAllOutputExtensions(OutputPluginModel<T, X> outputPlugin,
065                                                                                   T t, EventModel event);
066
067    /**
068     * returns the ID of the Manager
069     * @return an instance of Identification
070     */
071    Identification getManagerIdentification();
072}