ChannelService

public interface ChannelService

Manages CRUD operations for a Channel.

Methods

addOrUpdate

void addOrUpdate(Channel channel)

Saves the given channel. If the channel exists it will be updated.

Parameters:
  • channel – the channel to be added, not null

delete

void delete(String moduleName)

Deletes the given module.

Parameters:
  • moduleName – the channel to be deleted

getAllChannels

List<Channel> getAllChannels()

Returns the list of all registered channels.

Returns:the list of channels

getChannel

Channel getChannel(String moduleName)

Returns the channel for the module with the given name.

Parameters:
  • moduleName – the name of the module, null returns null
Returns:

the channel for the module

getChannelIcon

BundleIcon getChannelIcon(String moduleName)

Returns the icon for the channel from module with the given name.

Parameters:
  • moduleName – the name of the module, null returns default icon
Throws:
  • IOException – when there were problems while fetching the icon
Returns:

the icon of the module

registerChannel

void registerChannel(ChannelRequest channelRequest)

Registers the given channel with the task module.

Parameters:
  • channelRequest – the channel request, not null

registerChannel

void registerChannel(InputStream stream, String moduleName, String moduleVersion)

Registers channel from the given stream for the given module. The input stream should contain the JSON definition of the channel.

Parameters:
  • stream – the channel JSON definition as a stream, not null
  • moduleName – the name of the module
  • moduleVersion – the version of the module

unregisterChannel

void unregisterChannel(String moduleName)

Unregisters the given channel with the task module.

Parameters:
  • moduleName – , not null