Ice.ObjectPrx

class Ice.ObjectPrx

Bases: ObjectPrx

The base class for all proxies.

static checkedCast(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) ObjectPrx | None

Creates a new proxy from an existing proxy after confirming the target object’s type via a remote invocation.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

  • context (dict[str, str], optional) – The request context.

Returns:

A new proxy with the requested type, or None if the source proxy is None or if the target object does not support the requested type.

Return type:

ObjectPrx | None

static checkedCastAsync(proxy: ObjectPrx, facet: str | None = None, context: dict[str, str] | None = None) Awaitable[ObjectPrx | None]

Creates a new proxy from an existing proxy after confirming the target object’s type via a remote invocation.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

  • context (dict[str, str], optional) – The request context.

Returns:

A new proxy with the requested type, or None if the source proxy is None or if the target object does not support the requested type.

Return type:

ObjectPrx | None

ice_adapterId(newAdapterId: str) Self

Creates a new proxy that is identical to this proxy, except for the adapter ID.

Parameters:

newAdapterId (str) – The adapter ID for the new proxy.

Returns:

The proxy with the new adapter ID.

Return type:

ObjectPrx

ice_batchDatagram() Self

Creates a new proxy that is identical to this proxy, but uses batch datagram invocations.

Returns:

A new proxy that uses batch datagram invocations.

Return type:

ObjectPrx

ice_batchOneway() Self

Creates a new proxy that is identical to this proxy, but uses batch oneway invocations.

Returns:

A new proxy that uses batch oneway invocations.

Return type:

ObjectPrx

ice_collocationOptimized(collocated: bool) Self

Creates a new proxy that is identical to this proxy, except for collocation optimization.

Parameters:

collocated (bool) – True if the new proxy enables collocation optimization; False otherwise.

Returns:

The new proxy with the specified collocation optimization.

Return type:

ObjectPrx

ice_compress(compress: bool) Self

Creates a new proxy that is identical to this proxy, except for compression.

Parameters:

compress (bool) – True enables compression for the new proxy; False disables compression.

Returns:

A new proxy with the specified compression setting.

Return type:

ObjectPrx

ice_connectionCached(newCache: bool) Self

Creates a new proxy that is identical to this proxy, except for connection caching.

Parameters:

newCache (bool) – True if the new proxy should cache connections; False otherwise.

Returns:

The new proxy with the specified caching policy.

Return type:

ObjectPrx

ice_connectionId(connectionId: str) Self

Creates a new proxy that is identical to this proxy, except for its connection ID.

Parameters:

connectionId (str) – The connection ID for the new proxy. An empty string removes the connection ID.

Returns:

A new proxy with the specified connection ID.

Return type:

ObjectPrx

ice_context(new_context: dict[str, str]) Self

Creates a new proxy that is identical to this proxy, except for the per-proxy context.

Parameters:

new_context (dict[str, str]) – The context for the new proxy.

Returns:

The proxy with the new per-proxy context.

Return type:

ObjectPrx

ice_datagram() Self

Creates a new proxy that is identical to this proxy, but uses datagram invocations.

Returns:

A new proxy that uses datagram invocations.

Return type:

ObjectPrx

ice_encodingVersion(version: EncodingVersion) Self

Creates a new proxy that is identical to this proxy, except for the encoding used to marshal parameters.

Parameters:

version (EncodingVersion) – The encoding version to use to marshal requests parameters.

Returns:

The new proxy with the specified encoding version.

Return type:

ObjectPrx

ice_endpointSelection(newType: EndpointSelectionType) Self

Creates a new proxy that is identical to this proxy, except for the endpoint selection policy.

Parameters:

newType (EndpointSelectionType) – The new endpoint selection policy.

Returns:

The new proxy with the specified endpoint selection policy.

Return type:

ObjectPrx

ice_endpoints(newEndpoints: tuple[Endpoint, ...] | list[Endpoint]) Self

Creates a new proxy that is identical to this proxy, except for the endpoints.

Parameters:

newEndpoints (tuple[IcePy.Endpoint, ...] | list[IcePy.Endpoint]) – The endpoints for the new proxy.

Returns:

The proxy with the new endpoints.

Return type:

ObjectPrx

ice_facet(new_facet: str) Self

Creates a new proxy that is identical to this proxy, except for the facet.

Parameters:

new_facet (str) – The facet for the new proxy.

Returns:

The proxy with the new facet.

Return type:

ObjectPrx

ice_fixed(connection: Connection) Self

Returns a proxy that is identical to this proxy, except it’s a fixed proxy bound to the given connection.

Parameters:

connection (Connection) – The fixed proxy connection.

Returns:

A fixed proxy bound to the given connection.

Return type:

ObjectPrx

ice_flushBatchRequests() None

Flushes any pending batched requests for this proxy. The call blocks until the flush is complete.

Return type:

None

ice_getAdapterId() str

Returns the adapter ID for this proxy.

Returns:

The adapter ID. If the proxy does not have an adapter ID, the return value is the empty string.

Return type:

str

ice_getCachedConnection() Connection | None

Returns the cached Connection for this proxy. If the proxy does not yet have an established connection, it does not attempt to create a connection.

Returns:

The cached Connection for this proxy (None if the proxy does not have an established connection).

Return type:

Connection | None

ice_getCommunicator() Communicator

Return the communicator that created this proxy.

Returns:

The communicator that created this proxy.

Return type:

Communicator

ice_getCompress() bool | None

Obtains the compression override setting of this proxy.

Returns:

The compression override setting. If no optional value is present, no override is set. Otherwise, true if compression is enabled, false otherwise.

Return type:

bool or None

ice_getConnection() Connection | None

Returns the Connection for this proxy. If the proxy does not yet have an established connection, it first attempts to create a connection.

Returns:

The Connection for this proxy, or null when the target object is collocated.

Return type:

Connection | None

ice_getConnectionId() str

Returns the connection id of this proxy.

Returns:

The connection id.

Return type:

str

ice_getContext() dict[str, str] | None

Returns the per-proxy context for this proxy.

Returns:

The per-proxy context. If the proxy does not have a per-proxy (implicit) context, the return value is None.

Return type:

dict[str, str] | None

ice_getEncodingVersion() EncodingVersion

Returns the encoding version used to marshal requests parameters.

Returns:

The encoding version.

Return type:

EncodingVersion

ice_getEndpointSelection() EndpointSelectionType

Returns how this proxy selects endpoints (randomly or ordered).

Returns:

The endpoint selection policy.

Return type:

EndpointSelectionType

ice_getEndpoints() tuple[Endpoint, ...]

Returns the endpoints used by this proxy.

Returns:

The endpoints used by this proxy.

Return type:

tuple[IcePy.Endpoint, …]

ice_getFacet() str

Returns the facet for this proxy.

Returns:

The facet for this proxy. If the proxy uses the default facet, the return value is the empty string.

Return type:

str

ice_getIdentity() Identity

Return the identity embedded in this proxy.

Returns:

The identity of the target object.

Return type:

Identity

ice_getInvocationTimeout() int

Returns the invocation timeout of this proxy.

Returns:

The invocation timeout value (in seconds).

Return type:

int

ice_getLocator() LocatorPrx | None

Returns the locator for this proxy.

Returns:

The locator for this proxy. If no locator is configured, the return value is None.

Return type:

LocatorPrx or None

ice_getLocatorCacheTimeout() int

Returns the locator cache timeout of this proxy.

Returns:

The locator cache timeout value (in seconds).

Return type:

int

ice_getRouter() RouterPrx | None

Returns the router for this proxy.

Returns:

The router for the proxy. If no router is configured for the proxy, the return value is None.

Return type:

RouterPrx or None

ice_id(context: dict[str, str] | None = None) str

Return the Slice type ID of the most-derived interface supported by the target object of this proxy.

Parameters:

context (dict[str, str], optional) – The context dictionary for the invocation.

Returns:

The Slice type ID of the most-derived interface.

Return type:

str

ice_idAsync(context: dict[str, str] | None = None) Awaitable[str]

Return the Slice type ID of the most-derived interface supported by the target object of this proxy.

Parameters:

context (dict[str, str], optional) – The context dictionary for the invocation.

Returns:

The Slice type ID of the most-derived interface.

Return type:

str

ice_identity(newIdentity: Identity) Self

Create a new proxy that is identical to this proxy, except for the per-proxy context.

Parameters:

newIdentity (Identity) – The identity for the new proxy.

Returns:

The proxy with the new identity.

Return type:

ObjectPrx

ice_ids(context: dict[str, str] | None = None) list[str]

Return the Slice type IDs of the interfaces supported by the target object of this proxy.

Parameters:

context (dict[str, str], optional) – The context dictionary for the invocation.

Returns:

The Slice type IDs of the interfaces supported by the target object, in alphabetical order.

Return type:

list of str

ice_idsAsync(context: dict[str, str] | None = None) Awaitable[list[str]]

Return the Slice type IDs of the interfaces supported by the target object of this proxy.

Parameters:

context (dict[str, str], optional) – The context dictionary for the invocation.

Returns:

The Slice type IDs of the interfaces supported by the target object, in alphabetical order.

Return type:

list of str

ice_invocationTimeout(timeout: int) Self

Creates a new proxy that is identical to this proxy, except for the invocation timeout.

Parameters:

timeout (int) – The new invocation timeout (in seconds).

Returns:

The proxy with the new invocation timeout.

Return type:

ObjectPrx

ice_isA(id: str, context: dict[str, str] | None = None) bool

Test whether this object supports a specific Slice interface.

Parameters:
  • id (str) – The type ID of the Slice interface to test against.

  • context (dict[str, str], optional) – The context dictionary for the invocation.

Returns:

True if the target object has the interface specified by id or derives from the interface specified by id.

Return type:

bool

ice_isAAsync(id: str, context: dict[str, str] | None = None) Awaitable[bool]

Test whether this object supports a specific Slice interface.

Parameters:
  • id (str) – The type ID of the Slice interface to test against.

  • context (dict[str, str], optional) – The context dictionary for the invocation.

Returns:

True if the target object has the interface specified by id or derives from the interface specified by id.

Return type:

bool

ice_isBatchDatagram() bool

Returns whether this proxy uses batch datagram invocations.

Returns:

True if this proxy uses batch datagram invocations; False otherwise.

Return type:

bool

ice_isBatchOneway() bool

Returns whether this proxy uses batch oneway invocations.

Returns:

True if this proxy uses batch oneway invocations; False otherwise.

Return type:

bool

ice_isCollocationOptimized() bool

Returns whether this proxy uses collocation optimization.

Returns:

True if the proxy uses collocation optimization; False otherwise.

Return type:

bool

ice_isConnectionCached() bool

Returns whether this proxy caches connections.

Returns:

True if this proxy caches connections; False otherwise.

Return type:

bool

ice_isDatagram() bool

Returns whether this proxy uses datagram invocations.

Returns:

True if this proxy uses datagram invocations; False otherwise.

Return type:

bool

ice_isFixed() bool

Returns whether this proxy is a fixed proxy.

Returns:

True if this is a fixed proxy; False otherwise.

Return type:

bool

ice_isOneway() bool

Returns whether this proxy uses oneway invocations.

Returns:

True if this proxy uses oneway invocations; False otherwise.

Return type:

bool

ice_isTwoway() bool

Returns whether this proxy uses twoway invocations.

Returns:

True if this proxy uses twoway invocations; False otherwise.

Return type:

bool

ice_locator(locator: LocatorPrx | None) Self

Creates a new proxy that is identical to this proxy, except for the locator.

Parameters:

locator (LocatorPrx or None) – The locator for the new proxy.

Returns:

The new proxy with the specified locator.

Return type:

ObjectPrx

ice_locatorCacheTimeout(timeout: int) Self

Creates a new proxy that is identical to this proxy, except for the locator cache timeout.

Parameters:

timeout (int) – The new locator cache timeout (in seconds).

Returns:

The proxy with the new locator cache timeout.

Return type:

ObjectPrx

ice_oneway() Self

Creates a new proxy that is identical to this proxy, but uses oneway invocations.

Returns:

A new proxy that uses oneway invocations.

Return type:

ObjectPrx

ice_ping(context: dict[str, str] | None = None)

Test whether the target object of this proxy can be reached.

Parameters:

context (dict[str, str], optional) – The context dictionary for the invocation.

Examples

>>> obj.ice_ping(context={"key": "value"})
ice_pingAsync(context: dict[str, str] | None = None)

Test whether the target object of this proxy can be reached.

Parameters:

context (dict[str, str], optional) – The context dictionary for the invocation.

Examples

>>> obj.ice_ping(context={"key": "value"})
ice_router(router: RouterPrx | None) Self

Creates a new proxy that is identical to this proxy, except for the router.

Parameters:

router (RouterPrx or None) – The router for the new proxy.

Returns:

The new proxy with the specified router.

Return type:

ObjectPrx

static ice_staticId() str

Gets the Slice type ID of the interface associated with this proxy.

Returns:

The type ID, “::Ice::Object”.

Return type:

str

ice_twoway() Self

Creates a new proxy that is identical to this proxy, but uses twoway invocations.

Returns:

A new proxy that uses twoway invocations.

Return type:

ObjectPrx

static uncheckedCast(proxy: ObjectPrx | None, facet: str | None = None) ObjectPrx | None

Creates a new proxy from an existing proxy.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

Returns:

A new proxy with the requested type, or None if the source proxy is None.

Return type:

ObjectPrx | None