//----------------------------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.coreImpl.xpdl;

import java.util.Date;

import org.huihoo.workflow.xpdl.WorkflowProcessHeader;
import org.huihoo.workflow.xpdl.util.DateTools;
import org.huihoo.workflow.xpdl.util.Duration;
import org.huihoo.workflow.xpdl.util.DurationUnit;


public class WorkflowProcessHeaderImpl extends WorkflowProcessHeader
{
	protected Date creationTime;
	protected Date validFrom;
	protected Date validTo;
   
	protected Duration limit;
	protected DurationUnit durationUnit;
  
	protected String description;
  
	public Date getCreationTime()
	{
		return creationTime;
	}

	public void setCreationTime(Date creationTime_)
	{
		this.creationTime=creationTime_;
	}
  
  public void setCreationTime(String creationTime_)
  {
    this.creationTime=DateTools.toSqlDate(creationTime_);
  }
  
	public Duration getLimit()
	{
		return limit;
	}

	public void setLimit(Duration limit_)
	{
		this.limit=limit_;
	}
  
  public void setLimit(String limit_)
  {
    this.limit=new Duration(limit_);
  }
    
	public Date getValidFrom()
	{
		return (this.validFrom);
	}

	public void setValidFrom(Date validFrom_)
	{
		this.validFrom=validFrom_;
	}
  
  public void setValidFrom(String validFrom_)
  {
    this.validFrom=DateTools.toSqlDate(validFrom_);
  }

	public Date getValidTo()
	{
		return validTo;
	}

	public void setValidTo(Date validTo_)
	{
		this.validTo=validTo_;
	}
  
  public void setValidTo(String validTo_)
  {
    this.validTo=DateTools.toSqlDate(validTo_);
  }

	public DurationUnit getDurationUnit()
	{
		return durationUnit;
	}

	public void setDurationUnit(DurationUnit durationUnit_)
	{
		this.durationUnit=durationUnit_;
	}
  public void setDurationUnit(String durationUnit_)
  {
    this.durationUnit=DurationUnit.stringToType(durationUnit_);
  }
    
	public String getDescription()
	{
		return description;
	}

	public void setDescription(String description_)
	{
		this.description=description_;
	}
	
	public String getTagName()
	{
		return "ProcessHeader";
	}
}
