/*
 * Created on 2004-1-22
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.wfmc.pm;

import java.util.Iterator;

import workflow.wfmc.xpdl.XPDLElement;




/**
 * This interface represents the abstract notion of a user, which
 * can be used to represent any entity, such as an individual, a
 * corporation, and a login id.
 *
 *
 * @version 0.1, 04/01/23
 * @author Reic Yang
 */
public interface Participant extends XPDLElement
{ 
  // ------------------------------------------------------------- Properties
	/**
	 * Return the rank of this user.
	 */
	public Rank getRank();


	/**
	 * Set the rank of this user.
	 *
	 * @param userRank The new rank
	 */
	public void setRank(Rank userRank);
	

  /**
   * Return the full name of this user.
   */
  public String getFullName();


  /**
   * Set the full name of this user.
   *
   * @param fullName The new full name
   */
  public void setFullName(String fullName);
	
  /**
   * Return the logon password of this user, optionally prefixed with the
   * identifier of an encoding scheme surrounded by curly braces, such as
   * <code>{md5}xxxxx</code>.
   */
  public String getPassword();


  /**
   * jSet the logon password of this user, optionally prefixed with the
   * identifier of an encoding scheme surrounded by curly braces, such as
   * <code>{md5}xxxxx</code>.
   *
   * @param password The new logon password
   */
  public void setPassword(String password);

	/**
	 * Return the set of {@link Group}s to which this user belongs.
	 */
	public Iterator getGroups();

	/**
	 * Return the set of {@link Role}s to which this user belongs.
	 */
	public Iterator getRoles();
	
	/**
	 * Return the set of {@link Department}s to which this user belongs.
	 */
	public Iterator getDepartments();

	
  // --------------------------------------------------------- Public Methods
	/**
	 * Is this user in the specified Administrator group of WorkflowPackage?
	 *
	 * @param packageID The packageID to check
	 */
	public boolean isAdministrator(String packageID);
	
  /**
   * Add a new {@link Group} to those this user belongs to.
   *
   * @param group The new group
   */
  public void addGroup(Group group);
     
  /**
   * Is this user in the specified {@link Group}?
   *
   * @param group The group to check
   */
  public boolean isInGroup(Group group);


  /**
   * Remove a {@link Group} from those this user belongs to.
   *
   * @param group The old group
   */
  public void removeGroup(Group group);


  /**
   * Remove all {@link Group}s from those this user belongs to.
   */
  public void removeGroups();
  
	/**
	 * Add a new {@link Role} to those this user belongs to.
	 *
	 * @param role The new role
	 */
	public void addRole(Role role);
     
	/**
	 * Is this user in the specified {@link Role}?
	 *
	 * @param role The role to check
	 */
	public boolean isInRole(Role role);


	/**
	 * Remove a {@link Role} from those this user belongs to.
	 *
	 * @param role The old role
	 */
	public void removeRole(Role role);


	/**
	 * Remove all {@link Role}s from those this user belongs to.
	 */
	public void removeRoles();
	
	
	/**
	 * Add a new {@link Department} to those this user belongs to.
	 *
	 * @param department The new department
	 */
	public void addDepartment(Department department);
     
	/**
	 * Is this user in the specified {@link Department}?
	 *
	 * @param department The department to check
	 */
	public boolean isInDepartment(Department department);


	/**
	 * Remove a {@link Department} from those this user belongs to.
	 *
	 * @param department The old department
	 */
	public void removeDepartment(Department department);


	/**
	 * Remove all {@link Department}s from those this user belongs to.
	 */
	public void removeDepartments();
	
}
