The Alitheia Core metric plug-in interface

package eu.sqooss.service.abstractmetric;
 
/**
 * This interface defines the common metric plug-in related functionality.
 */
public interface AlitheiaPlugin {
 
    /**
     * Get the metric version. Free form text.
     */
    String getVersion();
 
    /**
     * Get information about the metric author
     */
    String getAuthor();
 
    /**
     * Get the date this version of the metric has been installed
     */
    Date getDateInstalled();
 
    /**
     * Get the metric name
     *
     */
    String getName();
 
    /**
     * Get a free text description of what this metric calculates
     */
    String getDescription();
 
    /**
     * Get an already calculated result without triggering a calculation
     * if the result does not exist yet
     */
    Result getResultIfAlreadyCalculated(DAObject o, List<Metric> l)
        throws MetricMismatchException;
 
    /**
     *  Get a metric result, even it it must be calculated on the fly.
     *  This method blocks until a result (or an error) is returned. 
     */
    Result getResult(DAObject o, List<Metric> l)
        throws MetricMismatchException, AlreadyProcessingException, Exception;
 
    /**
     * Get the description objects for all metrics supported by this plug-in
     * as found in the database.
     *
     */
    List<Metric> getAllSupportedMetrics();
 
    /**
     * Get all metrics that are bound to the provided activation type. 
     *
     */
    List<Metric> getSupportedMetrics(Class<? extends DAObject> activationType);
 
    /**
     * Generic "run plug-in" method. This method performs a measurement for
     * the given DAO, if supported. 
     */
    void run(DAObject o) throws MetricMismatchException, 
        AlreadyProcessingException, Exception;
 
    /**
     * After installing a new version of the metric, try to
     * update the results. The metric may opt to partially
     * or fully update its results tables or files.
     */
    boolean update();
 
    /**
     * Perform maintenance operations when installing a new
     * version of the metric
     */
    boolean install();
 
    /**
     * Free the used resources and clean up on metric removal
     */
    boolean remove();
 
    /**
     * Just clean results on project removal
     *
     */
    boolean cleanup(DAObject sp);
 
    /**
     * Return a string that is unique for this plugin, used for indexing this
     * plugin in the system database
     */
    String getUniqueKey();
 
    /**
     * Get the types supported by this plug-in for data processing and result
     * retrieval. 
     */
    List<Class<? extends DAObject>> getActivationTypes();
 
    /**
     * Get the activation type that corresponds to the activation type which 
     * the metric result is stored. 
     */
    Class<? extends DAObject> getMetricActivationType(Metric m);
 
    /**
     * Retrieves the list of configuration properties for this plug-in.
     */
    Set<PluginConfiguration> getConfigurationSchema();
 
    /**
     * Metric mnemonics for the metrics required to be present for this 
     * plugin to operate. 
     */
    List<String> getDependencies();
}

User login

Syndicate

Syndicate content