Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

Properties

There are two types of timers covered by these libraries: wall clock timers and set interval timersThe Tsplice Client properties include the following:

Expand
titleHttpClient
Code Block
public System.Net.Http.HttpClient HttpClient { get; set; }

Gets or sets the HTTP client object used for communications with the host system. By default this is initialized to a shared HttpClient instance, but can be set to an alternate instance of an HttpClient object if necessary (e.g. for automated tests).

Expand
titleBaseUri
Code Block
public System.Uri BaseUri { get; set; }

Gets or setsthe uniform resource identifier of the Tsplice host e.g. https://host.name.com/Path.

Expand
titleJsonOptions
Code Block
public System.Test.Json.JsonSerializerOptions JsonOptions { get; set; }

Gets or sets the Json serialization options used by the Tsplice client.

Expand
titleDownloadFolder
Code Block
public System.String DownloadFolder { get; set; }

Gets or sets the root download folder used by functions that retrieve files from the host i.e. when a local path is not specified in the function call. If a download folder is not explicitly set then a temporary folder will be created during the first function call that requires one, and this folder will be deleted when the application exits.

Methods

The Tsplice Client methods are grouped below by function.

...

Expand
titleGet the available domains on the host
Code Block
///-----------------------------------------------------------------
/// <summary>
/// Get the list of available domains on the host
/// </summary>
/// <param name="cancelToken">Cancellation token</param>
/// <returns>
/// ApiResponse object containing the list of domains
/// </returns>
///-----------------------------------------------------------------
public async Task<JsonResponse<List<Domain>>> GetDomains(
                           CancellationToken cancelToken = default)

System Status

The This following function can be used to get retrieves the current status of the Tsplice host system., including:

  • Host computer name

  • Host computer domain

  • Current date/time on the host computer

Expand
titleGet host system status
Code Block
///-----------------------------------------------------------------
/// <summary>
/// Get the Tsentry system status information
/// </summary>
/// <param name="cancelToken">Cancellation token</param>
/// <returns>Response object</returns>
///-----------------------------------------------------------------
public async Task<JsonResponse<SystemStatus>> GetSystemStatus(
            CancellationToken cancelToken = default)

...

The following functions can be used to interact with shared folders and files on the Tsplice host system. The list of folders and files exposed by the Tsplice host are defined in the sysTsplice.ini file.

Expand
titleRead a file from the host
Code Block
///-----------------------------------------------------------------
/// <summary>
/// Download a list of files from a shared folder
/// </summary>
/// <param name="sharePath">Application name</param>
/// <param name="cancelToken">Cancellation token</param>
/// <returns>
/// ApiResponse object containing the list of application files
/// </returns>
///-----------------------------------------------------------------
public async Task<ApiResponse<List<FileSystemEntry>>>
         GetSharedFileList(string sharePath,
                           CancellationToken cancelToken = default)

///-----------------------------------------------------------------
/// <summary>
/// Download a shared file into the specified location
/// </summary>
/// <param name="sharePath">Shared folder path</param>
/// <param name="localPath">
/// Target file path on local system, or null to use the default
/// download location
/// </param>
/// <param name="cancelToken">Cancellation token</param>
/// <returns>FileResponse object</returns>
///-----------------------------------------------------------------
public async Task<FileResponse> GetSharedFile(
                     string sharePath, string localPath = null,
                     CancellationToken cancelToken = default)

///-----------------------------------------------------------------
/// <summary>
/// Download files matching a filter from a shared folder into
/// the specified folder
/// </summary>
/// <param name="sharePath">Shared folder path</param>
/// <param name="search">
/// Search string, or null to match all files
/// </param>
/// <param name="localRoot">
/// Root folder for local files, or null to use the default
/// download folder
/// </param>
/// <param name="cancelToken">Cancellation token</param>
/// <returns>FileResponse object</returns>
///-----------------------------------------------------------------
public async Task<List<FileResponse>> GetSharedFiles(
                  string sharePath, string search = null,
                  string localRoot = null,
                  CancellationToken cancelToken = default)

...