IPsQueueItem.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using qdr.fnd.core.pqueue.Enums;
  2. using Quadarax.Foundation.Core.Data;
  3. namespace qdr.fnd.core.pqueue
  4. {
  5. /// <summary>
  6. /// Interface for the queue item.
  7. /// </summary>
  8. public interface IPsQueueItem : IPsQueueItemDescriptor
  9. {
  10. #region *** Properties ***
  11. /// <summary>
  12. /// Unique identifier of the queue item.
  13. /// </summary>
  14. string Id { get; }
  15. /// <summary>
  16. /// Date and time when the queue item was created.
  17. /// </summary>
  18. DateTime Created { get; }
  19. /// <summary>
  20. /// Date and time when the queue item was started to process (last cycle).
  21. /// </summary>
  22. DateTime? Started { get; }
  23. /// <summary>
  24. /// Date and time when the queue item was finished to process (last cycle).
  25. /// </summary>
  26. DateTime? Finished { get; }
  27. /// <summary>
  28. /// Process item current status. Changes are logged in <see cref="StatusJournal"/>.
  29. /// </summary>
  30. PsStatusEnum Status { get; }
  31. /// <summary>
  32. /// Defines if <see cref="Status"/> is transient state (going to status change, but status is already changed). Changes are logged in <see cref="StatusJournal"/>.
  33. /// NOTE: Transient is flag that set to True directly when status is changed. (means that first change Status, then transient)
  34. /// </summary>
  35. bool IsStatusTransient { get; }
  36. /// <summary>
  37. /// Defines current number of attempts left to process the queue item.
  38. /// </summary>
  39. int AttemptsLeft { get; }
  40. /// <summary>
  41. /// Collection of messages, errors, warnings logged during the process.
  42. /// </summary>
  43. IEnumerable<IError> Log { get; }
  44. /// <summary>
  45. /// Collection of status changes of the queue item. When <see cref="Status"/> or <see cref="IsStatusTransient"/> is changed, the status change is logged.
  46. /// NOTE: To this collection contains current state also.
  47. /// </summary>
  48. IEnumerable<PsStatusHistory> StatusJournal { get;}
  49. #endregion
  50. }
  51. }