Ice.ObjectPrx¶
- class Ice.ObjectPrx¶
Bases:
ObjectPrxThe base class for all Ice proxies.
- static uncheckedCast(proxy: ObjectPrx | None, facet: str | None = None) ObjectPrx | None¶
Creates a new proxy from an existing proxy.
- 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:
- Returns:
A new proxy with the requested facet, or
Noneif the source proxy isNoneor if the target object/facet 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:
- Returns:
A new proxy with the requested facet, or
Noneif the source proxy isNoneor if the target object/facet does not support the requested type.- Return type:
ObjectPrx | None
- static ice_staticId() str¶
Returns the Slice type ID associated with this type.
- Returns:
The Slice type ID.
- Return type:
- ice_getCommunicator() Communicator¶
Gets the communicator that created this proxy.
- Returns:
The communicator that created this proxy.
- Return type:
- ice_isA(id: str, context: dict[str, str] | None = None) bool¶
Tests whether this object supports a specific Slice interface.
- ice_isAAsync(id: str, context: dict[str, str] | None = None) Awaitable[bool]¶
Tests whether this object supports a specific Slice interface.
- Parameters:
- Returns:
An
Awaitablethat completes when the invocation completes. It holdsTrueif the target object implements the Slice interface specified byidor implements a derived interface,Falseotherwise.- Return type:
Awaitable[bool]
- ice_ping(context: dict[str, str] | None = None)¶
Tests whether the target object of this proxy can be reached.
- ice_pingAsync(context: dict[str, str] | None = None) Awaitable[None]¶
Tests whether the target object of this proxy can be reached.
- ice_ids(context: dict[str, str] | None = None) list[str]¶
Returns the Slice interfaces supported by this object as a list of Slice type IDs.
- ice_idsAsync(context: dict[str, str] | None = None) Awaitable[list[str]]¶
Returns the Slice interfaces supported by this object as a list of Slice type IDs.
- ice_id(context: dict[str, str] | None = None) str¶
Returns the type ID of the most-derived Slice interface supported by this object.
- ice_idAsync(context: dict[str, str] | None = None) Awaitable[str]¶
Returns the type ID of the most-derived Slice interface supported by this object.
- ice_getIdentity() Identity¶
Gets the identity embedded in this proxy.
- Returns:
The identity of the target object.
- Return type:
- ice_identity(newIdentity: Identity) Self¶
Creates a proxy that is identical to this proxy, except for the identity.
- Parameters:
newIdentity (Identity) – The identity for the new proxy.
- Returns:
A proxy with the new identity.
- Return type:
Self
- ice_context(new_context: dict[str, str]) Self¶
Creates a proxy that is identical to this proxy, except for the per-proxy context.
- ice_getFacet() str¶
Gets 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:
- ice_facet(new_facet: str) Self¶
Creates a proxy that is identical to this proxy, except for the facet.
- Parameters:
new_facet (str) – The facet for the new proxy.
- Returns:
A proxy with the new facet.
- Return type:
Self
- ice_getAdapterId() str¶
Gets 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:
- ice_adapterId(newAdapterId: str) Self¶
Creates a proxy that is identical to this proxy, except for the adapter ID.
- Parameters:
newAdapterId (str) – The adapter ID for the new proxy.
- Returns:
A proxy with the new adapter ID.
- Return type:
Self
- ice_getEndpoints() tuple[Endpoint, ...]¶
Gets the endpoints used by this proxy.
- Returns:
The endpoints used by this proxy.
- Return type:
tuple[Ice.Endpoint, …]
- ice_endpoints(newEndpoints: tuple[Endpoint, ...] | list[Endpoint]) Self¶
Creates a proxy that is identical to this proxy, except for the endpoints.
- Parameters:
newEndpoints (tuple[Ice.Endpoint, ...] | list[Ice.Endpoint]) – The endpoints for the new proxy.
- Returns:
A proxy with the new endpoints.
- Return type:
Self
- ice_getLocatorCacheTimeout() int¶
Gets the locator cache timeout of this proxy.
- Returns:
The locator cache timeout value (in seconds).
- Return type:
- ice_locatorCacheTimeout(timeout: int) Self¶
Creates a proxy that is identical to this proxy, except for the locator cache timeout.
- Parameters:
timeout (int) – The new locator cache timeout (in seconds).
- Returns:
A proxy with the new timeout.
- Return type:
Self
- ice_invocationTimeout(timeout: int) Self¶
Creates a proxy that is identical to this proxy, except for the invocation timeout.
- Parameters:
timeout (int) – The new invocation timeout (in milliseconds).
- Returns:
A proxy with the new timeout.
- Return type:
Self
- ice_getInvocationTimeout() int¶
Gets the invocation timeout of this proxy.
- Returns:
The invocation timeout value (in milliseconds).
- Return type:
- ice_isConnectionCached() bool¶
Determines whether this proxy caches connections.
- Returns:
Trueif this proxy caches connections,Falseotherwise.- Return type:
- ice_connectionCached(newCache: bool) Self¶
Creates a proxy that is identical to this proxy, except for connection caching.
- Parameters:
newCache (bool) –
Trueif the new proxy should cache connections,Falseotherwise.- Returns:
A proxy with the specified caching policy.
- Return type:
Self
- ice_getEndpointSelection() EndpointSelectionType¶
Gets the endpoint selection policy for this proxy (randomly or ordered).
- Returns:
The endpoint selection policy.
- Return type:
- ice_endpointSelection(newType: EndpointSelectionType) Self¶
Creates a proxy that is identical to this proxy, except for the endpoint selection policy.
- Parameters:
newType (EndpointSelectionType) – The new endpoint selection policy.
- Returns:
A proxy with the specified endpoint selection policy.
- Return type:
Self
- ice_encodingVersion(version: EncodingVersion) Self¶
Creates a 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 request parameters.
- Returns:
A proxy with the specified encoding version.
- Return type:
Self
- ice_getEncodingVersion() EncodingVersion¶
Gets the encoding version used to marshal request parameters.
- Returns:
The encoding version.
- Return type:
- ice_getRouter() RouterPrx | None¶
Gets 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 | None
- ice_router(router: RouterPrx | None) Self¶
Creates a proxy that is identical to this proxy, except for the router.
- Parameters:
router (RouterPrx | None) – The router for the new proxy.
- Returns:
A proxy with the specified router.
- Return type:
Self
- ice_getLocator() LocatorPrx | None¶
Gets the locator for this proxy.
- Returns:
The locator for this proxy. If no locator is configured, the return value is
None.- Return type:
LocatorPrx | None
- ice_locator(locator: LocatorPrx | None) Self¶
Creates a proxy that is identical to this proxy, except for the locator.
- Parameters:
locator (LocatorPrx | None) – The locator for the new proxy.
- Returns:
A proxy with the specified locator.
- Return type:
Self
- ice_isCollocationOptimized() bool¶
Determines whether this proxy uses collocation optimization.
- Returns:
Trueif the proxy uses collocation optimization,Falseotherwise.- Return type:
- ice_collocationOptimized(collocated: bool) Self¶
Creates a proxy that is identical to this proxy, except for collocation optimization.
- Parameters:
collocated (bool) –
Trueif the new proxy enables collocation optimization,Falseotherwise.- Returns:
A proxy with the specified collocation optimization.
- Return type:
Self
- ice_twoway() Self¶
Creates a proxy that is identical to this proxy, but uses twoway invocations.
- Returns:
A proxy that uses twoway invocations.
- Return type:
Self
- ice_isTwoway() bool¶
Determines whether this proxy uses twoway invocations.
- Returns:
Trueif this proxy uses twoway invocations,Falseotherwise.- Return type:
- ice_oneway() Self¶
Creates a proxy that is identical to this proxy, but uses oneway invocations.
- Returns:
A proxy that uses oneway invocations.
- Return type:
Self
- ice_isOneway() bool¶
Determines whether this proxy uses oneway invocations.
- Returns:
Trueif this proxy uses oneway invocations,Falseotherwise.- Return type:
- ice_batchOneway() Self¶
Creates a proxy that is identical to this proxy, but uses batch oneway invocations.
- Returns:
A proxy that uses batch oneway invocations.
- Return type:
Self
- ice_isBatchOneway() bool¶
Determines whether this proxy uses batch oneway invocations.
- Returns:
Trueif this proxy uses batch oneway invocations,Falseotherwise.- Return type:
- ice_datagram() Self¶
Creates a proxy that is identical to this proxy, but uses datagram invocations.
- Returns:
A proxy that uses datagram invocations.
- Return type:
Self
- ice_isDatagram() bool¶
Determines whether this proxy uses datagram invocations.
- Returns:
Trueif this proxy uses datagram invocations,Falseotherwise.- Return type:
- ice_batchDatagram() Self¶
Creates a proxy that is identical to this proxy, but uses batch datagram invocations.
- Returns:
A proxy that uses batch datagram invocations.
- Return type:
Self
- ice_isBatchDatagram() bool¶
Determines whether this proxy uses batch datagram invocations.
- Returns:
Trueif this proxy uses batch datagram invocations,Falseotherwise.- Return type:
- ice_compress(compress: bool) Self¶
Creates a proxy that is identical to this proxy, except for its compression setting which overrides the compression setting from the proxy endpoints.
- Parameters:
compress (bool) –
Trueenables compression for the new proxy,Falsedisables compression.- Returns:
A proxy with the specified compression override setting.
- Return type:
Self
- ice_getCompress() bool | None¶
Gets the compression override setting of this proxy.
- Returns:
The compression override setting. If
Noneis returned, no override is set.Otherwise,
Trueif compression is enabled,Falseotherwise.
- Return type:
bool | None
- ice_connectionId(connectionId: str) Self¶
Creates a 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 proxy with the specified connection ID.
- Return type:
Self
- ice_getConnectionId() str¶
Gets the connection ID of this proxy.
- Returns:
The connection ID.
- Return type:
- ice_fixed(connection: Connection) Self¶
Creates 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:
Self
- ice_isFixed() bool¶
Determines whether this proxy is a fixed proxy.
- Returns:
Trueif this proxy is a fixed proxy,Falseotherwise.- Return type:
- ice_getConnection() Connection | None¶
Gets 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
Nonewhen the target object is collocated.- Return type:
Connection | None
Notes
You can call this function to establish a connection or associate the proxy with an existing connection and ignore the return value.
- ice_getCachedConnection() Connection | None¶
Gets 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, or
Noneif the proxy does not have an established connection.- Return type:
Connection | None