Interface AddonService


  • public interface AddonService
    Classes implementing this interface can be registered as an OSGi service in order to provide functionality for managing add-ons, such as listing, installing and uninstalling them. The REST API offers an uri that exposes this functionality.
    Author:
    Kai Kreuzer - Initial contribution
    • Method Detail

      • getAddons

        List<Addon> getAddons​(Locale locale)
        Retrieves all add-ons It is expected that this method is rather cheap to call and will return quickly, i.e. some caching should be implemented if required.
        Parameters:
        locale - the locale to use for the result
        Returns:
        the localized add-ons
      • getAddon

        Addon getAddon​(String id,
                       Locale locale)
        Retrieves the add-on for the given id.
        Parameters:
        id - the id of the add-on
        locale - the locale to use for the result
        Returns:
        the localized add-on or null, if no add-on exists with this id
      • getTypes

        List<AddonType> getTypes​(Locale locale)
        Retrieves all possible types of add-ons.
        Parameters:
        locale - the locale to use for the result
        Returns:
        the localized types
      • install

        void install​(String id)
        Installs the given add-on. This can be a long running process. The framework makes sure that this is called within a separate thread and add-on events will be sent upon its completion.
        Parameters:
        id - the id of the add-on to install
      • uninstall

        void uninstall​(String id)
        Uninstalls the given add-on. This can be a long running process. The framework makes sure that this is called within a separate thread and add-on events will be sent upon its completion.
        Parameters:
        id - the id of the add-on to uninstall
      • getAddonId

        String getAddonId​(URI addonURI)
        Parses the given URI and extracts an add-on Id. This must not be a long running process but return immediately.
        Parameters:
        addonURI - the URI from which to parse the add-on Id.
        Returns:
        the add-on Id if the URI can be parsed, otherwise null.