aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL/ActionLogs/IActionLogManager.cs
blob: 5edb409e628bf9b926820022cc60c74517964601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
using Tango.BL.ValueObjects;

namespace Tango.BL.ActionLogs
{
    /// <summary>
    /// Represents an ActionLog manager which is responsible for inserting and comparing new action logs to a data store.
    /// </summary>
    public interface IActionLogManager
    {
        /// <summary>
        /// Gets or sets the action log comparer used to compare related objects.
        /// </summary>
        IActionLogComparer ActionLogComparer { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to perform the logging operations asynchronously.
        /// </summary>
        bool IsAsync { get; set; }

        /// <summary>
        /// Inserts a new action log (main entry point).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="userGuid">The user unique identifier.</param>
        /// <param name="relatedObjectName">Name of the related object.</param>
        /// <param name="relatedObjectGuid">The related object unique identifier.</param>
        /// <param name="diffference">The diffference node tree.</param>
        /// <param name="message">The message.</param>
        void InsertLog(ActionLogType type, String userGuid, String relatedObjectName, String relatedObjectGuid, ActionLogDifference diffference, String message = null);

        /// <summary>
        /// Inserts a new action log (comparison entry).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="userGuid">The user unique identifier.</param>
        /// <param name="relatedObjectName">Name of the related object.</param>
        /// <param name="relatedObjectBefore">The related object before the change.</param>
        /// <param name="relatedObjectAfter">The related object after the change.</param>
        /// <param name="message">The message.</param>
        void InsertLog(ActionLogType type, String userGuid, String relatedObjectName, IActionLogComparable relatedObjectBefore, IActionLogComparable relatedObjectAfter, String message = null);

        /// <summary>
        /// Inserts a new action log (comparison entry).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="user">The user.</param>
        /// <param name="relatedObjectName">Name of the related object.</param>
        /// <param name="relatedObjectBefore">The related object before the change.</param>
        /// <param name="relatedObjectAfter">The related object after the change.</param>
        /// <param name="message">The message.</param>
        void InsertLog(ActionLogType type, User user, String relatedObjectName, IActionLogComparable relatedObjectBefore, IActionLogComparable relatedObjectAfter, String message = null);

        /// <summary>
        /// Inserts a new action log (deletion/creation entry).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="user">The user.</param>
        /// <param name="relatedObjectName">Name of the related object.</param>
        /// <param name="relatedObject">The related object.</param>
        /// <param name="message">The message.</param>
        /// <param name="serializeRelatedObject">if set to <c>true</c> will create a one way difference tree (use when the related object was deleted and needs to be monitored).</param>
        void InsertLog(ActionLogType type, User user, String relatedObjectName, IActionLogComparable relatedObject, String message = null, bool serializeRelatedObject = false);

        /// <summary>
        /// Inserts a new action log (creation entry).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="userGuid">The user unique identifier.</param>
        /// <param name="relatedObjectName">Name of the related object.</param>
        /// <param name="relatedObjectGuid">The related object unique identifier.</param>
        /// <param name="message">The message.</param>
        void InsertLog(ActionLogType type, String userGuid, String relatedObjectName, String relatedObjectGuid, String message = null);

        /// <summary>
        /// Inserts a new action log (neutral entry).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="userGuid">The user unique identifier.</param>
        /// <param name="message">The message.</param>
        void InsertLog(ActionLogType type, String userGuid, String message = null);

        /// <summary>
        /// Inserts a new action log (neutral entry).
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="user">The user.</param>
        /// <param name="message">The message.</param>
        void InsertLog(ActionLogType type, User user, String message = null);
    }
}