Class DiagnosticsAgent
Proxy class for the Diagnostics Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class DiagnosticsAgent : IDiagnosticsAgent, IAgent
Constructors
DiagnosticsAgent(ICacheImplementation, ICacheInvalidationImplementation, IEntityCountsImplementation, ILoggingImplementation, IUsageStatsImplementation, ISystemMessageListImplementation, ITableManagerImplementation, IInstallationImplementation, IWebAppUsageImplementation, ISoRequestItemsAccessor)
Proxy class for the Diagnostics Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public DiagnosticsAgent(ICacheImplementation cacheImplementation, ICacheInvalidationImplementation cacheInvalidationImplementation, IEntityCountsImplementation entityCountsImplementation, ILoggingImplementation loggingImplementation, IUsageStatsImplementation usageStatsImplementation, ISystemMessageListImplementation systemMessageListImplementation, ITableManagerImplementation tableManagerImplementation, IInstallationImplementation installationImplementation, IWebAppUsageImplementation webAppUsageImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| ICacheImplementation | cacheImplementation | |
| ICacheInvalidationImplementation | cacheInvalidationImplementation | |
| IEntityCountsImplementation | entityCountsImplementation | |
| ILoggingImplementation | loggingImplementation | |
| IUsageStatsImplementation | usageStatsImplementation | |
| ISystemMessageListImplementation | systemMessageListImplementation | |
| ITableManagerImplementation | tableManagerImplementation | |
| IInstallationImplementation | installationImplementation | |
| IWebAppUsageImplementation | webAppUsageImplementation | |
| ISoRequestItemsAccessor | accessor |
DiagnosticsAgent(ICacheImplementation, ICacheInvalidationImplementation, IEntityCountsImplementation, ILoggingImplementation, IUsageStatsImplementation, ISystemMessageListImplementation, ITableManagerImplementation, IInstallationImplementation, IWebAppUsageImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)
Proxy class for the Diagnostics Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public DiagnosticsAgent(ICacheImplementation cacheImplementation, ICacheInvalidationImplementation cacheInvalidationImplementation, IEntityCountsImplementation entityCountsImplementation, ILoggingImplementation loggingImplementation, IUsageStatsImplementation usageStatsImplementation, ISystemMessageListImplementation systemMessageListImplementation, ITableManagerImplementation tableManagerImplementation, IInstallationImplementation installationImplementation, IWebAppUsageImplementation webAppUsageImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| ICacheImplementation | cacheImplementation | |
| ICacheInvalidationImplementation | cacheInvalidationImplementation | |
| IEntityCountsImplementation | entityCountsImplementation | |
| ILoggingImplementation | loggingImplementation | |
| IUsageStatsImplementation | usageStatsImplementation | |
| ISystemMessageListImplementation | systemMessageListImplementation | |
| ITableManagerImplementation | tableManagerImplementation | |
| IInstallationImplementation | installationImplementation | |
| IWebAppUsageImplementation | webAppUsageImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository | |
| IScriptingConfiguration | scriptingConfiguration | |
| IOnlineConfiguration | onlineConfiguration |
Methods
AddWebAppUsageAsync(WebAppUsage[], CancellationToken)
Adds WebApp usage to existing log
Declaration
public Task AddWebAppUsageAsync(WebAppUsage[] webAppUsages, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| WebAppUsage[] | webAppUsages | Web app usage. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
ChangeLogSettingsAsync(bool, bool, bool, bool, bool, bool, bool, bool, CancellationToken)
Change NetServer log settings.
Declaration
public Task ChangeLogSettingsAsync(bool logWarning, bool logInformation, bool logSuccessAudit, bool logFailureAudit, bool logToEventLog, bool logToSuperOffice, bool logToFile, bool logToTrace, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | logWarning | Turn on warning log |
| bool | logInformation | Turn on information log |
| bool | logSuccessAudit | Turn on success audit log |
| bool | logFailureAudit | Turn on failure audit log |
| bool | logToEventLog | Log to event log |
| bool | logToSuperOffice | Log to SuperOffice |
| bool | logToFile | Log to file |
| bool | logToTrace | Log to trace |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
CollectDataAdditionsAsync(CancellationToken)
Collect and transmit usage statistics: Database Additions. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
Declaration
public Task CollectDataAdditionsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
CollectTableSizesAsync(CancellationToken)
Collect and transmit usage statistics: Table Sizes. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
Declaration
public Task CollectTableSizesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
CollectWebUsageAsync(CancellationToken)
Collect and transmit usage statistics: Web-based clients Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
Declaration
public Task CollectWebUsageAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
CollectWinUsageAsync(CancellationToken)
Collect and transmit usage statistics: Windows CRM Client Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
Declaration
public Task CollectWinUsageAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
FlushCachesAsync(CancellationToken)
Flushes all NetServer caches
Declaration
public Task FlushCachesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
FlushCachesByNameAsync(string[], CancellationToken)
Flushes all NetServer caches named
Declaration
public Task FlushCachesByNameAsync(string[] cacheNames, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | cacheNames | Name of the cachnes to flush |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
GetCacheInvalidationGenerationsAsync(string[], CancellationToken)
Get generation for provided names
Declaration
public Task<CacheInvalidation[]> GetCacheInvalidationGenerationsAsync(string[] names, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | names | Name of caches |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CacheInvalidation[]> | Array of caches with generation number |
GetCacheNamesAsync(CancellationToken)
Get the name of the caches that can be flushed
Declaration
public Task<string[]> GetCacheNamesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string[]> | Name of the caches that can be flusehd |
GetCacheStateAsync(string[], CancellationToken)
Get the current generation value of the named caches. State is opaque.
Declaration
public Task<string> GetCacheStateAsync(string[] cacheNames, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | cacheNames | Names of the caches to check |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | Current state of the caches named. If not the same as previous value, then it is time to flush |
GetEntityCountsForAllUsersAsync(CancellationToken)
Get an array of entities and number of entities created for all associates.
Declaration
public Task<EntityCounts[]> GetEntityCountsForAllUsersAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<EntityCounts[]> | Array of EntityCounts[] for all the users |
GetEntityCountsForCurrentUserAsync(CancellationToken)
Get an array of entities and number of entities created for the current associate
Declaration
public Task<EntityCounts[]> GetEntityCountsForCurrentUserAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<EntityCounts[]> | Array of EntityCounts[] for the current associate |
GetNextTableNumberAsync(CancellationToken)
Increment save and return NextTableNumber, to be used when creating new extra table
Declaration
public Task<int> GetNextTableNumberAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | NextTableNumber of DatabaseModel |
GetSystemMessagesAsync(int, CancellationToken)
Retrieves a list of system messages for a specific associate.
Declaration
public Task<SystemMessage[]> GetSystemMessagesAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | The associateId of the message target. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<SystemMessage[]> | List of SystemMessages for desired associate |
GetWebAppUsagesForPeriodAsync(DateTime, DateTime, string, CancellationToken)
Get all WebAppUsages for a given period, that match an optional search term
Declaration
public Task<WebAppUsage[]> GetWebAppUsagesForPeriodAsync(DateTime fromDate, DateTime toDate, string searchTerm, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | fromDate | |
| DateTime | toDate | |
| string | searchTerm | ViewState search term. '%' is the wildcard character, for example 'Pocket%' will match all viewstates starting with 'Pocket'. If empty, all viewstates will be matched |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<WebAppUsage[]> |
LogViewStateAsync(string, CancellationToken)
Log a change in view state. The granularity of the logging depends on the current configuration. This call returns asynchronously, leaving the server to finish processing later on.
Declaration
public Task LogViewStateAsync(string viewState, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | viewState | Current view state to be logged |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
PerformTasksAfterCustomObjectTableCreatedAsync(string, CancellationToken)
A temporary method to be used from c++ until CustomObjectsAgent.CreateTable implemented in NetServer
Declaration
public Task PerformTasksAfterCustomObjectTableCreatedAsync(string tableName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | Name of DB table of the custom object that was created. E.g., 'y_car' |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
PerformTasksAfterCustomObjectTableDeletedAsync(string, CancellationToken)
A temporary method to be used from c++ until CustomObjectsAgent.DeleteTable implemented in NetServer
Declaration
public Task PerformTasksAfterCustomObjectTableDeletedAsync(string tableName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | Name of DB table of the custom object that was deleted. E.g., 'y_car' |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
PerformTasksAfterUpgradeAsync(CancellationToken)
After upgrading to a new fileset, there may be tasks that need to be done. Examples - import new TypicalSearches, if present. Tasks performed here need to be idempotent and independent of the actual upgrade jump (what was the previous version). They should complete in a reasonable time, not more than a few minutes maximum.
Declaration
public Task<string> PerformTasksAfterUpgradeAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | Message that can be shown to the user, summarizing what has been done, if anything. |
RemoveExpiredSystemMessagesAsync(CancellationToken)
Deletes expired system messages.
Declaration
public Task RemoveExpiredSystemMessagesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
RemoveSystemMessageAsync(int, string, CancellationToken)
Removes a system message for current associate
Declaration
public Task RemoveSystemMessageAsync(int onlineappId, string systemMessageId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | onlineappId | Id of the online app that owns this message |
| string | systemMessageId | Message identifier, used for message removal |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
RemoveSystemMessageForAssociateAsync(int, string, int, CancellationToken)
Removes a system message for specific associate.
Declaration
public Task RemoveSystemMessageForAssociateAsync(int onlineappId, string systemMessageId, int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | onlineappId | Id of the online app that owns this message |
| string | systemMessageId | Message identifier, used for message update or removal |
| int | associateId | The associateId of the message target. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
ResyncUsersAsync(CancellationToken)
Resynchronize user information with SuperOffice Community, if opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
Declaration
public Task ResyncUsersAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
SendSystemMessageAsync(string, int, string, DateTime, SystemMessageType, CancellationToken)
Adds a system message for a specific associate.
Declaration
public Task SendSystemMessageAsync(string systemMessageId, int associateId, string markdownMessage, DateTime expire, SystemMessageType type, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | systemMessageId | The message string id |
| int | associateId | The associateId of the message target. |
| string | markdownMessage | Markdown message to be displayed to the user |
| DateTime | expire | When the message will no longer be available |
| SystemMessageType | type | Type of message, example: info, warning, error |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
WebAppUsageExistsInPeriodAsync(int, string, DateTime, CancellationToken)
Returns true if viewState has been clicked at least once since FromDate, if asscoiateId < 0 or FromDate is DateTime.MinValue no restriction given for those parameters
Declaration
public Task<bool> WebAppUsageExistsInPeriodAsync(int associateId, string viewState, DateTime fromDate, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | The asscoiate id to look for webapp usage |
| string | viewState | The viewState to search for |
| DateTime | fromDate | The datetime to restrict webapp usage on |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if viewState has been clicked at least once since FromDate |