//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010  huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/willow
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : willow@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.willow;

import java.beans.PropertyChangeListener;

import org.huihoo.workflow.usermodel.WorkflowParticipant;

public interface RealmDatabase
{

	// ------------------------------------------------------------- Properties


	/**
	 * Return the Container with which this Realm has been associated.
	 */
	public Container getContainer();


	/**
	 * Set the Container with which this Realm has been associated.
	 *
	 * @param container The associated Container
	 */
	public void setContainer(Container container);


	/**
	 * Return descriptive information about this Realm implementation and
	 * the corresponding version number, in the format
	 * <code>&lt;description&gt;/&lt;version&gt;</code>.
	 */
	public String getInfo();


	// --------------------------------------------------------- Public Methods


	/**
	 * Return the WorkflowParticipant associated with the specified username and
	 * credentials, if there is one; otherwise return <code>null</code>.
	 *
	 * @param username Username of the WorkflowParticipant to look up
	 * @param credentials Password or other credentials to use in
	 *  authenticating this username
	 */
	public WorkflowParticipant authenticate(String username, String credentials);
	
    
	/**
	 * Add a property change listener to this component.
	 *
	 * @param listener The listener to add
	 */
	public void addPropertyChangeListener(PropertyChangeListener listener);
	
	/**
	 * Remove a property change listener from this component.
	 *
	 * @param listener The listener to remove
	 */
	public void removePropertyChangeListener(PropertyChangeListener listener);

}
