int priority = event.getPriority();
String resourceFilter, int eventPriority, Event event) int priority = event.getPriority();
/** * Do the notification. * * @param notification * The notification responding to the event. * @param event * The event that matched criteria to cause the notification. */ public void notify(Notification notification, Event event) { reNotify(notification.getId(), notification.getResourceFilter(), event.getPriority(), event); }
/** * Get the user's notification option for this... one of the NotificationService's PREF_ settings */ protected int getOption(User user, Notification notification, Event event) { return getOption(user, notification.getId(), notification.getResourceFilter(), event .getPriority(), event); }
/** * Filter the recipients Users into the list of those who get this one immediately. Combine the * event's notification priority with the user's notification profile. Alias call to * {@link immediateRecipients(List<String>, String, String, int)} * * @param recipients * The List (User) of potential recipients. * @param notification * The notification responding to the event. * @param event * The event that matched criteria to cause the notification. * @return The List (User) of immediate recipients. */ protected List immediateRecipients(List recipients, Notification notification, Event event) { return immediateRecipients(recipients, notification.getId(), notification.getResourceFilter(), event.getPriority(), event); }
/** * Filter the recipients Users into the list of those who get this one by digest. Combine the * event's notification priority with the user's notification profile. Alias call to * {@link digestRecipients(List, String, String, int)} * * @param recipients * The List (User) of potential recipients. * @param notification * The notification responding to the event. * @param event * The event that matched criteria to cause the notification. * @return The List (User) of digest recipients. */ protected List digestRecipients(List recipients, Notification notification, Event event) { return digestRecipients(recipients, notification.getId(), notification.getResourceFilter(), event.getPriority(), event); }
String priStr = Integer.toString(event.getPriority());
/** * 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()); }