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

import java.util.Iterator;

import org.huihoo.workflow.WorkflowComplexComponent;

public abstract class WorkflowDepartment extends WorkflowComplexComponent
{
	/** 
	 * Construct a new WorkflowComponenet.
	 */
	protected WorkflowDepartment()
	{
		this(null, null);
	}

	/** 
	 * Construct a new WorkflowComponenet.
	 *
	 * @param uuid_ The element ID
	 * @param name The element name
	 */
	protected WorkflowDepartment(String uuid, String name)
	{
		this(uuid, name, null);
	}

	/** 
	 * Construct a new WorkflowComponenet.
	 *
	 * @param uuid_       The element ID
	 * @param name        The element name
	 * @param description The element description
	 */
	protected WorkflowDepartment(String uuid_, String name, String description)
	{
		super(uuid_, name, description);
	}

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

	/**
	 * Return the Category of this department.
	 */
	public abstract WorkflowCategory getCategory();

	/**
	 * Set the Category of this department.
	 *
	 * @param departCategory The new Category
	 */
	public abstract void setCategory(WorkflowCategory departCategory);

	/**
	 * Set the leader of this department.
	 *
	 * @param president The leader
	 */
	public abstract void setPresident(WorkflowParticipant president);

	/**
	 * Return the leader of this department.
	 */
	public abstract WorkflowParticipant getPresident();

	/**
	 * Return the set of {@link WorkflowParticipant}s that are members of this department.
	 */
	public abstract Iterator getParticipants();

	/**
	 * Return the set of {@link Group}s that are members of this department.
	 */
	public abstract Iterator getGroups();

	// --------------------------------------------------------- Public Method
	/**
	 * Add a new {@link WorkflowParticipant} to this group.
	 *
	 * @param user The new user
	 */
	public abstract void addPaticipant(WorkflowParticipant user);

	/**
	 * Remove a {@link WorkflowParticipant} from this group.
	 *
	 * @param user The old user
	 */
	public abstract void removeParticipant(WorkflowParticipant user);

	/**
	 * Remove all {@link WorkflowParticipant}s from this group.
	 */
	public abstract void removeParticipants();

	/**
	 * Add a new {@link Group} to this department.
	 *
	 * @param group The new group
	 */
	public abstract void addGroup(WorkflowGroup group);

	/**
	 * Remove a {@link Group} from this department.
	 *
	 * @param group The old group
	 */
	public abstract void removeGroup(WorkflowGroup group);

	/**
	 * Remove all {@link Group}s from this department.
	 */
	public abstract void removeGroups();

	/**
	 * get group's Department, if not exist,return null.
	 */
	public abstract WorkflowDepartment getParentDepartment();
}
