## org.exist.collections.triggers
Interface CollectionTrigger

All Superinterfaces:
  Trigger

public interface CollectionTrigger
extends Trigger

Interface for triggers that can be registered with collection-related events.

Author:
  wolf

Field Summary

Fields inherited from interface org.exist.collections.triggers.Trigger
`CREATE_COLLECTION_EVENT, DELETE_COLLECTION_EVENT, REMOVE_DOCUMENT_EVENT, RENAME_COLLECTION_EVENT, STORE_DOCUMENT_EVENT, UPDATE_DOCUMENT_EVENT`

Method Summary
`void` `finish(int event, DBBroker broker, Txn transaction, Collection collection, java.lang.String newName)` This method is called after the operation has completed.
`void` `prepare(int event, DBBroker broker, Txn transaction, Collection collection, java.lang.String newName)` This method is called once before the database will actually create, remove or rename a collection.

Methods inherited from interface org.exist.collections.triggers.Trigger
`configure, getLogger`

Method Detail

### prepare

    public void prepare(int event,
                        DBBroker broker,
                        Txn transaction,
                        Collection collection,
                        java.lang.String newName)
                 throws TriggerException

  This method is called once before the database will actually create, remove or rename a collection. You may take any action here, using the supplied broker instance.

  Parameters:
    `event` - the type of event that triggered this call (see the constants defined in this interface).
    `broker` - the database instance used to process the current action.
    `collection` - the `Collection` which fired this event.
    `newName` - optional: if event is a `Trigger.RENAME_COLLECTION_EVENT`, this parameter contains the new name of the collection. It is null otherwise.
  Throws:
    `TriggerException` - throwing a TriggerException will abort the current action.

### finish

    public void finish(int event,
                       DBBroker broker,
                       Txn transaction,
                       Collection collection,
                       java.lang.String newName)

  This method is called after the operation has completed.

Copyright (C) Wolfgang Meier. All rights reserved.