Remote Adapter

The remote adapter is the storage adapter that's used to interact with data on a remote file system.

public class RemoteAdapter extends NetworkAdapter

Constructors

Name Description
RemoteAdapter()
hosts [optional]: The dictionary of hosts.
Initializes a new instance of the RemoteAdapter class. The user must apply an adapter configuration (see UpdateConfig(...)) or provide hosts.

Properties

Name Type Description
Hosts Dictionary<string, string> The dictionary of hosts. The mapping is from a key to a host. For example, { "contoso": "http://contoso.com" }.

The key is used as a shorthand for the host. For example, if a remote adapter is configured with { "contoso": "http://contoso.com" }, given the url "http://contoso.com/example.cdm.json", the converted corpus path would then be "remote:/contoso/example.cdm.json" (assuming the remote adapter is mounted under the "remote" namespace).
LocationHint string The hint given to the reader application about where the adapter implementation can be obtained (Nuget, NPM, etc.).

Methods

Name Description Return Type
CanRead() Returns true, since the remote adapter can read data. bool
CanWrite() Returns false, since the remote adapter can't write data to its source. bool
ReadAsync(string) See StorageAdapterBase.ReadAsync(...). Task<string>
WriteAsync(string, string) See StorageAdapterBase.WriteAsync(...). Throws a NotImplementedException because the remote adapter can't write to its source. Task
CreateAdapterPath(string) See StorageAdapterBase.CreateAdapterPath(...). string
CreateCorpusPath(string) See StorageAdapterBase.CreateCorpusPath(...). string
ClearCache() See StorageAdapterBase.ClearCache(). void
ComputeLastModifiedTimeAsync(string) See StorageAdapterBase.ComputeLastModifiedTimeAsync(...). Returns Time.Now(). Task<DateTimeOffset?>
FetchAllFilesAsync(string) See StorageAdapterBase.FetchAllFilesAsync(...). Returns null. Task<List<string>>
FetchConfig() See StorageAdapterBase.FetchConfig(). string
UpdateConfig(string) See StorageAdapterBase.UpdateConfig(...). void
CreateFileQueryCacheContext() See StorageAdapterBase.CreateFileQueryCacheContext(). IDisposable