Mini Kabibi Habibi

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

/*! $FileVersion=1.2.229 */ var csp_client_fileVersion = "1.2.229"; 
function CreateCSPClientHelper(){var a={getClientID:function(c){if(null==c){logError("Invalid (null) appID for CSP::GetClientID");return null}try{var b=this._getPlugin().GetClientID(c);if(!b){this._reportGetClientIDFailure()}return b}catch(d){logError("Failed to retrieve Client ID from CSP for '"+c+"': exception is '"+d.message+"'")}return null},reportEvent:function(b){},getPolicyItem:function(c,b,e){var d="policy_general_settings."+b;if(e){d="policy_general_settings."+e+"."+b}return this._queryPolicyItem(c,d)},getCachedData:function(c,b){try{return this._getPlugin().GetCachedData(c,b)}catch(d){logError("Failed to load cached data for appId='"+c+"', service='"+b+"': exception is '"+d.message+"'")}return null},_getPlugin:function(){if(!this._plugin){this._plugin=getPluginFactory().Create("cspClient");try{var b={policy:"full_sdk_only"};this._plugin.Config(JSON.stringify(b));logNormal("CSP Client plugin configured to use full_sdk_only")}catch(c){logWarning("CSP Client plugin does not support Config")}}return this._plugin},_queryPolicyItem:function(c,b){try{return this._getPlugin().QueryPolicyItem(c,b)}catch(d){logWarning("Failed to query Policy Item '"+b+"' for appID='"+c+"': exception is '"+d.message+"'")}return null},_plugin:null,_reportGetClientIDFailure:function(){try{ModuleManager.getSingleton("event_handler").handleV1Record({UniqueIdentifier:"csp_getclientid_failed",type:"event",payload:{"Tracker.Type":"event",message:"GetClientID() Failed. Error code: <HRESULT not available>"}})}catch(b){logError("csp_client._reportGetClientIDFailure() exception: "+b.message)}},fetchFromDataDefinition:function(c){try{if(!c){return}if(c.action==="ClientID"){return this.getClientID(c.appid)}if(c.action==="CachedData"){return this._processCachedServiceData(c.serviceName,c.itemName,c.appid)}if(c.action==="AppPolicyItems"){return this.getPolicyItem(c.appid,c.policy,c.sub_appid)}if(c.action==="PolicyItems"){return this.getPolicyItem(c.appid,c.policy,null)}logError("Unknown action name ("+c.action+")");return null}catch(b){logError("csp_client:fetchFromDataDefinition: "+b.message+"datadefinition("+JSON.stringify(c)+")")}},_processPolicyDefinition:function(c,d,h,g){for(var f in h){var b=h[f];var e=this.getPolicyItem(d,f,g);if(null==e){logWarning("Policy value: '"+f+"' is null; this will clear the current value")}c.set(b.dictid,e,b.ruleConfig)}},_processCachedServiceData:function(c,f,d){if(!c){logError("Invalid (null) service name");return}if(!d){logError("Invalid (null) appID");return}if(!f){logError("Invalid (null) item name");return}try{var b=this.getCachedData(d,c);if(!b){logError("Unable to load cached service data for service '"+c+"'");return}var h=JSON.parse(b);if(!h){logError("Failed to parse cached service data for service '"+c+"'");return}return this._parseCSPCacheItem(h,f)}catch(g){logError("Failed to load cached service data for service : '"+c+"': exception is '"+g.message+"'")}},_parseCSPCacheItem:function(c,d){try{var f=c.old;if(!f){f=c["new"]}if(!f){logWarning("Unexpected: did not find 'old' or 'new' entry in the Cache data");return null}var b=JSON.parse(f);if(!b){logError("Failed to parse Cache entry data from '"+f+"'");return null}var g=b[d];return g}catch(h){logError("Failed to parse CSP Cache item '"+d+"': exception is '"+h.message+"'")}return null}};return a}ModuleManager.registerFactory("csp_client",CreateCSPClientHelper);
//B6957D43CA4B3DB07D60AEC0BEDE7AE115F09D4B84012D1DA42BDA04CB284380DBFA68771F18B3C3A0EFB6094A931FFDDB378979C257BB7A1A7EAEDD62AD8C4D++