dataset_static.js – csp_client.js

/*! $FileVersion=1.0.127 */ var dataset_static_fileVersion = “1.0.127”;
var createStaticDataset=function(){var a={set:function(b,c){this._data[b]=c},get:function(b){try{return this._data[b]}catch(c){logWarning(“Unable to get key='”+b+”‘: exception = ‘”+c.message+”‘”);return null}},setDirty:function(){this.dirty=true},getDictionary:function(){return this._data},load:function(){try{if(!this.dirty){return}var c=ModuleManager.getSingleton(“data_collection”);var g=c.wmi;this._loadWMI(g);var b=c.registry;this._loadRegistry(b);var d=c.CSP;this._loadCSP(d);this._dirty=false}catch(f){logError(“failed to load static data into store: “+f.message);throw f}},dirty:true,_loadWMI:function(c){var b=ModuleManager.getSingleton(“wmi”);b.loadFromDataDefinition(this,c)},_loadRegistry:function(c){var b=ModuleManager.getSingleton(“registry”);b.loadFromDataDefinition(this,c)},_loadCSP:function(b){var c=ModuleManager.getSingleton(“csp_client”);c.loadFromDataDefinition(this,b)},_data:{}};return a};ModuleManager.registerFactory(“dataset_static”,createStaticDataset);

/*! $FileVersion=1.0.127 */ var csp_client_fileVersion = “1.0.127”;
function CreateCSPClientHelper(){var a={getClientID:function(b){if(null==b){logError(“Invalid (null) appID for CSP::GetClientID”);return null}try{return this._getPlugin().GetClientID(b)}catch(c){logError(“Failed to retrieve Client ID from CSP for ‘”+b+”‘: exception is ‘”+c.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”)}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,loadFromDataDefinition:function(k,e){if(!k){logError(“Invalid (null) data store”);return}var g=e.ClientID;if(g){k.set(g.dictid,this.getClientID(g.appID),g.ruleConfig)}var j=e.PolicyItems;if(j){for(var n in j){var h=j[n];this._processPolicyDefinition(k,n,h,null)}}var l=e.AppPolicyItems;if(l){for(var n in l){var h=l[n];for(var c in h){var d=h[c];this._processPolicyDefinition(k,n,d,c)}}}var i=e.CachedData;if(i){for(var c in i){var m=i[c];for(var f in m){var b=m[f];this._processCachedServiceData(k,f,b,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(j,h,i,d){if(!h){logError(“Invalid (null) service name”);return}if(!i){logError(“Invalid (null) service data”);return}try{var c=this.getCachedData(d,h);if(!c){logError(“Unable to load cached service data for service ‘”+h+”‘”);return}var k=JSON.parse(c);if(!k){logError(“Failed to parse cached service data for service ‘”+h+”‘”);return}for(var l in i){var f=i[l];var b=this._parseCSPCacheItem(k,l);j.set(f.dictid,b,f.ruleConfig)}}catch(g){logError(“Failed to load cached service data for service : ‘”+h+”‘: exception is ‘”+g.message+”‘”)}},_parseCSPCacheItem:function(c,d){try{var f=c.old;if(!f){f=c[“new”]}if(!f){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);