/* (non-Javadoc)
  * @see org.sakaiproject.sitestats.impl.event.EventRegistryService#getAnonymousEventIds()
  */
 public Set<String> getAnonymousEventIds() {
   if (anonymousToolEventIds == null) {
     anonymousToolEventIds = new HashSet<String>();
     for (ToolInfo ti : getEventRegistry()) {
       for (EventInfo ei : ti.getEvents()) {
         if (ei.isAnonymous()) {
           anonymousToolEventIds.add(ei.getEventId());
         }
       }
     }
     anonymousToolEventIds = Collections.unmodifiableSet(anonymousToolEventIds);
   }
   return anonymousToolEventIds;
 }
 /* (non-Javadoc)
  * @see org.sakaiproject.sitestats.impl.event.EventRegistryService#getEventIdToolMap()
  */
 public Map<String, ToolInfo> getEventIdToolMap() {
   if (eventIdToolMap == null) {
     eventIdToolMap = new HashMap<String, ToolInfo>();
     Iterator<ToolInfo> i = getMergedEventRegistry().iterator();
     while (i.hasNext()) {
       ToolInfo t = i.next();
       Iterator<EventInfo> iE = t.getEvents().iterator();
       while (iE.hasNext()) {
         EventInfo e = iE.next();
         eventIdToolMap.put(e.getEventId(), t);
       }
     }
   }
   return eventIdToolMap;
 }
  private void processStatisticableProvider(Statisticable provider) {
    String entityPrefix = provider.getEntityPrefix();
    String entityToolId = provider.getAssociatedToolId();
    String[] entityEventIds = provider.getEventKeys();

    // Build tool for Event Registry (List<ToolInfo>)
    ToolInfo tool = new ToolInfo(entityToolId);
    tool.setSelected(true);
    for (String eventId : entityEventIds) {
      EventInfo event = new EventInfo(eventId);
      event.setSelected(true);
      // Add to eventID -> entityProfider_prefix mapping
      eventIdToEPPrefix.put(eventId, entityPrefix);
      tool.addEvent(event);
    }
    eventRegistry.add(tool);

    // Set expired flag on EventRegistry to true
    setChanged();
    notifyObservers(EventRegistryService.NOTIF_EVENT_REGISTRY_EXPIRED);
  }
Пример #4
0
 public EventModel(EventInfo e) {
   this.eventId = e.getEventId();
   this.eventName = Locator.getFacade().getEventRegistryService().getEventName(this.eventId);
 }