001/* 002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Florent Guillaume 016 */ 017package org.nuxeo.ecm.core.event; 018 019/** 020 * Post-commit listener that can decide synchronously whether it's worth calling. 021 * <p> 022 * This is useful if there are quick decisions that can be made synchronously, and to avoid creating useless thread 023 * work. 024 * 025 * @since 5.6 026 */ 027public interface PostCommitFilteringEventListener extends PostCommitEventListener { 028 029 /** 030 * Checks if this event is worth passing to the asynchronous {@link #handleEvent}. 031 * <p> 032 * Note that the event's documents are usually <strong>disconnected</strong> into 033 * {@link org.nuxeo.ecm.core.event.impl.ShallowDocumentModel ShallowDocumentModel} instances, which means that this 034 * method may not be able to get to all the information it would get from a standard DocumentModel implementation. 035 * If there is not enough information in the ShallowDocumentModel to decide whether this event is of interest, then 036 * this method should accept it an let the actual logic done in {@link #handleEvent} do the final filtering. 037 * 038 * @param event the event 039 * @return {@code true} to accept it, or {@code false} to ignore it 040 * @since 5.6 041 */ 042 boolean acceptEvent(Event event); 043 044}