//----------------------------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.desktop;

import java.rmi.RemoteException;
import java.util.Iterator;

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 UserDatabase  extends RemoteDatabase
{
	//------------------------------------------------------------------------------------
	// WorkflowImplementation  utilities   
	//------------------------------------------------------------------------------------                                        
	public WorkflowImplementation getWorkflowImplementation() throws RemoteException;
	

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

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

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


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


	/**
	 * Return the {@link WorkflowDepartment} with the specified Department id, if any;
	 * otherwise return <code>null</code>.
	 *
	 * @param departementid id of the Department to return
	 */
	public WorkflowDepartment findDepartment(String departementid)throws RemoteException;
	
	/**
	 * 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(String roleid)throws RemoteException;
	
  /**
   * Return the {@link WorkflowParticipant} with the specified user name, if any;
   * otherwise return <code>null</code>.
   *
   * @param userid userid of the user to return
   */
  public WorkflowParticipant findParticipant(String userid)throws RemoteException;
 
}
