© 2002 BEA Systems, Inc.


com.bea.p13n.tracking
Class TrackingEventHelper

java.lang.Object
  |
  +--com.bea.p13n.tracking.TrackingEventHelper

public class TrackingEventHelper
extends java.lang.Object

Helper methods for dispatching Behavior Tracking events to the Event Service. This class implements the singleton pattern.

See Also:
#getInstance

Constructor Summary
TrackingEventHelper()
           
 
Method Summary
static void dispatchEvent(Event theEvent)
          Deprecated. Use EventService.dispatchEvent(Event theEvent).
static void dispatchEvent(EventService eventService, Event evt)
          Fire the event, passing in the reference of the EventService EJB.
static void dispatchEvent(javax.servlet.http.HttpServletRequest theRequest, Event theEvent)
          Dispatch an event using an EventService that is cached in theRequest.
static void dispatchSessionLoginEvent(javax.servlet.http.HttpServletRequest theRequest)
          Utility method to dispatch a SessionLoginEvent for the user logged into the given servlet request, if it hasn't been done already.
static void dispatchSessionLoginEvent(javax.servlet.http.HttpServletRequest theRequest, java.lang.String userId)
          Utility method to dispatch a SessionLoginEvent for the specified userId, if it hasn't been done already.
static void dispatchUserRegistrationEvent(javax.servlet.http.HttpServletRequest theRequest)
          Utility method to dispatch a UserRegistrationEvent for the user logged into the given servlet request, if it hasn't been done already.
static void dispatchUserRegistrationEvent(javax.servlet.http.HttpServletRequest theRequest, java.lang.String userId)
          Utility method to dispatch a UserRegistrationEvent for the specified user, if it hasn't been done already.
static EventService getEventService()
          Get an instance of the EventService EJB.
static EventService getEventService(javax.servlet.http.HttpServletRequest theRequest)
          Get a new event service instance and set it in theRequest for later event dispatching.
static EventService getEventService(java.lang.String lookup)
          Get an instance of the EventService EJB.
static java.lang.String getUserId(javax.servlet.http.HttpServletRequest req)
          Return the user id of the currently logged in user (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackingEventHelper

public TrackingEventHelper()
Method Detail

dispatchEvent

public static void dispatchEvent(Event theEvent)
Deprecated. Use EventService.dispatchEvent(Event theEvent).
Dispatch an event, looking up the EventService EJB each time. It is recommended that the caller instead get an instance of the EventServiceBean using TrackingEventHelperImpl.getEventService(), then call TrackingEventHelperImpl.dispatchEvent() with with that EventServiceBean.

To enable debugging for monitoring event firing, set this in debug.properties:

com.bea.p13n.tracking.TrackingEventHelperImpl: on


dispatchEvent

public static void dispatchEvent(EventService eventService,
                                 Event evt)
Fire the event, passing in the reference of the EventService EJB. To enable debugging for monitoring event firing, set this in debug.properties:

com.bea.p13n.tracking.TrackingEventHelperImpl: on


dispatchEvent

public static void dispatchEvent(javax.servlet.http.HttpServletRequest theRequest,
                                 Event theEvent)
Dispatch an event using an EventService that is cached in theRequest. To enable debugging for monitoring event firing, set this in debug.properties:

com.bea.p13n.tracking.TrackingEventHelperImpl: on


getEventService

public static EventService getEventService()
                                    throws java.lang.Exception
Get an instance of the EventService EJB. This class (Helper) should not be responsible for caching instances of the EventService EJB. That should be done by the calling application.

This API will use the ApplicationHelper to get the application name and prepend it to .BEA_personalization.EventService to do the JNDI lookup. If the JNDI lookup name is known (such as an ejb-ref), then use the getEventService(String lookup) API.


getEventService

public static EventService getEventService(java.lang.String lookup)
                                    throws java.lang.Exception
Get an instance of the EventService EJB. This class (Helper) should not be responsible for caching instances of the EventService EJB. That should be done by the calling application.

This API will use the ApplicationHelper to get the application name and prepend it to .BEA_personalization.EventService to do the JNDI lookup. If the JNDI lookup name is not known, then use the getEventService() API.

Parameters:
lookup - The JNDI lookup name

getEventService

public static EventService getEventService(javax.servlet.http.HttpServletRequest theRequest)
                                    throws java.rmi.RemoteException,
                                           java.lang.Exception
Get a new event service instance and set it in theRequest for later event dispatching.

getUserId

public static java.lang.String getUserId(javax.servlet.http.HttpServletRequest req)
Return the user id of the currently logged in user (i.e. the user associated to the thread, not neccessarily the request's remote user).

dispatchSessionLoginEvent

public static void dispatchSessionLoginEvent(javax.servlet.http.HttpServletRequest theRequest,
                                             java.lang.String userId)
Utility method to dispatch a SessionLoginEvent for the specified userId, if it hasn't been done already.

Parameters:
theRequest - the http servlet request the event is generating from.
userId - the user id to generate the event for.

dispatchSessionLoginEvent

public static void dispatchSessionLoginEvent(javax.servlet.http.HttpServletRequest theRequest)
Utility method to dispatch a SessionLoginEvent for the user logged into the given servlet request, if it hasn't been done already.

Parameters:
theRequest - the http servlet request the event is generating from.
See Also:
getUserId(javax.servlet.http.HttpServletRequest)

dispatchUserRegistrationEvent

public static void dispatchUserRegistrationEvent(javax.servlet.http.HttpServletRequest theRequest,
                                                 java.lang.String userId)
Utility method to dispatch a UserRegistrationEvent for the specified user, if it hasn't been done already.

Parameters:
theRequest - the http servlet request the event is generating from.
userId - the user id to generate the event for.

dispatchUserRegistrationEvent

public static void dispatchUserRegistrationEvent(javax.servlet.http.HttpServletRequest theRequest)
Utility method to dispatch a UserRegistrationEvent for the user logged into the given servlet request, if it hasn't been done already.

Parameters:
theRequest - the http servlet request the event is generating from.
See Also:
getUserId(javax.servlet.http.HttpServletRequest)

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved