public void rollback(EventLog el) { if (excludes.contains(el.getEntityType())) { if (log.isDebugEnabled()) { log.debug("Skipping rollback of " + el.getEntityType()); } } backlog.add(el); }
/** * Removes and returns the next {@link EventLog} instance or null if none is * present. Also cleans up any tracking information for the given * {@link EventLog}. * * @return See above. */ public synchronized EventLog remove() { if (logs.size() == 0) { contained.clear(); return null; // EARLY EXIT } adding = false; EventLog log = logs.remove(0); // None of these can be null as long as the log is still contained Map<String, Set<String>> class2action = contained .get(log.getEntityId()); Set<String> actions = class2action.get(log.getEntityType()); assert actions.remove(log.getAction()); if (actions.size() == 0) { class2action.remove(log.getEntityType()); if (class2action.size() == 0) { contained.remove(log.getEntityId()); } } return log; }
logger.info("Backlog locked:" + log.getEntityType() + ":Id_" + log.getEntityId()); if (log == null || log.getEntityType() == null || log.getEntityId() == null || log.getAction() == null) { throw new IllegalArgumentException( Set<String> actions = class2action.get(log.getEntityType()); if (actions == null) { actions = new HashSet<String>(); class2action.put(log.getEntityType(), actions); if (contained) { if (logger.isInfoEnabled()) { logger.info("Already in backlog:" + log.getEntityType() + ":Id_" + log.getEntityId()); logs.add(log); if (logger.isInfoEnabled()) { logger.info("Added to backlog:" + log.getEntityType() + ":Id_" + log.getEntityId());
@Override public Object retrieve(String field) { if (field == null) { return null; } else if (field.equals(ID)) { return getId(); } else if (field.equals(ENTITYID)) { return getEntityId(); } else if (field.equals(ENTITYTYPE)) { return getEntityType(); } else if (field.equals(ACTION)) { return getAction(); } else if (field.equals(EVENT)) { return getEvent(); } else if (field.equals(DETAILS)) { return getDetails(); } else { if (_dynamicFields != null) { return _dynamicFields.get(field); } return null; } }
public void clearLogs() { if (log.isDebugEnabled()) { log.debug("Clearing EventLogs."); } List<EventLog> logs = getLogs(); if (!logs.isEmpty()) { boolean foundAdminType = false; final Multimap<String, EventLog> map = ArrayListMultimap.create(); for (EventLog el : getLogs()) { String t = el.getEntityType(); if (Experimenter.class.getName().equals(t) || ExperimenterGroup.class.getName().equals(t) || GroupExperimenterMap.class.getName().equals(t)) { foundAdminType = true; } map.put(t, el); } if (ctx == null) { log.error("No context found for publishing"); } else { // publish message if administrative type is modified if (foundAdminType) { this.ctx.publishEvent(new UserGroupUpdateEvent(this)); } this.ctx.publishEvent(new EventLogsMessage(this, map)); } } cd.clearLogs(); }
sb.append(" "); sb.append(eventLog); sb.append(eventLog.getEntityType()); sb.append(" "); sb.append(eventLog.getEntityId()); l.getEntityType(), l.getAction(), l.getEvent().getId() });
protected void handleEventLog(FullTextSession session, EventLog eventLog) { String act = eventLog.getAction(); Class type = asClassOrNull(eventLog.getEntityType()); if (type != null) { long id = eventLog.getEntityId();