Author: ygrego Date: 2015-02-10 09:54:42 +0000 (Tue, 10 Feb 2015) New Revision: 778 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/778 Log: Addition of new class 'ChannelList' for add new channel for future tests on 'VideoBroadcastObject'. Added: oipf/js/impl/model/ChannelList.js Added: oipf/js/impl/model/ChannelList.js =================================================================== --- oipf/js/impl/model/ChannelList.js (rev 0) +++ oipf/js/impl/model/ChannelList.js 2015-02-10 09:54:42 UTC (rev 778) @@ -0,0 +1,79 @@ +/* +* Description: +* A ChannelList represents a collection of Channel objects. See Annex K for the definition of the collection template. +* In addition to the methods and properties defined for generic collections, the ChannelList class supports the additional +* properties and methods defined below. +* +*/ +var ChannelList = Collection.extend({ + + init: function(elements) { + + this.super.init(elements); + }, + + /* + * Description: + * Return the first channel in the list with the specified channel identifier. Returns null if no + * corresponding channel can be found. + * + * Arguments: + * - channelID: (Type: String)The channel identifier of the channel to be retrieved, which is a value as + * defined for the ccid and ipBroadcastID properties of the Channel object + * as defined in section 7.13.11. + * + * Return: Channel + */ + getChannel: function(channelID) { + for(var key = Object.keys(this)){ + var channel = this.[key] + if( channel && (channel.channelID == channelID)){ + return channel; + } + } + }, + + /* + * Description: + * Return the first (IPTV or non-IPTV) channel in the list that matches the specified DVB or + * ISDB triplet (original network ID, transport stream ID, service ID). + * Where no channels of type ID_ISDB_* or ID_DVB_* are available, or no channel identified + * by this triplet are found, this method SHALL return null. + * + * Arguments: + * - onid: (Type: Integer) The original network ID of the channel to be retrieved. + * + * - tsid: (Type: Integer) The transport stream ID of the channel to be retrieved. If set to null the client + * SHALL retrieve the channel defined by the combination of onid and sid. This + * makes it possible to retrieve the correct channel also in case a remultiplexing + * took place which led to a changed tsid. + * + * - sid: (Type: Integer) The service ID of the channel to be retrieved. + * + * - nid: (Type: Integer) An optional argument, indicating the network id to be used select the channel + * when the channel list contains more than one entry with the same onid , tsid + * and sid. + * + * Return: Channel + */ + getChannelByTriplet: function(onid, tsid, sid, nid) { + + }, + + /* + * Description: + + * Return the first (IPTV or non-IPTV) channel in the list with the specified ATSC source ID. + * Where no channels of type ID_ATSC_* are available, or no channel with the specified + * source ID is found in the channel list, this method SHALL return null . + * + * Arguments: + * - sourceID: (Type: Integer) The ATSC source_ID of the channel to be returned. + * + * Return: Channel + */ + getChannelBySourceID: function(sourceID) { + + } + +}); \ No newline at end of file