public void notify(Notification notification, Event event) { removeSessionPresence(event.getSessionId()); }
/** * Cause this new event to get to wherever it has to go for persistence, etc. * * @param event * The new event to post. */ protected void postEvent(Event event) { String reportId = null; if (event.getSessionId() != null) { reportId = event.getSessionId(); } else { reportId = "~" + event.getUserId(); } log.info(m_logId + reportId + "@" + event); // notify observers, sending the event notifyObservers(event, true); } }
public LRS_Actor getActor(Event event) { String userId = null; if (event != null) { userId = event.getUserId(); } if (userId == null && event != null && event.getSessionId() != null) { Session session = this.sessionManager.getSession(event.getSessionId()); if (session != null) { userId = session.getUserId(); } } return getActor(userId); }
log.debug("No userId for event, getting from the UsageSession instead: " + e.getEvent()); UsageSession session = usageSessionService.getSession(e.getSessionId()); if(session != null) { userId = session.getUserId();
/** Method called whenever an new event is generated from EventTrackingService: do not call this method! */ public void update(Observable obs, Object o) { // At the moment this isn't threadsafe, but as sakai event handling is single threaded this shoudn't be a problem, // but it's not a formal contract. if(o instanceof Event){ Event e = (Event) o; Event eventWithPreciseDate = buildEvent(getToday(), e.getEvent(), e.getResource(), e.getContext(), e.getUserId(), e.getSessionId()); collectThreadQueue.add(eventWithPreciseDate); } }
if (event.getSessionId() != null) reportId = event.getSessionId();
UsageSession session = M_uss.getSession(e.getSessionId()); if(session != null) { userId = session.getUserId(); UsageSession session = M_uss.getSession(e.getSessionId()); if(session != null) { userId = session.getUserId();
/** * Ensure that the provided event is an instance of BaseEvent. If not, create a new BaseEvent * and transfer state. * * @param e * @return */ protected BaseEvent ensureBaseEvent(Event e) { BaseEvent event = null; if (e instanceof BaseEvent) { event = (BaseEvent) e; } else { event = new BaseEvent(e.getEvent(), e.getResource(), e.getModify(), e.getPriority(),null); event.setSessionId(e.getSessionId()); event.setUserId(e.getUserId()); } return event; }
/** * Constructor * * Converts an Event object into a SimpleEvent object * in order to be serializable for distribution * * @param event the event object * @param serverId the server id this event originated from */ public SimpleEvent(Event event, String serverId) { if (event == null) { throw new IllegalArgumentException("The SimpleEvent event cannot be null."); } if (serverId == null) { throw new IllegalArgumentException("The SimpleEvent serverId cannot be null."); } setEvent(event.getEvent()); setResource(event.getResource()); setSessionId(event.getSessionId()); setUserId(event.getUserId()); setContext(event.getContext()); setModify(event.getModify()); setPriority(event.getPriority()); setEventTime(event.getEventTime()); setServerId(serverId); setLRSStatement(event.getLrsStatement()); }
/** * Constructor * * Converts an Event object into a SimpleEvent object * in order to be serializable for distribution * * @param event the event object * @param serverId the server id this event originated from */ public SimpleEvent(Event event, String serverId) { if (event == null) { throw new IllegalArgumentException("The SimpleEvent event cannot be null."); } if (serverId == null) { throw new IllegalArgumentException("The SimpleEvent serverId cannot be null."); } setEvent(event.getEvent()); setResource(event.getResource()); setSessionId(event.getSessionId()); setUserId(event.getUserId()); setContext(event.getContext()); setModify(event.getModify()); setPriority(event.getPriority()); setEventTime(event.getEventTime()); setServerId(serverId); setLRSStatement(event.getLrsStatement()); }