Table of Contents

Struct LocatorProxy

Namespace
IceRpc.Slice.Ice
Assembly
IceRpc.Locator.dll

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

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

Remarks

The Slice compiler generated this record struct from the Slice interface Ice::Locator.

Constructors

LocatorProxy()

Constructs a proxy with an icerpc service address with path DefaultServicePath.

public LocatorProxy()

LocatorProxy(IInvoker, ServiceAddress?, SliceEncodeOptions?)

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

public LocatorProxy(IInvoker invoker, ServiceAddress? serviceAddress = null, SliceEncodeOptions? encodeOptions = null)

Parameters

invoker IInvoker

The invocation pipeline of the proxy.

serviceAddress ServiceAddress

The service address. null is equivalent to an icerpc service address with path DefaultServicePath.

encodeOptions SliceEncodeOptions

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

LocatorProxy(IInvoker, Uri, SliceEncodeOptions?)

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

public LocatorProxy(IInvoker invoker, Uri serviceAddressUri, SliceEncodeOptions? encodeOptions = null)

Parameters

invoker IInvoker

The invocation pipeline of the proxy.

serviceAddressUri Uri

A URI that represents a service address.

encodeOptions SliceEncodeOptions

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

Fields

DefaultServicePath

Represents the default path for IceRPC services that implement Slice 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 SliceEncodeOptions? EncodeOptions { get; init; }

Property Value

SliceEncodeOptions

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 service address with the object adapter's server address(es).

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

Parameters

id string

The adapter ID.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<ServiceAddress>

A dummy service address with the adapter's server address(es), or null if an object adapter with adapter ID id was not found.

Exceptions

AdapterNotFoundException

Thrown if an object adapter with this adapter ID was not found. The caller should treat this exception like a null return value.

FindObjectByIdAsync(string, IFeatureCollection?, CancellationToken)

Finds a service by identity (path) and returns a dummy service address with the server address(es) that can be used to reach this service. This dummy service address can also carry no server address and require further resolution using FindAdapterByIdAsync(string, IFeatureCollection?, CancellationToken).

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

Parameters

id string

The identity represented as a path.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<ServiceAddress>

A dummy service address, or null if a service with the requested identity (path) was not found.

Exceptions

ObjectNotFoundException

Thrown if a service with the requested identity (path) was not found. The caller should treat this exception like a null return value.

FromPath(string)

Creates a relative proxy from a path.

public static LocatorProxy FromPath(string path)

Parameters

path string

The path.

Returns

LocatorProxy

The new relative proxy.

GetRegistryAsync(IFeatureCollection?, CancellationToken)

Gets a proxy to the locator registry.

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

Parameters

features IFeatureCollection

The invocation features.

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.