1 /** 2 * Abstract Class for Providers 3 * @class Provider 4 * @constructor 5 */ 6 wso2vis.p.Provider = function() { 7 this.drList = []; 8 wso2vis.environment.providers.push(this); 9 id = wso2vis.environment.providers.length - 1; 10 this.getID = function() { 11 return id; 12 } 13 }; 14 15 wso2vis.p.Provider.prototype.initialize = function() { 16 this.pullData(); 17 }; 18 19 wso2vis.p.Provider.prototype.addDataReceiver = function(dataReceiver) { 20 this.drList.push(dataReceiver); 21 }; 22 23 wso2vis.p.Provider.prototype.pushData = function(data) { 24 // loop all data receivers. Pump data to them. 25 //console.log(JSON.stringify(data) + this.url); 26 for (i = 0; i < this.drList.length; i++) { 27 (this.drList[i]).pushData(data); 28 } 29 }; 30 31 wso2vis.p.Provider.prototype.pullData = function() { 32 }; 33 34