<commit_before>package com.beolnix.marvin.plugins.api;

import com.beolnix.marvin.im.api.IMSessionManager;
import com.beolnix.marvin.im.api.model.IMIncomingMessage;

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

/**
 * Basic interface for Marvin Plugin
 * Created by beolnix on 31/10/15.
 */
public interface IMPlugin {
    /**
     * The name of the property available in osgi context.
     * Logs Path is a path to a directory where plugin can write logs.
     */
    public final String LOGS_PATH_PARAM_NAME = "logsPath";

    /**
     * The name of the property available in osgi context
     * Directory Path is a path to a directory where plugin can persist any data if it is required.
     * For example it is a good place to persist data of SQLite database.
     */
    public final String DIRECTORY_PARAM_NAME = "dirPath";

    /**
     * During the deployment marvin core uses this method to inject imSessionManager into the instance of the plugin.
     * It is recommend to change state to INITIALIZED once this method is executed.
     * @param imSessionManager
     */
    void setIMSessionManager(IMSessionManager imSessionManager);

    /**
     * Using this method Core provides pluginProperties (if any) from the configuration file
     * @param pluginConfig
     */
    void setPluginConfig(PluginConfig pluginConfig);

    /**
     * Method should return plugin name.
     * Marvin core will use plugin name to register plugin.
     * @return
     */
    String getPluginName();

    /**
     * If the plugin should process all messages (for example you want to gather some statistics like word counter) -
     * this method must return true.
     * If the plugin should process only specific messages with special commands - this method must return false.
     * @return
     */
    boolean isProcessAll();

    /**
     * Method should return commands list supported by the plugin.<commit_msg>replace setConfig and setIMSessionManagement with init method in IMPlugin interface<commit_after>package com.beolnix.marvin.plugins.api;

import com.beolnix.marvin.im.api.IMSessionManager;
import com.beolnix.marvin.im.api.model.IMIncomingMessage;

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

/**
 * Basic interface for Marvin Plugin
 * Created by beolnix on 31/10/15.
 */
public interface IMPlugin {

    void init(PluginConfig pluginConfig, IMSessionManager imSessionManager);

    /**
     * Method should return plugin name.
     * Marvin core will use plugin name to register plugin.
     * @return
     */
    String getPluginName();

    /**
     * If the plugin should process all messages (for example you want to gather some statistics like word counter) -
     * this method must return true.
     * If the plugin should process only specific messages with special commands - this method must return false.
     * @return
     */
    boolean isProcessAll();

    /**
     * Method should return commands list supported by the plugin.
{'fraction_non_alphanumeric': 0.07096992227103752, 'fraction_numerical': 0.004055424129773572, 'mean_word_length': 3.038199181446112, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4261975', 'n_tokens_mistral': 808, 'n_tokens_neox': 761, 'n_words': 319}