Interface DOMRpcAvailabilityListener
-
- All Superinterfaces:
EventListener
@Deprecated(forRemoval=true) public interface DOMRpcAvailabilityListener extends EventListener
Deprecated, for removal: This API element is subject to removal in a future version.UseDOMRpcAvailabilityListenerinstead.AnEventListenerused to track RPC implementations becoming (un)available aDOMRpcService. Note that the reportedDOMRpcIdentifiers form an identifier space shared between RFC7950 actions and RFC6020 RPCs, the former being also known as 'Routed RPCs'.Interpretation of DOMRpcIdentifiers has to be evaluated in the context of one of these types, which need to be determined by matching
DOMRpcIdentifier.getType()against aSchemaContext, which determines actual semantics ofDOMRpcIdentifier.getContextReference(). Corresponding SchemaNode is required to be a known sub-interface ofOperationDefinition.For RFC6020 RPCs, reported context reference is always non-null and empty. It indicates an RPC implementation has been registered and invocations can be reasonably (with obvious distributed system caveats coming from asynchronous events) expected to succeed.
For RFC7950 actions with a non-empty context-reference, the indication is the same as for RFC6020 RPCs.
For RFC7950 actions with an empty context-reference, the indication is that the corresponding actions are potentially available, but are subject to dynamic lifecycle of their context references. This includes two primary use cases:
- dynamic action instantiation (when a device connects)
- dynamic action translation, such as transforming one action into another
Second use case will not be providing further events, but rather will attempt to map any incoming invocation onto some other RPC or action, or similar, which can separately fail. If a sub-request fails, such implementations are required do report
DOMRpcImplementationNotAvailableExceptionas the invocation result, with the underlying failure being linked as a cause.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default booleanacceptsImplementation(DOMRpcImplementation impl)Deprecated, for removal: This API element is subject to removal in a future version.Implementation filtering method.voidonRpcAvailable(@NonNull Collection<DOMRpcIdentifier> rpcs)Deprecated, for removal: This API element is subject to removal in a future version.Method invoked whenever an RPC type becomes available.voidonRpcUnavailable(@NonNull Collection<DOMRpcIdentifier> rpcs)Deprecated, for removal: This API element is subject to removal in a future version.Method invoked whenever an RPC type becomes unavailable.
-
-
-
Method Detail
-
onRpcAvailable
void onRpcAvailable(@NonNull Collection<DOMRpcIdentifier> rpcs)
Deprecated, for removal: This API element is subject to removal in a future version.Method invoked whenever an RPC type becomes available.- Parameters:
rpcs- RPC types newly available
-
onRpcUnavailable
void onRpcUnavailable(@NonNull Collection<DOMRpcIdentifier> rpcs)
Deprecated, for removal: This API element is subject to removal in a future version.Method invoked whenever an RPC type becomes unavailable.- Parameters:
rpcs- RPC types which became unavailable
-
acceptsImplementation
default boolean acceptsImplementation(DOMRpcImplementation impl)
Deprecated, for removal: This API element is subject to removal in a future version.Implementation filtering method. This method is useful for forwarding RPC implementations, which need to ensure they do not re-announce their own implementations. Without this method a forwarder which registers an implementation would be notified of its own implementation, potentially re-exporting it as local -- hence creating a forwarding loop.- Parameters:
impl- RPC implementation being registered- Returns:
- False if the implementation should not be reported, defaults to true.
-
-