Table of Contents

Struct LocatorRegistryProxy

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

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

[SliceTypeId("::Ice::LocatorRegistry")]
public readonly record struct LocatorRegistryProxy : ILocatorRegistry, IProxy, IEquatable<LocatorRegistryProxy>
Implements
Inherited Members
Extension Methods

Remarks

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

Constructors

LocatorRegistryProxy()

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

public LocatorRegistryProxy()

LocatorRegistryProxy(IInvoker, ServiceAddress?, SliceEncodeOptions?)

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

public LocatorRegistryProxy(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.

LocatorRegistryProxy(IInvoker, Uri, SliceEncodeOptions?)

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

public LocatorRegistryProxy(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::LocatorRegistry.

public const string DefaultServicePath = "/Ice.LocatorRegistry"

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

FromPath(string)

Creates a relative proxy from a path.

public static LocatorRegistryProxy FromPath(string path)

Parameters

path string

The path.

Returns

LocatorRegistryProxy

The new relative proxy.

SetAdapterDirectProxyAsync(string, ServiceAddress?, IFeatureCollection?, CancellationToken)

Registers or unregisters the server addresses of an object adapter.

public Task SetAdapterDirectProxyAsync(string id, ServiceAddress? proxy = null, IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

id string

The adapter ID.

proxy ServiceAddress

A dummy service address created by the object adapter. proxy carries the object adapter's server addresses. The locator considers an object adapter to be active after it has registered its server addresses. When proxy is null, the server addresses are unregistered and the locator considers the object adapter inactive.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task

A task that completes when the response is received.

Exceptions

AdapterNotFoundException

Thrown if the locator only allows registered object adapters to register their active server addresses and no object adapter with this adapter ID was registered with the locator.

AdapterAlreadyActiveException

Thrown if an object adapter with the same adapter ID has already registered its server addresses.

SetReplicatedAdapterDirectProxyAsync(string, string, ServiceAddress?, IFeatureCollection?, CancellationToken)

Registers or unregisters the server addresses of an object adapter. This object adapter is a member of a replica group.

public Task SetReplicatedAdapterDirectProxyAsync(string adapterId, string replicaGroupId, ServiceAddress? proxy = null, IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

adapterId string

The adapter ID.

replicaGroupId string

The replica group ID.

proxy ServiceAddress

A dummy service address created by the object adapter. proxy carries the object adapter's server addresses. The locator considers an object adapter to be active after it has registered its server addresses. When proxy is null, the server addresses are unregistered and the locator considers the object adapter inactive.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task

A task that completes when the response is received.

Exceptions

AdapterNotFoundException

Thrown if the locator only allows registered object adapters to register their active server addresses and no object adapter with this adapter ID was registered with the locator.

AdapterAlreadyActiveException

Thrown if an object adapter with the same adapter ID has already registered its server addresses.

InvalidReplicaGroupIdException

Thrown if the given replica group does not match the replica group associated with the adapter ID in the locator's database.

SetServerProcessProxyAsync(string, ProcessProxy, IFeatureCollection?, CancellationToken)

Registers a proxy for the IProcess service of a server application.

public Task SetServerProcessProxyAsync(string serverId, ProcessProxy proxy, IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

serverId string

The server ID.

proxy ProcessProxy

A proxy for the Process service of the server application.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task

A task that completes when the response is received.

Exceptions

ServerNotFoundException

Thrown if the locator does not know a server application with this server ID.