Class BulkApiContentReferenceCache<TContent>
IContentReferenceCache implementation that loads content items in bulk from an API list client.
Inheritance
Implements
Inherited Members
Namespace: Tableau.Migration.Api.Search
Assembly: Tableau.Migration.dll
Syntax
public class BulkApiContentReferenceCache<TContent> : ContentReferenceCacheBase, IContentReferenceCache where TContent : class, IContentReference
Type Parameters
Name | Description |
---|---|
TContent | The content type. |
Constructors
BulkApiContentReferenceCache(ISitesApiClient?, IConfigReader)
Creates a new BulkApiContentReferenceCache<TContent> object.
Declaration
public BulkApiContentReferenceCache(ISitesApiClient? apiClient, IConfigReader configReader)
Parameters
Type | Name | Description |
---|---|---|
ISitesApiClient | apiClient | An API client. |
IConfigReader | configReader | A config reader. |
Properties
BatchSize
Gets the configured batch size.
Declaration
protected int BatchSize { get; }
Property Value
Type | Description |
---|---|
int |
Methods
IndividualSearchAsync(Guid, CancellationToken)
Searches for content at the given ID.
Declaration
protected override Task<ContentReferenceStub?> IndividualSearchAsync(Guid searchId, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
Guid | searchId | The primary ID to search for. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<ContentReferenceStub> | The content reference to cache, or null. |
Overrides
ItemLoaded(TContent)
Called after an item is loaded into the cache from the store.
Declaration
protected virtual void ItemLoaded(TContent item)
Parameters
Type | Name | Description |
---|---|---|
TContent | item | The item that was loaded. |
LoadAllAsync(CancellationToken)
Loads all content items from the API client.
Declaration
protected ValueTask<IEnumerable<ContentReferenceStub>> LoadAllAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
ValueTask<IEnumerable<ContentReferenceStub>> | All content items. |
SearchAsync(Guid, CancellationToken)
Searches for content at the given ID, possibly returning more references to opportunistically cache.
Declaration
protected override ValueTask<IEnumerable<ContentReferenceStub>> SearchAsync(Guid searchId, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
Guid | searchId | The primary ID to search for. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
ValueTask<IEnumerable<ContentReferenceStub>> | The content references to cache. |
Overrides
SearchAsync(ContentLocation, CancellationToken)
Searches for content at the given location, possibly returning more locations to opportunistically cache.
Declaration
protected override ValueTask<IEnumerable<ContentReferenceStub>> SearchAsync(ContentLocation searchLocation, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
ContentLocation | searchLocation | The primary location to search for. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
ValueTask<IEnumerable<ContentReferenceStub>> | The content references to cache. |