2014-04-21 16:02:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
2014-06-29 19:59:52 +00:00
|
|
|
|
namespace MediaBrowser.Dlna.Eventing
|
2014-04-21 16:02:30 +00:00
|
|
|
|
{
|
|
|
|
|
public class EventSubscription
|
|
|
|
|
{
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public string CallbackUrl { get; set; }
|
|
|
|
|
public string NotificationType { get; set; }
|
|
|
|
|
|
|
|
|
|
public DateTime SubscriptionTime { get; set; }
|
|
|
|
|
public int TimeoutSeconds { get; set; }
|
|
|
|
|
|
|
|
|
|
public long TriggerCount { get; set; }
|
|
|
|
|
|
|
|
|
|
public void IncrementTriggerCount()
|
|
|
|
|
{
|
|
|
|
|
if (TriggerCount == long.MaxValue)
|
|
|
|
|
{
|
|
|
|
|
TriggerCount = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TriggerCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsExpired
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|