FileDocCategorySizeDatePackage
EntryEventMediator.javaAPI DocApache Lucene 2.1.03436Wed Feb 14 10:46:06 GMT 2007org.apache.lucene.gdata.server.registry

EntryEventMediator

public abstract class EntryEventMediator extends Object
This class will be informed about every successful entry event and distributes all event to all registered {@link org.apache.lucene.gdata.server.registry.EntryEventListener}
author
Simon Willnauer

Fields Summary
private final List
entryEventListener
Constructors Summary
Methods Summary
public voidallEntriesDeleted(org.apache.lucene.gdata.data.ServerBaseFeed feed)

param
feed - the feed to delete all entries for

        for (EntryEventListener listener : this.entryEventListener) {
            listener.fireDeleteAllEntries(feed);
        }
    
public voidentryAdded(org.apache.lucene.gdata.data.ServerBaseEntry entry)

param
entry - the added entry

        for (EntryEventListener listener : this.entryEventListener) {
            listener.fireInsertEvent(entry);
        }
    
public voidentryDeleted(org.apache.lucene.gdata.data.ServerBaseEntry entry)

param
entry - the deleted entry

        for (EntryEventListener listener : this.entryEventListener) {
            listener.fireDeleteEvent(entry);
        }
    
public voidentryUpdated(org.apache.lucene.gdata.data.ServerBaseEntry entry)

param
entry - the updated entry

        for (EntryEventListener listener : this.entryEventListener) {
            listener.fireUpdateEvent(entry);
        }
    
public abstract org.apache.lucene.gdata.server.registry.EntryEventMediatorgetEntryEventMediator()

return
- a entry event mediator instance

public booleanisListenerRegistered(EntryEventListener listner)
checks if the listener is already registered.

param
listner - the listener to check
return
true if and only if the given listener is already registered, otherwise false.

        return listner!=null&&this.entryEventListener.contains(listner);
    
public voidregisterEntryEventListener(EntryEventListener listener)
Registers a {@link EntryEventListener}. This listener will be fired if an entry update, insert or delete occurs

param
listener - listener to register


                
       

                                            
         
        if (listener == null || this.entryEventListener.contains(listener))
            return;
        this.entryEventListener.add(listener);