All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.freedomotic.plugins.PluginsManager Maven / Gradle / Ivy

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.freedomotic.plugins;

import com.freedomotic.api.Client;
import com.freedomotic.exceptions.PluginLoadingException;
import java.io.File;
import java.net.URL;

/**
 * Loads bundles from external jar files at runtime. Loaded bundles are then
 * added to the {@link ClientStorage}
 * 
 * @author enrico
 */
public interface PluginsManager {

    int TYPE_DEVICE = 0;
    int TYPE_EVENT = 2;
    int TYPE_OBJECT = 1;

    /**
     * Install a plugins bundle downloading it from remote URL
     * @param fromURL
     * @return 
     */
    boolean installBoundle(URL fromURL);
    
    /**
     * Uninstalls a given plugin. The plugin can be part of a bundle, in this case
     * the entire boundle will be uninstalled
     * @param c
     * @return 
     */
    boolean uninstallBundle(Client c);

    /**
     * Loads all plugins of a given type (device, object, event) taken from
     * their default folder.
     *
     * @param TYPE
     * @throws com.freedomotic.exceptions.PluginLoadingException
     */
    void loadAllPlugins(int TYPE) throws PluginLoadingException;

    /**
     * Loads all plugins from filesystem regardless their type
     *
     * @throws com.freedomotic.exceptions.PluginLoadingException
     */
    void loadAllPlugins() throws PluginLoadingException;

    /**
     * Load a single plugin package from a given directory. This directory should be the
     * root path of the plugin package, not a directory containing more than one
     * plugin package.
     *
     * @param directory
     * @throws PluginLoadingException
     */
    void loadSingleBoundle(File directory) throws PluginLoadingException;
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy