|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mtgi.analytics.BehaviorEvent
public class BehaviorEvent
Applications should generally not have to interact with BehaviorEvent directly.
Represents an action taken directly or indirectly by a user.
Each action is given a getType()
, getName()
,
and application
;
has a start time
and getDuration()
;
and is associated with a user
and session id
representing the user's current authenticated session with the application.
Other data like parameter values can be stored in a semi-structured fashion
in getData()
. Generally the structure of the event data and
the meaning of the getName()
should depend on the type
.
BehaviorEvents may be composed of smaller child events, which themselves
may be composed of child events, and so on; an event's children are
accessed with #getChildren()
.
BehaviorEventManager
,
Serialized FormConstructor Summary | |
---|---|
protected |
BehaviorEvent(BehaviorEvent parent,
String type,
String name,
String application,
String userId,
String sessionId)
|
Method Summary | |
---|---|
EventDataElement |
addData()
Add metadata to this event, if metadata has not already been added. |
protected void |
finalize()
|
String |
getApplication()
Get the name of the application in which this event took place. |
EventDataElement |
getData()
If this event has extra data, it can be accessed here. |
Long |
getDuration()
If this event is finished, return its duration. |
String |
getError()
If this event ended in error, return a description of that error (null otherwise) |
Serializable |
getId()
a unique identifier (e.g. |
String |
getName()
Get the name of the event; for example, a method name for instrumented method calls, or a server request path for an instrumented servlet. |
BehaviorEvent |
getParent()
If this event is a child of a larger composite event, return the event's parent. |
String |
getSessionId()
If this event is part of an authenticated session, return an identifier of that session. |
Date |
getStart()
If this event has started, return the date at which the event began. |
String |
getType()
Get the type of this event. |
String |
getUserId()
Get the user on whose behalf this event is executing. |
protected boolean |
isEnded()
|
protected boolean |
isRoot()
|
protected boolean |
isStarted()
|
void |
setError(String error)
|
void |
setError(Throwable t)
|
void |
setId(Serializable id)
|
protected void |
start()
Notification that this event has started. |
protected void |
stop()
Notification that this event is finished. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BehaviorEvent(BehaviorEvent parent, String type, String name, String application, String userId, String sessionId)
Method Detail |
---|
protected void finalize()
finalize
in class Object
protected void start()
getStart()
will return the time at which the event began.
This method should never be called directly by application code.
IllegalStateException
- if this event is already finished or startedBehaviorTrackingManager.start(BehaviorEvent)
protected void stop()
getDuration()
will return the time elapsed since start()
was called.
This method should never be called directly by application code.
IllegalStateException
- if this event is already finished or was never startedBehaviorTrackingManager.stop(BehaviorEvent)
protected boolean isStarted()
protected boolean isEnded()
protected boolean isRoot()
public String getApplication()
public EventDataElement getData()
addData()
public Long getDuration()
public String getError()
public void setError(Throwable t)
public void setError(String error)
public Serializable getId()
public void setId(Serializable id)
public String getName()
public BehaviorEvent getParent()
public String getSessionId()
public Date getStart()
public String getType()
getName()
should be interpreted. For example,
an event type of "request" could signify that getName()
returns
an HTTP request URL. Generally though type/name schemes are up to the application.
public String getUserId()
public EventDataElement addData()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |