org.activemath.events
Class ActivemathEvent

java.lang.Object
  extended by org.activemath.events.ActivemathEvent
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
ApplicationShutdownEvent, ApplicationStartupEvent, AssessmentResultEvent, AuthoringInterfaceEvent, BeliefUpdateEvent, ClipTransferEvent, DictSearchedEvent, ExerciseActionEvent, ExerciseFinishedEvent, ExerciseHelpRequestEvent, ExerciseHintProvisionEvent, ExerciseRunEvent, ExerciseSequencerFinishedEvent, ExerciseSequencerStartedEvent, ExerciseStartedEvent, ExerciseStepEvent, FocusChangedEvent, HappinessEvent, ItemMenuContentAddedEvent, ItemMenuContentRemovedEvent, ItemPresentedEvent, ItemSeenEvent, MasteryChangedEvent, MBaseCollectionsChangedEvent, NoteCreatedEvent, NoteDeletedEvent, NoteModifiedEvent, NotePresentedEvent, PagePresentedEvent, ReportRequestedEvent, SelfAssessmentEvent, SelfReportEvent, SimulationExerciseStepEvent, SurveySubmittedEvent, ToolStartedEvent, TutorialInteractionEvent, UrlRequestedEvent, UserBookDeletedEvent, UserBookPlannedEvent, UserBookRenamedEvent, UserBookUploadedEvent, UserCreatedEvent, UserFeedbackEvent, UserLoggedInEvent, UserLoggedOutEvent, UserPropertyChangedEvent, UserRemovedEvent, ViewPresentedEvent, WindowClosedEvent

public class ActivemathEvent
extends Object
implements Serializable, Comparable

Abstract base class for Activemath events.

Each event has the following attributes:

Concrete subclasses must be used for each event type. Note: This class is no longer formally abstract, although it still should be treated as such. This was necessary to fix Hibernate queries on broken event databases (AMATH-1177).

See Also:
Serialized Form

Field Summary
protected  String bookId
           
protected  String groupId
           
protected  long id
          Id of event (defaults to -1)
protected  String itemId
           
protected  String sessionId
           
protected  Object source
          Source/producer of event
protected  long timestamp
          System time when the event happened
protected  String type
          Type of event ("LoggedIn", "StartExercise", ...)
protected  String userId
           
 
Constructor Summary
ActivemathEvent()
           
ActivemathEvent(String type)
          Create a new event.
 
Method Summary
 int compareTo(Object o)
          Order events.
 void dispatchFinished()
          A hook for event generators to indicate that the dispatch of the event is finished.
 String getGroupId()
           
 long getId()
           
 String getItemId()
           
 Object getSource()
           
 long getTimestamp()
           
 String getType()
           
 void setGroupId(String value)
           
 void setId(long id)
           
 void setItemId(String value)
           
 void setSource(Object source)
           
 void setTimestamp(long timestamp)
          Allow manual override of timestamp
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected String type
Type of event ("LoggedIn", "StartExercise", ...)


timestamp

protected long timestamp
System time when the event happened


source

protected Object source
Source/producer of event


id

protected long id
Id of event (defaults to -1)


userId

protected String userId

groupId

protected String groupId

sessionId

protected String sessionId

itemId

protected String itemId

bookId

protected String bookId
Constructor Detail

ActivemathEvent

public ActivemathEvent()

ActivemathEvent

public ActivemathEvent(String type)
Create a new event.

timestamp is initialized with current system time.

Method Detail

getType

public String getType()
Returns:
Returns the type of this event

getTimestamp

public long getTimestamp()
Returns:
Returns the timestamp when this event was created

setTimestamp

public void setTimestamp(long timestamp)
Allow manual override of timestamp

Parameters:
timestamp - - the timestamp to set.

getSource

public Object getSource()
Returns:
Returns the source.

setSource

public void setSource(Object source)
Parameters:
source - The source to set.

getId

public long getId()
Returns:
Returns the id.

setId

public void setId(long id)
Parameters:
id - The id to set.

getGroupId

public String getGroupId()

setGroupId

public void setGroupId(String value)

getItemId

public String getItemId()

setItemId

public void setItemId(String value)

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
Order events.

Event order is defined by .

Specified by:
compareTo in interface Comparable

dispatchFinished

public void dispatchFinished()
A hook for event generators to indicate that the dispatch of the event is finished.