Module tvbrowser
Package devplugin

Class AbstractTvDataService


  • public abstract class AbstractTvDataService
    extends java.lang.Object
    Superclass for all TvDataServices.

    Extend this class to provide your own TvDataService.

    • Constructor Detail

      • AbstractTvDataService

        public AbstractTvDataService()
    • Method Detail

      • getAvailableChannels

        public final Channel[] getAvailableChannels()
      • getAPIVersion

        public final Version getAPIVersion()
      • getPluginManager

        public static final PluginManager getPluginManager()
        Use this method to call methods of the plugin manager.

        The plugin manager is your connection to TV-Browser. Every communication between TV-Browser and the data service is either initiated by TV-Browser or made by using the plugin manager.

        Returns:
        The plugin manager.
        Since:
        2.6
      • setPluginManager

        public static final void setPluginManager​(PluginManager manager)
        Called by the host-application to provide access to the plugin manager.
        Parameters:
        manager - The plugin manager the plugins should use.
      • getVersion

        public static Version getVersion()
        Gets the version of this data service.
        Returns:
        The version of this data service.
      • setParent

        public final void setParent​(java.awt.Frame parent)
        Called by the host-application to provide the parent frame.
        Parameters:
        parent - The parent frame.
        Since:
        2.7
      • getParentFrame

        public final java.awt.Frame getParentFrame()
        Gets the parent frame.

        The parent frame may be used for showing dialogs.

        Returns:
        The parent frame.
        Since:
        2.7
      • handleTvBrowserStartFinished

        public void handleTvBrowserStartFinished()
        This method is called when the TV-Browser start is complete.
        Since:
        2.7
      • supportsAutoUpdate

        public boolean supportsAutoUpdate()
        Gets if the data service supports auto update of data.
        Returns:
        True if the data service supports the auto update, false otherwise.
        Since:
        2.7
      • getButtonAction

        public ActionMenu getButtonAction()
        Gets the action menu with the action supported for toolbar actions.
        Returns:
        The action menu with the supported toolbar actions
      • getId

        public final java.lang.String getId()
        Gets the id of this ButtonActionIf.
        Returns:
        The id of this ButtonActionIf.
      • getButtonActionDescription

        public java.lang.String getButtonActionDescription()
        Gets the description for this ButtonActionIf.
        Returns:
        The description for this ButtonActionIf.
      • getContextMenuActions

        public ActionMenu getContextMenuActions​(Program program)
        Gets the actions for the context menu of a program.
        Parameters:
        program - The program the context menu will be shown for.
        Returns:
        the actions this plugin provides for the given program or null if the plugin does not provide this feature.
      • getIconLoader

        protected IconLoader getIconLoader​(java.lang.String groupId,
                                           java.io.File workingDirectory)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getDefaultMirrors

        protected java.lang.String[] getDefaultMirrors()
        get the default mirrors to ask for channel groups
        Returns:
        mirror url array
        Since:
        3.0
      • setWorkingDirectory

        public abstract void setWorkingDirectory​(java.io.File dataDir)
        This method is called by the host application to set the working folder. If required, TvDataService implementations should store their data within this 'dataDir' directory
        Parameters:
        dataDir - The data directory.
      • getAvailableGroups

        public abstract ChannelGroup[] getAvailableGroups()
        Returns:
        an array of the available channel groups.
      • updateTvData

        public abstract void updateTvData​(TvDataUpdateManager updateManager,
                                          Channel[] channelArr,
                                          Date startDate,
                                          int dateCount,
                                          ProgressMonitor monitor)
                                   throws TvBrowserException
        Updates the TV listings provided by this data service.
        Parameters:
        updateManager - The update manager.
        channelArr - The channel array.
        startDate - The start date.
        dateCount - The number of days to update
        monitor - The progress monitor to use.
        Throws:
        TvBrowserException - Thrown if something went's wrong.
      • loadSettings

        public abstract void loadSettings​(java.util.Properties settings)
        Called by the host-application during start-up. Implement this method to load your data service settings from the file system.
        Parameters:
        settings - The properties with the settings.
      • storeSettings

        public abstract java.util.Properties storeSettings()
        Called by the host-application during shut-down. Implements this method to store your data service settings to the file system.
        Returns:
        properties that will afterwards be stored by the host application
      • hasSettingsPanel

        public abstract boolean hasSettingsPanel()
        A TvDataService can have a settings panel within the settings dialog. If the hasSettingsPanel() method returns false, the getSettingsPanel() method is never called.
        Returns:
        true, if the settings panel feature is used by this TvDataService
      • getSettingsPanel

        public abstract SettingsPanel getSettingsPanel()
        Returns:
        the SettingsPanel of this TvDataService
      • getAvailableChannels

        public abstract Channel[] getAvailableChannels​(ChannelGroup group)
        Gets the list of the channels that are available for the given channel group.
        Parameters:
        group - The group the get the channels for
        Returns:
        The array with the available channels.
      • checkForAvailableChannels

        public abstract Channel[] checkForAvailableChannels​(ChannelGroup group,
                                                            ProgressMonitor monitor)
                                                     throws TvBrowserException
        Some TvDataServices may need to connect to the Internet to know their channels. If supportsDynamicChannelList() returns true, this method is called to check for available channels.
        Parameters:
        group - The group to check.
        monitor - The progress monitor to use.
        Returns:
        array of all available channels (new and old)
        Throws:
        TvBrowserException - Thrown if something went's wrong.
      • supportsDynamicChannelList

        public abstract boolean supportsDynamicChannelList()
        Returns:
        true, if this TvDataService can dynamically load other channels
      • supportsDynamicChannelGroups

        public abstract boolean supportsDynamicChannelGroups()
        Returns:
        true, if this TvDataService can dynamically load other groups
      • getInfo

        public abstract PluginInfo getInfo()
        Gets information about this TvDataService
        Returns:
        The plugin info for this TvDataService.
      • hasRightToDownloadIcons

        public boolean hasRightToDownloadIcons()
      • getAuthenticationPanel

        public SettingsPanel getAuthenticationPanel()
        If the download of the TV data needs authentication create a panel that contains information about the authentification and the authentication form.

        Returns:
        The panel with the authentication settings.
        Since:
        3.0.2