Search Results for

    Show / Hide Table of Contents
    View Source

    Class ServerMessengerBase

    Provides a base class for all IServerMessenger implementations.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Infrastructure.Sync
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class ServerMessengerBase : IServerMessenger

    Constructors

    View Source

    ServerMessengerBase(Boolean)

    Initializes a new instance of the ServerMessengerBase class.

    Declaration
    protected ServerMessengerBase(bool distributedEnabled)
    Parameters
    Type Name Description
    System.Boolean distributedEnabled

    If set to true makes distributed calls when messaging a cache refresher.

    Properties

    View Source

    DistributedEnabled

    Gets or sets a value indicating whether distributed calls are made when messaging a cache refresher.

    Declaration
    protected bool DistributedEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if distributed calls are required; otherwise, false if all we have is the local server.

    Methods

    View Source

    Deliver(ICacheRefresher, MessageType, Nullable<IEnumerable<Object>>, String)

    Declaration
    protected virtual void Deliver(ICacheRefresher refresher, MessageType messageType, IEnumerable<object>? ids = null, string json = null)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    MessageType messageType
    System.Nullable<IEnumerable<System.Object>> ids
    System.String json
    View Source

    Deliver<TPayload>(ICacheRefresher, TPayload[])

    Declaration
    protected virtual void Deliver<TPayload>(ICacheRefresher refresher, TPayload[] payload)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    TPayload[] payload
    Type Parameters
    Name Description
    TPayload
    View Source

    Deliver<T>(ICacheRefresher, MessageType, Func<T, Object>, IEnumerable<T>)

    Declaration
    protected virtual void Deliver<T>(ICacheRefresher refresher, MessageType messageType, Func<T, object> getId, IEnumerable<T> instances)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    MessageType messageType
    Func<T, System.Object> getId
    IEnumerable<T> instances
    Type Parameters
    Name Description
    T
    View Source

    DeliverLocal(ICacheRefresher, MessageType, Nullable<IEnumerable<Object>>, String)

    Executes the non-strongly typed ICacheRefresher on the local/current server.

    Declaration
    protected void DeliverLocal(ICacheRefresher refresher, MessageType messageType, IEnumerable<object>? ids = null, string json = null)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The cache refresher.

    MessageType messageType

    The message type.

    System.Nullable<IEnumerable<System.Object>> ids

    The IDs.

    System.String json

    The JSON.

    Remarks

    Since this is only for non strongly typed ICacheRefresher, it will throw for message types that are by instance.

    View Source

    DeliverLocal<TPayload>(ICacheRefresher, TPayload[])

    Declaration
    protected void DeliverLocal<TPayload>(ICacheRefresher refresher, TPayload[] payload)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    TPayload[] payload
    Type Parameters
    Name Description
    TPayload
    View Source

    DeliverLocal<T>(ICacheRefresher, MessageType, Func<T, Object>, IEnumerable<T>)

    Executes the strongly typed ICacheRefresher<T> on the local/current server.

    Declaration
    protected void DeliverLocal<T>(ICacheRefresher refresher, MessageType messageType, Func<T, object> getId, IEnumerable<T> instances)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The cache refresher.

    MessageType messageType

    The message type.

    Func<T, System.Object> getId

    The function that gets the IDs from the instance.

    IEnumerable<T> instances

    The instances.

    Type Parameters
    Name Description
    T

    The cache refresher instance type.

    Remarks

    Since this is only for strongly typed ICacheRefresher<T>, it will throw for message types that are not by instance.

    View Source

    DeliverRemote(ICacheRefresher, MessageType, Nullable<IEnumerable<Object>>, String)

    Declaration
    protected abstract void DeliverRemote(ICacheRefresher refresher, MessageType messageType, IEnumerable<object>? ids = null, string json = null)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    MessageType messageType
    System.Nullable<IEnumerable<System.Object>> ids
    System.String json
    View Source

    GetArrayType(Nullable<IEnumerable<Object>>, out Nullable<Type>)

    Declaration
    protected static bool GetArrayType(IEnumerable<object>? ids, out Type? arrayType)
    Parameters
    Type Name Description
    System.Nullable<IEnumerable<System.Object>> ids
    System.Nullable<Type> arrayType
    Returns
    Type Description
    System.Boolean
    View Source

    PerformRefresh(ICacheRefresher, String)

    Declaration
    public void PerformRefresh(ICacheRefresher refresher, string jsonPayload)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    System.String jsonPayload
    View Source

    QueueRefresh(ICacheRefresher, Guid[])

    Declaration
    public void QueueRefresh(ICacheRefresher refresher, params Guid[] guidIds)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    Guid[] guidIds
    View Source

    QueueRefresh(ICacheRefresher, Int32[])

    Notifies all servers of specified items invalidation, for a specified ICacheRefresher.

    Declaration
    public void QueueRefresh(ICacheRefresher refresher, params int[] numericIds)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The ICacheRefresher.

    System.Int32[] numericIds

    The unique identifiers of the invalidated items.

    View Source

    QueueRefresh<TPayload>(ICacheRefresher, TPayload[])

    Notifies the distributed cache, for a specified ICacheRefresher.

    Declaration
    public void QueueRefresh<TPayload>(ICacheRefresher refresher, TPayload[] payload)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The ICacheRefresher.

    TPayload[] payload

    The notification content.

    Type Parameters
    Name Description
    TPayload
    View Source

    QueueRefresh<T>(ICacheRefresher, Func<T, Guid>, T[])

    Declaration
    public void QueueRefresh<T>(ICacheRefresher refresher, Func<T, Guid> getGuidId, params T[] instances)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    Func<T, Guid> getGuidId
    T[] instances
    Type Parameters
    Name Description
    T
    View Source

    QueueRefresh<T>(ICacheRefresher, Func<T, Int32>, T[])

    Declaration
    public void QueueRefresh<T>(ICacheRefresher refresher, Func<T, int> getNumericId, params T[] instances)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    Func<T, System.Int32> getNumericId
    T[] instances
    Type Parameters
    Name Description
    T
    View Source

    QueueRefreshAll(ICacheRefresher)

    Notifies all servers of a global invalidation for a specified ICacheRefresher.

    Declaration
    public void QueueRefreshAll(ICacheRefresher refresher)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The ICacheRefresher.

    View Source

    QueueRemove(ICacheRefresher, Int32[])

    Notifies all servers of specified items removal, for a specified ICacheRefresher.

    Declaration
    public void QueueRemove(ICacheRefresher refresher, params int[] numericIds)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The ICacheRefresher.

    System.Int32[] numericIds

    The unique identifiers of the removed items.

    View Source

    QueueRemove<T>(ICacheRefresher, Func<T, Int32>, T[])

    Declaration
    public void QueueRemove<T>(ICacheRefresher refresher, Func<T, int> getNumericId, params T[] instances)
    Parameters
    Type Name Description
    ICacheRefresher refresher
    Func<T, System.Int32> getNumericId
    T[] instances
    Type Parameters
    Name Description
    T
    View Source

    RequiresDistributed(ICacheRefresher, MessageType)

    Determines whether to make distributed calls when messaging a cache refresher.

    Declaration
    protected virtual bool RequiresDistributed(ICacheRefresher refresher, MessageType messageType)
    Parameters
    Type Name Description
    ICacheRefresher refresher

    The cache refresher.

    MessageType messageType

    The message type.

    Returns
    Type Description
    System.Boolean

    true if distributed calls are required; otherwise, false if all we have is the local server.

    View Source

    SendMessages()

    Called to send/commit the queued messages created with the Perform methods

    Declaration
    public abstract void SendMessages()
    View Source

    Sync()

    Called to synchronize a server with queued notifications

    Declaration
    public abstract void Sync()
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ServerMessengerBase(Boolean)
    • Properties
      • DistributedEnabled
    • Methods
      • Deliver(ICacheRefresher, MessageType, Nullable<IEnumerable<Object>>, String)
      • Deliver<TPayload>(ICacheRefresher, TPayload[])
      • Deliver<T>(ICacheRefresher, MessageType, Func<T, Object>, IEnumerable<T>)
      • DeliverLocal(ICacheRefresher, MessageType, Nullable<IEnumerable<Object>>, String)
      • DeliverLocal<TPayload>(ICacheRefresher, TPayload[])
      • DeliverLocal<T>(ICacheRefresher, MessageType, Func<T, Object>, IEnumerable<T>)
      • DeliverRemote(ICacheRefresher, MessageType, Nullable<IEnumerable<Object>>, String)
      • GetArrayType(Nullable<IEnumerable<Object>>, out Nullable<Type>)
      • PerformRefresh(ICacheRefresher, String)
      • QueueRefresh(ICacheRefresher, Guid[])
      • QueueRefresh(ICacheRefresher, Int32[])
      • QueueRefresh<TPayload>(ICacheRefresher, TPayload[])
      • QueueRefresh<T>(ICacheRefresher, Func<T, Guid>, T[])
      • QueueRefresh<T>(ICacheRefresher, Func<T, Int32>, T[])
      • QueueRefreshAll(ICacheRefresher)
      • QueueRemove(ICacheRefresher, Int32[])
      • QueueRemove<T>(ICacheRefresher, Func<T, Int32>, T[])
      • RequiresDistributed(ICacheRefresher, MessageType)
      • SendMessages()
      • Sync()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX