Table of Contents

Struct LocatorProxy

Namespace
IceRpc.Ice
Assembly
IceRpc.Locator.dll

Implements ILocator by making invocations on a remote IceRPC service. This remote service must implement Ice interface ::Ice::Locator.

[IceTypeId("::Ice::Locator")]
public readonly record struct LocatorProxy : ILocator, IIceProxy, IEquatable<LocatorProxy>
Implements
Inherited Members
Extension Methods

Constructors

LocatorProxy()

Constructs a proxy that uses the default service address: its protocol is ice and its path is DefaultServicePath.

public LocatorProxy()

LocatorProxy(IInvoker, ServiceAddress?, IceEncodeOptions?)

Constructs a proxy from an invoker, a service address and encode options.

[SetsRequiredMembers]
public LocatorProxy(IInvoker invoker, ServiceAddress? serviceAddress = null, IceEncodeOptions? encodeOptions = null)

Parameters

invoker IInvoker

The invocation pipeline of the proxy.

serviceAddress ServiceAddress

The service address. null is equivalent to the default service address (protocol: ice, path: DefaultServicePath).

encodeOptions IceEncodeOptions

The encode options, used to customize the encoding of request payloads.

LocatorProxy(IInvoker, Uri, IceEncodeOptions?)

Constructs a proxy from an invoker, a service address URI and encode options.

[SetsRequiredMembers]
public LocatorProxy(IInvoker invoker, Uri serviceAddressUri, IceEncodeOptions? encodeOptions = null)

Parameters

invoker IInvoker

The invocation pipeline of the proxy.

serviceAddressUri Uri

A URI that represents a service address.

encodeOptions IceEncodeOptions

The encode options, used to customize the encoding of request payloads.

Fields

DefaultServicePath

Represents the default path for IceRPC services that implement Ice interface ::Ice::Locator.

public const string DefaultServicePath = "/Ice.Locator"

Field Value

string

Properties

EncodeOptions

Gets or initializes the encode options, used to customize the encoding of payloads created from this proxy.

public IceEncodeOptions? EncodeOptions { get; init; }

Property Value

IceEncodeOptions

Invoker

Gets or initializes the invocation pipeline of this proxy.

public required IInvoker Invoker { get; init; }

Property Value

IInvoker

ServiceAddress

Gets or initializes the address of the remote service.

public ServiceAddress ServiceAddress { get; init; }

Property Value

ServiceAddress

Methods

FindAdapterByIdAsync(string, IFeatureCollection?, CancellationToken)

Finds an object adapter by adapter ID and returns a dummy proxy with the object adapter's endpoint(s).

public Task<IceObjectProxy?> FindAdapterByIdAsync(string id, IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

id string

The adapter ID.

features IFeatureCollection

The features of this invocation.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<IceObjectProxy?>

A dummy proxy with the adapter's endpoints, or null if an object adapter with id was not found.

Exceptions

DispatchException

Thrown when the dispatch of the operation failed. This exception is provided through the returned task; it's never thrown synchronously.

AdapterNotFoundException

Thrown when an object adapter with this adapter ID was not found. The caller should treat this exception like a null return value. This exception is provided through the returned task; it's never thrown synchronously.

FindObjectByIdAsync(Identity, IFeatureCollection?, CancellationToken)

Finds an object by identity and returns a dummy proxy with endpoint(s) that can be used to reach this object. This dummy proxy may be an indirect proxy that requires further resolution using FindAdapterByIdAsync(string, IFeatureCollection?, CancellationToken).

public Task<IceObjectProxy?> FindObjectByIdAsync(Identity id, IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

id Identity

The identity.

features IFeatureCollection

The features of this invocation.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<IceObjectProxy?>

A dummy proxy, or null if an object with the requested identity was not found.

Exceptions

DispatchException

Thrown when the dispatch of the operation failed. This exception is provided through the returned task; it's never thrown synchronously.

ObjectNotFoundException

Thrown when an object with the requested identity was not found. The caller should treat this exception like a null return value. This exception is provided through the returned task; it's never thrown synchronously.

GetRegistryAsync(IFeatureCollection?, CancellationToken)

Gets a proxy to the locator registry.

public Task<LocatorRegistryProxy?> GetRegistryAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

features IFeatureCollection

The features of this invocation.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<LocatorRegistryProxy?>

A proxy to the locator registry, or null if this locator has no associated registry.

Exceptions

DispatchException

Thrown when the dispatch of the operation failed. This exception is provided through the returned task; it's never thrown synchronously.