//----------------------------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.workflow.store;

import java.util.Iterator;

import org.huihoo.workflow.*;
import org.huihoo.workflow.server.WorkflowSession;
import org.huihoo.workflow.usermodel.WorkflowDepartment;
import org.huihoo.workflow.usermodel.WorkflowGroup;
import org.huihoo.workflow.usermodel.WorkflowParticipant;
import org.huihoo.workflow.usermodel.WorkflowRole;

public interface WorkflowUserDatabase extends WorkflowDatabase
{

//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
	public WorkflowTemplate getWorkflowTemplate();
	public void setWorkflowTemplate(WorkflowTemplate workflowTemplate);

//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------

	/**
	 * Return the set of {@link WorkflowGroup}s defined in this user database.
	 */
	public Iterator getGroups(WorkflowSession workflowSession);

	/**
	 * Return the set of {@link WorkflowDepartment}s defined in this user database.
	 */
	public Iterator getDepartments(WorkflowSession workflowSession);

 /**
	* Return the set of {@link WorkflowRole}s defined in this user database.
	*/
	public Iterator getRoles(WorkflowSession workflowSession);

	/**
	 * Return the set of {@link WorkflowParticipant}s defined in this user database.
	 */
	public Iterator getParticipants(WorkflowSession workflowSession);

	/**
	 * Return the {@link WorkflowGroup} with the specified group id, if any;
	 * otherwise return <code>null</code>.
	 *
	 * @param groupid id of the WorkflowGroup to return
	 */
	public WorkflowGroup findGroup(WorkflowSession workflowSession, String groupid);

	/**
	 * Return the {@link WorkflowDepartment} with the specified Department id, if any;
	 * otherwise return <code>null</code>.
	 *
	 * @param departementid id of the WorkflowDepartment to return
	 */
	public WorkflowDepartment findDepartment(WorkflowSession workflowSession, String departementid);

	/**
	 * Return the {@link WorkflowRole} with the specified role id, if any;
	 * otherwise return <code>null</code>.
	 *
	 * @param roleid id of the WorkflowRole to return
	 */
	public WorkflowRole findRole(WorkflowSession workflowSession, String roleid);

	/**
	 * Return the {@link WorkflowParticipant} with the specified user name, if any;
	 * otherwise return <code>null</code>.
	 *
	 * @param userid id of the WorkflowParticipant to return
	 */
	public WorkflowParticipant findParticipant(WorkflowSession workflowSession, String userid);
}
