package com.dbxml.db.core;

/*
 * dbXML - Native XML Database
 * Copyright (C) 1999-2004  The dbXML Group, L.L.C.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: DatabaseEventListener.java,v 1.2 2004/02/12 00:17:56 bradford Exp $
 */

import com.dbxml.db.core.Collection;

/**
 * DatabaseEventListener is an interface that can be implemented by a
 * class and registered with a Database instance in order to listen for
 * various events.  Such events may effect the management of processes
 * like system security.  These events might include Collection creation
 * and deletion.
 */

public interface DatabaseEventListener {
   /**
    * createCollection is called by the Database when a Collection is
    * created.  This event will give the event listener an opportunity
    * to perform tasks such as assign default permissions for the creating
    * User.
    *
    * @param collection The Collection that was created
    */
   void createCollection(Collection collection);
   
   /**
    * dropCollection is called by the Database when a Collection is
    * dropped.  This event will give the event listener to perform
    * some housecleaning, such as removing permissions for a path
    * that no longer exists.
    *
    * @param collection The Collection that was dropped
    */
   void dropCollection(Collection collection);
}


