function AdfUserActivityInfo(){this.Init()}AdfUserActivityInfo.PREVIOUS="pr0";AdfUserActivityInfo.PRIMARY="prm";AdfUserActivityInfo.SECONDARY="sec";AdfUserActivityInfo._PREVIOUS_PREFIX="pr";AdfObject.createSubclass(AdfUserActivityInfo);AdfUserActivityInfo.getInstance=function(a){AdfAssert.assertString(a);var b=AdfUserActivityInfo._instanceMap;b||(b={},AdfUserActivityInfo._instanceMap=b);var d=null;a&&(d=b[a],d||(d=new AdfUserActivityInfo,b[a]=d));return d};
AdfUserActivityInfo.restoreFromSessionStorage=function(){var a=AdfUserActivityInfo.PRIMARY,b=AdfUserActivityInfo.PREVIOUS,d=AdfUserActivityInfo._getSessionStorageProperty(a);d?(AdfUserActivityInfo._getAsObject(String(d),b),d=AdfUserActivityInfo.getInstance(b),d.getClientStartTime()||d.setClientStartTime(d._getCurrentTime()),AdfUserActivityInfo._removeSessionStorageProperty(a)):(a=AdfUserActivityInfo.getInstance(b),a.getClientStartTime()||a.setClientStartTime(a._getCurrentTime()));if(a=AdfUserActivityInfo._getSessionStorageProperty(b))AdfUserActivityInfo._getAsObject(String(a),
AdfUserActivityInfo._getPreviousKeyInSequence(1)),AdfUserActivityInfo._removeSessionStorageProperty(b);b=AdfUserActivityInfo.SECONDARY;if(a=AdfUserActivityInfo._getSessionStorageProperty(b))AdfUserActivityInfo._getAsObject(String(a),b),AdfUserActivityInfo._removeSessionStorageProperty(b)};AdfUserActivityInfo.removeFromSessionStorageByType=function(a){AdfAssert.assertNonEmptyString(a);AdfUserActivityInfo._removeSessionStorageProperty(a)};
AdfUserActivityInfo.saveToSessionStorage=function(){if(null!=AdfUserActivityInfo._instanceMap){AdfUserActivityInfo.restoreFromSessionStorage();var a=AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PREVIOUS),b=a._getCurrentTime();a.setClientEndTime(b);AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.PREVIOUS);AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PRIMARY).setClientStartTime(b);AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.PRIMARY);AdfUserActivityInfo.cleanInstanceMap()}};
AdfUserActivityInfo.saveToSessionStorageByType=function(a){var b=AdfUserActivityInfo.getInstance(a);b&&(userActInfoValue=AdfUserActivityInfo._getAsString(b),AdfUserActivityInfo._setSessionStorageProperty(a,userActInfoValue))};AdfUserActivityInfo.prototype.Init=function(){AdfUserActivityInfo.superclass.Init.call(this);this.rrt=this.ppr=this.eif=this.cet=this.cst=this.cid=null};
AdfUserActivityInfo.getMarshaledObject=function(){var a=AdfAgent.AGENT,b=a.createXmlDocument(),d=b.createElement("TEMP");a.getPlatform()==AdfAgent.IE_PLATFORM?b.documentElement=d:b.appendChild(d);b=AdfMarshalingService.getDefault().marshal(d,AdfUserActivityInfo._instanceMap,null);AdfUserActivityInfo.removeFromSessionStorageByType(AdfUserActivityInfo.PRIMARY);AdfUserActivityInfo.removeFromSessionStorageByType(AdfUserActivityInfo.PREVIOUS);AdfUserActivityInfo.removeFromSessionStorageByType(AdfUserActivityInfo.SECONDARY);
for(var d=1,e=AdfUserActivityInfo._getPreviousKeyInSequence(d);AdfUserActivityInfo._getSessionStorageProperty(e);)AdfUserActivityInfo.removeFromSessionStorageByType(e),e=AdfUserActivityInfo._getPreviousKeyInSequence(d++);AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.PRIMARY);AdfUserActivityInfo.cleanInstanceMap();return a.getNodeXml(b)};AdfUserActivityInfo.setRequestSentTime=function(a){var b=null;a||(a=AdfUserActivityInfo.PRIMARY);b=AdfUserActivityInfo.getInstance(a);b.rst=b._getCurrentTime()};
AdfUserActivityInfo.setResponseReceivedTime=function(a){var b=null;a||(a=AdfUserActivityInfo.PREVIOUS);b=AdfUserActivityInfo.getInstance(a);b.rrt=b.rrt||b._getCurrentTime()};AdfUserActivityInfo.prototype.getContextId=function(){return this.cid};AdfUserActivityInfo.prototype.getParentContextId=function(){return this.pid};AdfUserActivityInfo.prototype.getClientStartTime=function(){return this.cst};AdfUserActivityInfo.prototype.getClientEndTime=function(){return this.cet};
AdfUserActivityInfo.prototype.getResponseTime=function(){return this.rrt};AdfUserActivityInfo.prototype.getEventInfo=function(){return this.eif};AdfUserActivityInfo.prototype.getPprTargets=function(){return this.ppr};AdfUserActivityInfo.prototype.setContextId=function(a){this.cid=a};AdfUserActivityInfo.prototype.setParentContextId=function(a){this.pid=a};AdfUserActivityInfo.prototype.setClientStartTime=function(a){this.cst=a};AdfUserActivityInfo.prototype.setClientEndTime=function(a){this.cet=a};
AdfUserActivityInfo.prototype.setEventInfo=function(a,b,d,e){this.eif||(this.eif={});a&&(this.eif.ety=a);b&&(this.eif.cld=b);d&&(this.eif.cty=d);e&&(this.eif.cdn=e);d=AdfPage.PAGE.findComponent(b);if(null!=d){for(b=a=null;null!=d;){if("oracle.adf.RichRegion"==d.getComponentType()){a=d.getProperty("viewId");b=d.getProperty("viewName");break}d=d.getParent()}a&&(this.eif.rvd=a,b&&(this.eif.rvn=b))}};AdfUserActivityInfo.prototype.setPprTargets=function(a){a&&(this.ppr=a)};
AdfUserActivityInfo.prototype.setResponseTime=function(a){this.rrt=a};AdfUserActivityInfo.prototype.cleanup=function(){this.ppr=this.pid=this.eif=this.cet=this.cst=this.cid=null};AdfUserActivityInfo.cleanInstanceMap=function(){var a=AdfUserActivityInfo._instanceMap;if(a){for(var b in a){var d=a[b];d.cleanup&&d.cleanup()}AdfUserActivityInfo._instanceMap=null}};
AdfUserActivityInfo._getAsObject=function(a,b){var d=AdfUserActivityInfo.getInstance(b);a=a.replace(/'/g,'"');var e=JSON.parse(a);if(null!=e){if(null==d.getClientStartTime()){var f=e.cst;null!=f&&d.setClientStartTime(f)}null==d.getContextId()&&(f=e.cid,null!=f&&d.setContextId(f));null==d.getParentContextId()&&(f=e.pid,null!=f&&"undefined"!=f&&d.setParentContextId(f));d.setClientEndTime(e.cet);null==d.getResponseTime()&&(e=e.rrt)&&"null"!==e&&d.setResponseTime(e)}};
AdfUserActivityInfo._getAsString=function(a){return"{'cid':'"+a.getContextId()+"','pid':'"+a.getParentContextId()+"','cst':'"+a.getClientStartTime()+"','cet':'"+a.getClientEndTime()+"','rrt':'"+a.getResponseTime()+"'}"};AdfUserActivityInfo.prototype._getCurrentTime=function(){return(new Date).getTime().toString()};AdfUserActivityInfo._getPreviousKeyInSequence=function(a){return a&&(AdfAssert.assertNumber(a),0<a)?AdfUserActivityInfo._PREVIOUS_PREFIX+a.toString():AdfUserActivityInfo.PREVIOUS};
AdfUserActivityInfo._getSessionStorageProperty=function(a){var b=AdfAgent.AGENT,d=null;try{d=b.getSessionStorageProperty(a)}catch(e){AdfLogger.LOGGER.fine("User activity information may be inaccurate as a failure occurred when attempting to retrieve property from sessionStorage - "+a)}return d};
AdfUserActivityInfo._removeSessionStorageProperty=function(a){var b=AdfAgent.AGENT,d=!0;try{b.removeSessionStorageProperty(a)}catch(e){AdfLogger.LOGGER.fine("User activity information may be inaccurate as a failure occurred when attempting to remove property from sessionStorage - "+a),d=!1}return d};
AdfUserActivityInfo._setSessionStorageProperty=function(a,b){var d=AdfAgent.AGENT,e=!0;try{d.setSessionStorageProperty(a,b)}catch(f){AdfLogger.LOGGER.fine("User activity information may be inaccurate as a failure occurred when attempting to save property-value to sessionStorage "+a+", "+b),e=!1}return e};