2013-08-28 06:51:42 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
2013-08-29 04:43:26 +00:00
|
|
|
|
namespace NzbDrone.Common.Messaging.Tracking
|
2013-08-28 06:51:42 +00:00
|
|
|
|
{
|
2013-08-29 04:43:26 +00:00
|
|
|
|
public class TrackedCommand
|
2013-08-28 06:51:42 +00:00
|
|
|
|
{
|
2013-08-31 03:08:19 +00:00
|
|
|
|
public String Id { get; private set; }
|
|
|
|
|
public String Name { get; private set; }
|
2013-08-28 15:05:41 +00:00
|
|
|
|
public String Type { get; private set; }
|
|
|
|
|
public ICommand Command { get; private set; }
|
2013-09-02 02:55:45 +00:00
|
|
|
|
public ProcessState State { get; set; }
|
2013-08-29 04:43:26 +00:00
|
|
|
|
public DateTime StateChangeTime { get; set; }
|
|
|
|
|
public TimeSpan Runtime { get; set; }
|
|
|
|
|
public Exception Exception { get; set; }
|
2013-08-31 06:19:19 +00:00
|
|
|
|
|
|
|
|
|
public TrackedCommand()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-02 02:55:45 +00:00
|
|
|
|
public TrackedCommand(ICommand command, ProcessState state)
|
2013-08-28 06:51:42 +00:00
|
|
|
|
{
|
2013-08-31 03:08:19 +00:00
|
|
|
|
Id = command.CommandId;
|
|
|
|
|
Name = command.GetType().Name;
|
2013-08-28 06:51:42 +00:00
|
|
|
|
Type = command.GetType().FullName;
|
|
|
|
|
Command = command;
|
|
|
|
|
State = state;
|
2013-08-29 04:43:26 +00:00
|
|
|
|
StateChangeTime = DateTime.UtcNow;
|
2013-08-28 06:51:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|