//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Xml;
using CommunityServer.Configuration;

namespace CommunityServer.Components
{
	/// <summary>
	/// Summary description for SiteStatisticsJob.
	/// </summary>
	public class SiteStatisticsJob : IJob
	{
		public SiteStatisticsJob()
		{
		}

	    public void Execute(XmlNode node)
	    {
			int hours = 1;
			if(node != null)
			{
				XmlAttribute att = node.Attributes["hours"];
				if(att != null)
				{
					try
					{
						hours = Int32.Parse(att.Value);
					}
					catch{}
				}
			}

	        SiteStatistics.CalculateSiteStatistics(hours);
	    }
	}
}
