Interface IDiagnosticsAgent
Interface for the Diagnostics Agent Diagnostics, usage data collection, caches and flushing
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Diagnostics Agent", "Interface for the Diagnostics Agent. Diagnostics, usage data collection, caches and flushing")]
public interface IDiagnosticsAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
Methods
AddWebAppUsage(WebAppUsage[])
Adds WebApp usage to existing log
Declaration
void AddWebAppUsage(WebAppUsage[] webAppUsages)
Parameters
Type | Name | Description |
---|---|---|
WebAppUsage[] | webAppUsages | Web app usage. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
ChangeLogSettings(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
Change NetServer log settings.
Declaration
void ChangeLogSettings(bool logWarning, bool logInformation, bool logSuccessAudit, bool logFailureAudit, bool logToEventLog, bool logToSuperOffice, bool logToFile, bool logToTrace)
Parameters
Type | Name | Description |
---|---|---|
Boolean | logWarning | Turn on warning log |
Boolean | logInformation | Turn on information log |
Boolean | logSuccessAudit | Turn on success audit log |
Boolean | logFailureAudit | Turn on failure audit log |
Boolean | logToEventLog | Log to event log |
Boolean | logToSuperOffice | Log to SuperOffice |
Boolean | logToFile | Log to file |
Boolean | logToTrace | Log to trace |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
CollectDataAdditions()
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
void CollectDataAdditions()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
CollectTableSizes()
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
void CollectTableSizes()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
CollectWebUsage()
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
void CollectWebUsage()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
CollectWinUsage()
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
void CollectWinUsage()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
FlushCaches()
Flushes all NetServer caches
Declaration
void FlushCaches()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
FlushCachesByName(String[])
Flushes all NetServer caches named
Declaration
void FlushCachesByName(string[] cacheNames)
Parameters
Type | Name | Description |
---|---|---|
String[] | cacheNames | Name of the cachnes to flush |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
GetCacheNames()
Get the name of the caches that can be flushed
Declaration
string[] GetCacheNames()
Returns
Type | Description |
---|---|
String[] | Name of the caches that can be flusehd |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
GetCacheState(String[])
Get the current generation value of the named caches. State is opaque.
Declaration
string GetCacheState(string[] cacheNames)
Parameters
Type | Name | Description |
---|---|---|
String[] | cacheNames | Names of the caches to check |
Returns
Type | Description |
---|---|
String | Current state of the caches named. If not the same as previous value, then it is time to flush |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
GetEntityCountsForAllUsers()
Get an array of entities and number of entities created for all associates.
Declaration
EntityCounts[] GetEntityCountsForAllUsers()
Returns
Type | Description |
---|---|
EntityCounts[] | Array of EntityCounts[] for all the users |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
GetEntityCountsForCurrentUser()
Get an array of entities and number of entities created for the current associate
Declaration
EntityCounts[] GetEntityCountsForCurrentUser()
Returns
Type | Description |
---|---|
EntityCounts[] | Array of EntityCounts[] for the current associate |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
GetSystemMessages(Int32)
Retrieves a list of system messages for a specific associate.
Declaration
SystemMessage[] GetSystemMessages(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | The associateId of the message target. |
Returns
Type | Description |
---|---|
SystemMessage[] | List of SystemMessages for desired associate |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
GetWebAppUsagesForPeriod(DateTime, DateTime, String)
Get all WebAppUsages for a given period, that match an optional search term
Declaration
WebAppUsage[] GetWebAppUsagesForPeriod(DateTime fromDate, DateTime toDate, string searchTerm)
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 |
Returns
Type | Description |
---|---|
WebAppUsage[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
LogViewState(String)
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
void LogViewState(string viewState)
Parameters
Type | Name | Description |
---|---|---|
String | viewState | Current view state to be logged |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
PerformTasksAfterUpgrade()
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
string PerformTasksAfterUpgrade()
Returns
Type | Description |
---|---|
String | Message that can be shown to the user, summarizing what has been done, if anything. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
RemoveExpiredSystemMessages()
Deletes expired system messages.
Declaration
void RemoveExpiredSystemMessages()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
RemoveSystemMessage(Int32, String)
Removes a system message for current associate
Declaration
void RemoveSystemMessage(int onlineappId, string systemMessageId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | onlineappId | Id of the online app that owns this message |
String | systemMessageId | Message identifier, used for message removal |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
RemoveSystemMessageForAssociate(Int32, String, Int32)
Removes a system message for specific associate.
Declaration
void RemoveSystemMessageForAssociate(int onlineappId, string systemMessageId, int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | onlineappId | Id of the online app that owns this message |
String | systemMessageId | Message identifier, used for message update or removal |
Int32 | associateId | The associateId of the message target. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
ResyncUsers()
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
void ResyncUsers()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
SendSystemMessage(String, Int32, String, DateTime, SystemMessageType)
Adds a system message for a specific associate.
Declaration
void SendSystemMessage(string systemMessageId, int associateId, string markdownMessage, DateTime expire, SystemMessageType type)
Parameters
Type | Name | Description |
---|---|---|
String | systemMessageId | The message string id |
Int32 | 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 |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}
WebAppUsageExistsInPeriod(Int32, String, DateTime)
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
bool WebAppUsageExistsInPeriod(int associateId, string viewState, DateTime fromDate)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
Boolean | Returns true if viewState has been clicked at least once since FromDate |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (DiagnosticsAgent agent = new DiagnosticsAgent())
{
// call methods on agent here...
}
}