org.jasig.portal.events.handlers.db
Class JpaPortalEventStore

java.lang.Object
  extended by org.jasig.portal.events.handlers.AbstractLimitedSupportEventHandler
      extended by org.jasig.portal.events.handlers.db.JpaPortalEventStore
All Implemented Interfaces:
BatchingEventHandler, EventHandler, IPortalEventStore

@Repository
public class JpaPortalEventStore
extends AbstractLimitedSupportEventHandler
implements BatchingEventHandler, IPortalEventStore

Stores portal events using JPA/Hibenate no internall batch segementation is done to the passed list of PortalEvents. If a PortalEvent is not mapped as a persistent entity a message is logged at the WARN level and the event is ignored.

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
protected  org.apache.commons.logging.Log logger
           
protected static String STATS_SESSION_ID_PERSON_ATTR
           
 
Constructor Summary
JpaPortalEventStore()
           
 
Method Summary
protected  EventType findExistingEventType(EventType eventType)
          Contains the logic to query for an already persisted EventType with the same type value.
 EntityManager getEntityManager()
           
protected  StatsSession getStatsSession(IPerson person)
          Gets a StatsSession object for the specified person, creating, populating and persisting it if needed
 void handleEvent(PortalEvent event)
          Method to handle any processing of the event that is needed.
 void handleEvents(PortalEvent... events)
          Method to handle any processing of an array of events that is needed.
 boolean isLogSessionGroups()
           
 void setEntityManager(EntityManager entityManager)
           
 void setLogSessionGroups(boolean logSessionGroups)
          If group keys should be included in the stats session.
 void storePortalEvents(PortalEvent... portalEvents)
           
protected  void updateStatsSessionGroups(StatsSession session, IPerson person)
          Sets the StatsSession.setGroups(Set) using the keys from the IGroupMembers returned by IGroupMember.getAllContainingGroups()
 
Methods inherited from class org.jasig.portal.events.handlers.AbstractLimitedSupportEventHandler
getIgnoredUserNames, getSupportedEvents, getSupportedUserNames, isExplicitMatching, isRequireAll, isSupportGuest, setExplicitMatching, setIgnoredUserNames, setRequireAll, setSupportedEvents, setSupportedUserNames, setSupportGuest, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.portal.events.EventHandler
supports
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

STATS_SESSION_ID_PERSON_ATTR

protected static final String STATS_SESSION_ID_PERSON_ATTR
Constructor Detail

JpaPortalEventStore

public JpaPortalEventStore()
Method Detail

getEntityManager

public EntityManager getEntityManager()
Returns:
the entityManager

setEntityManager

public void setEntityManager(EntityManager entityManager)
Parameters:
entityManager - the entityManager to set

isLogSessionGroups

public boolean isLogSessionGroups()
Returns:
the logSessionGroups

setLogSessionGroups

public void setLogSessionGroups(boolean logSessionGroups)
If group keys should be included in the stats session. This can be disabled to reduce the ammount of data stored in the stats tables.

Parameters:
logSessionGroups - the logSessionGroups to set

handleEvent

public void handleEvent(PortalEvent event)
Description copied from interface: EventHandler
Method to handle any processing of the event that is needed.

Specified by:
handleEvent in interface EventHandler
Parameters:
event - the event to handle.

handleEvents

public void handleEvents(PortalEvent... events)
Description copied from interface: BatchingEventHandler
Method to handle any processing of an array of events that is needed.

Specified by:
handleEvents in interface BatchingEventHandler
Parameters:
events - the events to handle.

storePortalEvents

public void storePortalEvents(PortalEvent... portalEvents)
Specified by:
storePortalEvents in interface IPortalEventStore

getStatsSession

protected StatsSession getStatsSession(IPerson person)
Gets a StatsSession object for the specified person, creating, populating and persisting it if needed


updateStatsSessionGroups

protected void updateStatsSessionGroups(StatsSession session,
                                        IPerson person)
                                 throws GroupsException
Sets the StatsSession.setGroups(Set) using the keys from the IGroupMembers returned by IGroupMember.getAllContainingGroups()

Throws:
GroupsException

findExistingEventType

protected EventType findExistingEventType(EventType eventType)
Contains the logic to query for an already persisted EventType with the same type value.



Copyright © 2010 Jasig. All Rights Reserved.