Mini Kabibi Habibi

Current Path : C:/Program Files/McAfee/WebAdvisor/Analytics/Scripts/
Upload File :
Current File : C:/Program Files/McAfee/WebAdvisor/Analytics/Scripts/emitter.js

/*! $FileVersion=1.2.229 */ var emitter_fileVersion = "1.2.229"; 
function createEmitter(b,a){function c(g,i){var h=getScriptVariableStore().Get(g);if(h){return h}try{h=getPluginFactory().Create(i)}catch(j){logError("Failed to create plugin: '"+i+"'")}try{getScriptVariableStore().Set(g,h)}catch(j){logError("Failed to set plugin '"+i+"' in store as '"+g+"'")}return h}try{var d={configure:function(g,e){this.profileName=g;this.profile=e;this.transportName=e.transport;this.transportConfiguration=e.transport_config;this.dataSetNames=e.datasets;this.enableRules=e.enableRules;this.throttleRule=e.throttleRule;this.throttleMultiplier=e.throttleMultiplier;this.maxDimensionLength=e.maxDimensionLength;this.extendedAttributesLengthConfiguration=e.extendedAttributesLength},send:function(h){try{if(!this._isEnabled()){logInformation("_isEnabled() returned false. Will not send data to "+this.transportName);return false}h=this._sanitize(h);if("csp"==this.transportName&&"1"==this._getPlugin(this.transportName).GetVersion()){return false}if(!this.initialized){var g=ModuleManager.getSingleton("mappings").getProfileTableStr(this.profile.dictionary);this._getPlugin(this.transportName).Initialize(this.transportName,g,JSON.stringify(this.transportConfiguration));this.initialized=true}if(engine.isStopRequestReceived()){logWarning("emitter:send Stop request received, so stopping all data transmisions..");return false}logDebug("Emit outbound data: "+JSON.stringify(h));return this._getPlugin().Send(JSON.stringify(h))}catch(i){logError("Failed to Emit data: exception = '"+i.message+"'")}},_isEnabled:function(){try{if(null==this.enableRules){return true}if("data_collector"==this.enableRules.sourceType){var i=ModuleManager.getSingleton("data_collector");var g=i.get(this.enableRules.name);var j=ModuleManager.getSingleton("rules");return j.evaluate(g,this.enableRules.rule)}logWarning("_isEnabled: unexpected enableRules.sourceType. sourceType "+this.enableRules.sourceType);return false}catch(h){logError("_isEnabled: "+h.message);return false}},_pluginFactories:{da:{Create:function(e){var g=GetProperty("Analytics.SDK.Version","");logDebug("Tansport: "+e+" with SDK version: "+g);if(isFirstFileVersionGreater("2,5,9999,9999",g)){return c(e,"da")}return ModuleManager.getSingleton("transport_da")}},ai:{Create:function(e){return ModuleManager.create("transport_ai")}},eh:{Create:function(e){return ModuleManager.create("transport_event_hub")}},ga:getPluginFactory(),csp:getPluginFactory(),ga_rest:{Create:function(e){return ModuleManager.create("transport_ga")}},msgbus:{Create:function(e){return ModuleManager.create("transport_msgbus")}},aws_apigateway_v1:{Create:function(e){return ModuleManager.create("transport_aws_apigateway_v1")}},transport_eng_observability:{Create:function(e){return ModuleManager.create("transport_eng_observability")}},mosaic_api_v2:{Create:function(e){return ModuleManager.create("transport_mosaic_api_v2")}}},_getPlugin:function(h){try{if(!this._plugin){logDebug("Trying to create transport plugin with name: "+h);var g=this._pluginFactories[h];if(!g){logDebug("using plugin factory");g=getPluginFactory()}this._plugin=g.Create(h)}}catch(i){logError("_getPlugin: Exception caught with message "+i.message)}return this._plugin},_sanitize:function(k){var i=this.transportName.match("^ga");var g=[];if(this.extendedAttributesLengthConfiguration!=null&&this.extendedAttributesLengthConfiguration!=undefined){g=this.extendedAttributesLengthConfiguration.data_items}for(var j in k){if(i){try{k[j]=escape(unescape(k[j]))}catch(l){k[j]=String(k[j])}}else{k[j]=String(k[j])}if((g instanceof Array)&&g.length>0){var h=g.indexOf(j);if(h>-1){this.maxDimensionLength=this.extendedAttributesLengthConfiguration.maxDimensionLength}else{this.maxDimensionLength=this.profile.maxDimensionLength}}if((this.maxDimensionLength!=null)&&!isNaN(this.maxDimensionLength)){if(k[j].length>this.maxDimensionLength){k[j]=k[j].substring(0,this.maxDimensionLength-3)+"..."}}}return k},_plugin:null,_initialized:false};return d}catch(f){logError("Failed to create the '"+transportName+"' emitter: "+f.message)}return null}ModuleManager.registerFactory("emitter",createEmitter);
//898E63A89C4500C7580F6DAE48D669791A50B72250C444AAA45D1A974B8BF10D8D07E22D4865B8B593CAA073C9C479E963664895CB9BA54F01F14872241D7C2B++