/*
 * Created on 2004-5-29
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.store.spi;

import java.util.Iterator;

import workflow.wfmc.pm.Department;
import workflow.wfmc.pm.Group;
import workflow.wfmc.pm.Participant;
import workflow.wfmc.pm.Role;

/**
 * @author Administrator
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public interface SpiUserDatabase extends SpiDatabase
{ 
	// ------------------------------------------------------------- Properties
	 /**
		* Return the set of {@link Group}s defined in this user database.
		*/
	 public Iterator getGroups();

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

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


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

	 /**
		* Create and return a new {@link Group} defined in this user database.
		*
		* @param groupid    The group id of the new group (must be unique)
		* @param groupname   The group name of the new group
		* @param description The description of this group
		*/
	 public Group createGroup(String groupid, String groupname,String description);

	 /**
		* Create and return a new {@link Department} defined in this user database.
		*
		* @param departmentid     The department id of the new group (must be unique)
		* @param departmentname   The department name of the new group
		* @param description      The description of this department
		*/
	 public Department createDepartment(String departmentid, String departmentname,String description);


	 /**
		* Create and return a new {@link Role} defined in this user database.
		*
		* @param roleid      The role id of the new group (must be unique)
		* @param rolename    The role name of the new group
		* @param description The description of this role
		*/
	 public Role createRole(String roleid, String rolename,String description);


	 /**
		* Create and return a new {@link Participant} defined in this user database.
		*
		* @param userid   The logon userid of the new user (must be unique)
		* @param username The logon username of the new user 
		* @param password The logon password of the new user
		* @param fullName The full name of the new user
		*/
	 public Participant createParticipant(String userid,String username, String password,String fullName);


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


	 /**
		* Return the {@link Department} with the specified Department id, if any;
		* otherwise return <code>null</code>.
		*
		* @param departementid id of the Department to return
		*/
	 public Department findDepartment(String departementid);
	
	 /**
		* Return the {@link Role} with the specified role id, if any;
		* otherwise return <code>null</code>.
		*
		* @param roleid id of the Role to return
		*/
	 public Role findRole(String roleid);
	
	 /**
		* Return the {@link Participant} with the specified user name, if any;
		* otherwise return <code>null</code>.
		*
		* @param userid jName of the user to return
		*/
	 public Participant findParticipant(String userid);


	 /**
		* Remove the specified {@link Group} from this user database.
		*
		* @param group The group to be removed
		*/
	 public void removeGroup(Group group);


	 /**
		* Remove the specified {@link Department} from this user database.
		*
		* @param departement The departement to be removed
		*/
	 public void removeDepartment(Department departement);
	
	 /**
		* Remove the specified {@link Role} from this user database.
		*
		* @param role The role to be removed
		*/
	 public void removeRole(Role role);
	
	 /**
		* Remove the specified {@link Participant} from this user database.
		*
		* @param user The user to be removed
		*/
	 public void removeParticipant(Participant user); 
}
