OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.monitoring
Class AdfUserActivityInfo

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.monitoring.AdfUserActivityInfo

public class AdfUserActivityInfo
extends AdfObject
AdfUserActivityInfo class holds user activity information pertaining to a request. At any point in time there may be more than one instance of AdfUserActivityInfo, especially when we need to keep track of information for more than one request (such one or more previous requests in addition to the primary). These are distinguished by its type (AdfUserActivityInfo.PRIMARY, AdfUserActivityInfo.PREVIOUS etc.). The info they keep track of can be one or more of the following properties. tla are used to keep the payload small when the object is marshaled. cid - the String context identifier for a primary request or a secondary request. pid - the context identifier of the parent (or primary) for the secondary, or null if its the parent. cet - the end time of the previous user action. For current requests the client end time is null. Client end time is typically available in the subsequent request. cst - the current start time of the client request in UTC using the client's clock. rrt - the time PPR response is received by DTS. Does not include processing response on client. eif - info pertaining to the primary event that caused this server request. If an attribute change caused this request, eventInfo may be null. (but pprTargets will be non-null) ety - type of event cld - clientId of the component that raised the event cty - component type cdn - display name of the component rvd - array of region view Ids rvn - array of region view names ppr - a list of component ids that have registered as partial targets (on the client) for the current request. If there are no partial targets, this will be null.


Field Summary

public static Object
PREVIOUS
private static Object
_PREVIOUS_PREFIX
public static Object
PRIMARY
public static Object
SECONDARY

Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass

Fields inherited from org.ecmascript.object.Object

prototype

Constructor Summary

public
AdfUserActivityInfo()
AdfUserActivityInfo class holds user activity information pertaining to a request.

Method Summary

public static Object
cleanInstanceMap()
Flushes the instance map, by calling cleanup() on all the objects stored in the AdfUserActivityInfo._instanceMap map.
public Object
cleanup()
Flushes the contents of the AdfUserActivityInfo object and initializes them to null.
private static Object
_getAsObject(String userActInfoStr, String type)
Takes the JSON String representation passed in (userActInfoStr) and unmarshals it to retrieve the JS Object out of it and then updates the UserActivityInfo object of the specified "type".
private static String
_getAsString(Object userActInfo)
Returns a String that is a string representation of the AdfUserActivtyInfo object in JSON format.
public String
getClientEndTime()
Returns the client end time
public String
getClientStartTime()
Returns the client start time
public String
getContextId()
Returns the context Id
private Object
_getCurrentTime()
Returns the current time.
public Object
getEventInfo()
Returns the eventInfo
public static AdfUserActivityInfo
getInstance(String type)
Returns a new instance by type.
public static String
getMarshaledObject()
Marshals information for the previous and the current (or primary) requests to be sent to server.
public String
getParentContextId()
Returns the parent context Id for the secondary request case.
public String
getPprTargets()
Returns the partial targets
private static Object
_getPreviousKeyInSequence(Number sequenceNum)
Returns the key used for a previous request identified by the sequenceNum.
public String
getResponseTime()
Returns the end time when a PPR response was received.
private static Object
_getSessionStorageProperty(Object propKey)
Returns the value stored in the agent specific sessionStorage.
protected Object
Init()
Method to initialize AdfUserActivityInfo instance.
public static Object
removeFromSessionStorageByType(String type)
Removes information pertaining to the specified type from the session storage.
private static Boolean
_removeSessionStorageProperty(String propKey)
Attempts to remove the propValue from the agent specific sessionStorage.
public static Object
restoreFromSessionStorage()
Restores the user activity information stored in the session storage into UserActivityInfo objects.
public static Object
saveToSessionStorage()
Before the redirect request happens save all user activity information for the previous request and the clientStartTime for the redirect (or the new primary request) in the session storage.
public static Object
saveToSessionStorageByType(String type)
Saves information pertaining to the specified type into the session storage.
public Object
setClientEndTime(Object clientEndTime)
Sets the client end time.
public Object
setClientStartTime(Object clientStartTime)
Sets the client start time.
public Object
setContextId(Object contextId)
Sets the context id.
public Object
setEventInfo(String eventType, Object clientId, String componentType, String compDisplayName)
Sets the event info.
public Object
setParentContextId(Object parentContextId)
Sets the parent context id.
public Object
setPprTargets(Object pprTargets)
Sets the Partial targets.
public static Object
setRequestSentTime(String type)
Sets the time the PPR request was sent.
public static Object
setResponseReceivedTime(String type)
Sets the end time response was received.
public String
setResponseTime(Object responseEndTime)
Sets the end time when a PPR response was received on the client.
private static Boolean
_setSessionStorageProperty(String propKey, String propValue)
Attempts to set the propValue into the agent specific sessionStorage.

Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, exportPrototypeSymbol, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString

Field Detail


PREVIOUS

public static Object PREVIOUS

_PREVIOUS_PREFIX

private static Object _PREVIOUS_PREFIX

PRIMARY

public static Object PRIMARY

SECONDARY

public static Object SECONDARY

Constructor Detail


AdfUserActivityInfo

public AdfUserActivityInfo()

AdfUserActivityInfo class holds user activity information pertaining to a request. At any point in time there may be more than one instance of AdfUserActivityInfo, especially when we need to keep track of information for more than one request (such one or more previous requests in addition to the primary). These are distinguished by its type (AdfUserActivityInfo.PRIMARY, AdfUserActivityInfo.PREVIOUS etc.). The info they keep track of can be one or more of the following properties. tla are used to keep the payload small when the object is marshaled. cid - the String context identifier for a primary request or a secondary request. pid - the context identifier of the parent (or primary) for the secondary, or null if its the parent. cet - the end time of the previous user action. For current requests the client end time is null. Client end time is typically available in the subsequent request. cst - the current start time of the client request in UTC using the client's clock. rrt - the time PPR response is received by DTS. Does not include processing response on client. eif - info pertaining to the primary event that caused this server request. If an attribute change caused this request, eventInfo may be null. (but pprTargets will be non-null) ety - type of event cld - clientId of the component that raised the event cty - component type cdn - display name of the component rvd - array of region view Ids rvn - array of region view names ppr - a list of component ids that have registered as partial targets (on the client) for the current request. If there are no partial targets, this will be null.

Method Detail


cleanInstanceMap

public static Object cleanInstanceMap()

Flushes the instance map, by calling cleanup() on all the objects stored in the AdfUserActivityInfo._instanceMap map. This function can be called when its no longer needed to store any userActivity data. Usage : AdfUserActivityInfo.cleanInstanceMap()

Return:
Object

cleanup

public Object cleanup()

Flushes the contents of the AdfUserActivityInfo object and initializes them to null. This method is called on an instance of AdfUserActivityInfo. Usage : userActivityInfo.cleanup() where userActivityInfo is an instance of AdfUserActivityInfo.

Return:
Object

_getAsObject

private static Object _getAsObject(String userActInfoStr,
                                   String type)

Takes the JSON String representation passed in (userActInfoStr) and unmarshals it to retrieve the JS Object out of it and then updates the UserActivityInfo object of the specified "type". In some cases, if a value already exists in the object, it takes precedence over the value stored in session storage as it may be older.

Parameters:
userActInfoStr - the marshaled JSON String representation of UserActivityInfo Object
type - the type of AdfUserActivityInfo object.
Return:
Object

_getAsString

private static String _getAsString(Object userActInfo)

Returns a String that is a string representation of the AdfUserActivtyInfo object in JSON format.

Parameters:
userActInfo - UserActivityInfo instance
Return:
String - the JSON String representation of UserActivityInfo Object

getClientEndTime

public String getClientEndTime()

Returns the client end time

Return:
String - client end time

getClientStartTime

public String getClientStartTime()

Returns the client start time

Return:
String - client start time

getContextId

public String getContextId()

Returns the context Id

Return:
String - context Id

_getCurrentTime

private Object _getCurrentTime()

Returns the current time.

Return:
Object

getEventInfo

public Object getEventInfo()

Returns the eventInfo

Return:
Object - eventInfo

getInstance

public static AdfUserActivityInfo getInstance(String type)

Returns a new instance by type. Internally UserActivityInfo maintains a static map, of UserActivityInfo objects. This is required in cases where we need to store data for more than one request. The method should be called when caller needs a UserActivityInfo object for the specified type. AdfUserActivityInfo.PREVIOUS - the request prior to the "primary". AdfUserActivityInfo.PRIMARY - the primary request. The one that is being sent to the server. AdfUserActivityInfo.SECONDARY - the secondary request that is associated to its primary request.

Parameters:
type - the type of request.
Return:
AdfUserActivityInfo - an instance of UserActivityInfo object if one already exists for the type, otherwise a new instance of UserActivityInfo object is created.

getMarshaledObject

public static String getMarshaledObject()

Marshals information for the previous and the current (or primary) requests to be sent to server. This method is usually called when a partial request is about to be made to the server. A call to this method cleans up all UserActivityInfo objects. TODO If we cleanup our data at the end of this call then in the event of an error with the request, all past data gets lost. particularly if there were previous requests' data. Perhaps we should cleanup after a successful partial response returns.

Return:
String - an XML String representation of the given dom node and its children

getParentContextId

public String getParentContextId()

Returns the parent context Id for the secondary request case.

Return:
String - praent context Id

getPprTargets

public String getPprTargets()

Returns the partial targets

Return:
String - comma separated string of partial target ids

_getPreviousKeyInSequence

private static Object _getPreviousKeyInSequence(Number sequenceNum)

Returns the key used for a previous request identified by the sequenceNum. Else returns the key for the previous.

Parameters:
sequenceNum - a number reprensenting the previous request in ascending sequence from the current (primary) request.
Return:
Object

getResponseTime

public String getResponseTime()

Returns the end time when a PPR response was received. For streaming request this reperesnts the time when all streaming response has been written. This also does not include the client response processing time. See getClientEndTime.

Return:
String - response end time

_getSessionStorageProperty

private static Object _getSessionStorageProperty(Object propKey)

Returns the value stored in the agent specific sessionStorage. Or null if a value is not found for propKey or if it cannot be found due to unforeseen errors.

Parameters:
propKey  
Return:
Object - a valid value or null

Init

protected Object Init()

Method to initialize AdfUserActivityInfo instance.

Return:
Object
Overrides:
AdfObject.Init()

removeFromSessionStorageByType

public static Object removeFromSessionStorageByType(String type)

Removes information pertaining to the specified type from the session storage.

Parameters:
type - the type of AdfUserActivityInfo object.
Return:
Object

_removeSessionStorageProperty

private static Boolean _removeSessionStorageProperty(String propKey)

Attempts to remove the propValue from the agent specific sessionStorage. If agent code throws an error this method logs a message and returns a boolean false.

Parameters:
propKey - a non-null key. Callers are expected to pass a valid propKey
Return:
Boolean - true if the value was removed successfully from sessionStorage, false otherwise

restoreFromSessionStorage

public static Object restoreFromSessionStorage()

Restores the user activity information stored in the session storage into UserActivityInfo objects. Once the information is restored the session storage data is removed.

Return:
Object

saveToSessionStorage

public static Object saveToSessionStorage()

Before the redirect request happens save all user activity information for the previous request and the clientStartTime for the redirect (or the new primary request) in the session storage.

Return:
Object

saveToSessionStorageByType

public static Object saveToSessionStorageByType(String type)

Saves information pertaining to the specified type into the session storage.

Parameters:
type - the type of AdfUserActivityInfo object.
Return:
Object

setClientEndTime

public Object setClientEndTime(Object clientEndTime)

Sets the client end time.

Parameters:
clientEndTime  
Return:
Object

setClientStartTime

public Object setClientStartTime(Object clientStartTime)

Sets the client start time.

Parameters:
clientStartTime  
Return:
Object

setContextId

public Object setContextId(Object contextId)

Sets the context id.

Parameters:
contextId  
Return:
Object

setEventInfo

public Object setEventInfo(String eventType,
                           Object clientId,
                           String componentType,
                           String compDisplayName)

Sets the event info. Also determines the region info for the current event component.

Parameters:
eventType - type of the event
clientId  
componentType - type of the component
compDisplayName - displayName of the component
Return:
Object

setParentContextId

public Object setParentContextId(Object parentContextId)

Sets the parent context id.

Parameters:
parentContextId  
Return:
Object

setPprTargets

public Object setPprTargets(Object pprTargets)

Sets the Partial targets.

Parameters:
pprTargets  
Return:
Object

setRequestSentTime

public static Object setRequestSentTime(String type)

Sets the time the PPR request was sent. For streaming request this is when the streaming reponse was initiated. See AdfDhtmlPage#streamingResponseStarted and AdfXmlHttpDataTransferService.

Parameters:
type - the type of user request.
Return:
Object

setResponseReceivedTime

public static Object setResponseReceivedTime(String type)

Sets the end time response was received. For streaming requests this is when the streaming reponse has been written. See AdfDhtmlPage#streamingResponseWritten.

Parameters:
type - the type of user request.
Return:
Object

setResponseTime

public String setResponseTime(Object responseEndTime)

Sets the end time when a PPR response was received on the client. For streaming request this reperesnts the time when all streaming response has been written. This also does not include the client response processing time.

Parameters:
responseEndTime  
Return:
String - responseEndTime

_setSessionStorageProperty

private static Boolean _setSessionStorageProperty(String propKey,
                                                  String propValue)

Attempts to set the propValue into the agent specific sessionStorage. If agent code throws an error this method logs a message and returns a boolean false.

Parameters:
propKey - a non-null key. Callers are expected to pass a valid propKey
propValue - a non-null value. Callers are expected to pass a valid propValue
Return:
Boolean - true if the value was set into sessionStorage, false otherwise

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.