Class Diffusion

The Diffusion factory of factories.

Static properties are available which return the singleton instance of each type of factory available.

Inheritance
Object
Diffusion
Namespace: PushTechnology.ClientInterface.Client.Factories
Assembly: Diffusion.Client.dll
Syntax
public static class Diffusion : object

Properties

AuthenticationResult

Returns an empty IAuthenticationResultSource that can be used by IAuthenticationHandler authentication handlers as a starting point to create IAuthenticationResults.

Declaration
public static IAuthenticationResultSource AuthenticationResult { get; }
Property Value
Type Description
IAuthenticationResultSource
Remarks

Caution

IAuthenticationResultSource is now deprecated so this property will be removed in a future release.

Credentials

Returns the singleton credentials factory

Declaration
public static ICredentialsFactory Credentials { get; }
Property Value
Type Description
ICredentialsFactory

DataTypes

Returns the IDataTypes implementations.

Declaration
public static IDataTypes DataTypes { get; }
Property Value
Type Description
IDataTypes
Remarks

Since 5.8

ProxyAuthentication

Returns a proxy authentication scheme factory.

Declaration
public static IProxyAuthenticationFactory ProxyAuthentication { get; }
Property Value
Type Description
IProxyAuthenticationFactory

Sessions

Returns the singleton session factory.

Declaration
public static ISessionFactory Sessions { get; }
Property Value
Type Description
ISessionFactory

TopicSelectors

Returns a parser for topic selector expressions.

Declaration
public static ITopicSelectors TopicSelectors { get; }
Property Value
Type Description
ITopicSelectors
Remarks

Caution

Deprecated since 6.4. Topic selectors are no longer verified locally by the client library. Instead expressions will be sent to (and verified by) the Diffusion server. This method will be removed in a future release.

UpdateConstraints

Gets the update constraint factory.

Declaration
public static IUpdateConstraintFactory UpdateConstraints { get; }
Property Value
Type Description
IUpdateConstraintFactory

The update constraint factory.

Methods

EscapeString(String)

Escapes special characters within a string.

Declaration
public static string EscapeString(string value)
Parameters
Type Name Description
String value

The string value to be escaped.

Returns
Type Description
String

The escaped string.

Remarks

The following characters will be escaped:

Special CharacterEscaped Form
\"\\\"
\'\\\'
\\\\\\
\b\\b
\f\\f
\n\\n
\r\\r
\t\\t

Unicode character will not be escaped and UTF-16 as well as UTF-32 escape sequences will also remain.

NewSpecification(TopicType)

Creates a new ITopicSpecification for a given topic type.

Declaration
public static ITopicSpecification NewSpecification(TopicType topicType)
Parameters
Type Name Description
TopicType topicType

The topic type.

Returns
Type Description
ITopicSpecification

The new immutable specification with no properties set. New specifications with properties set may be produced using the WithProperty(String, String) or WithProperties(IDictionary<String, String>) methods of the provided specification.

RolesToString(IReadOnlyCollection<String>)

Converts a collection of roles to a escaped string representation.

Declaration
public static string RolesToString(IReadOnlyCollection<string> roles)
Parameters
Type Name Description
IReadOnlyCollection<String> roles

The collection of roles.

Returns
Type Description
String

THe escaped string representation of the roles.

Remarks

Every item in roles will be quoted and escaped based on the same rules as EscapeString(String).

Every item in roles will be separated by a comma in the resulting string.

Given a collection with two roles ("A" and "B") the resulting role string would be "\"A\", \"B\"".

StringToRoles(String)

Converts a string of roles to a collection of roles.

Declaration
public static IReadOnlyCollection<string> StringToRoles(string value)
Parameters
Type Name Description
String value

The string value to convert to a collection of roles.

Returns
Type Description
IReadOnlyCollection<String>

The collection of roles.

Remarks

The given string value must quote and separate each role with a comma. Whitespace characters in between the roles will be ignored.

Every role found in the given value will also be unquoted.

A string value of "\"A\", \"B\"" will result in a collection with the items "A" and "B".

Back to top