public abstract class BackendInfoResolver<T extends BackendInfo> extends Object implements AutoCloseable
ActorRef. This class needs to be specialized by the
client. It is used by ClientActorBehavior for request dispatch. Results are cached until they are invalidated
by either the client actor (when a message timeout is detected) and by the specific frontend (on explicit
invalidation or when updated information becomes available).
If the completion stage returned by this interface's methods fails with a
RequestException, it will be forwarded to all
outstanding requests towards the leader. If it fails with a TimeoutException,
resolution process will be retried. If it fails with any other cause, it will we wrapped as a
RuntimeRequestException wrapping that cause.
| Constructor and Description |
|---|
BackendInfoResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
abstract CompletionStage<? extends T> |
getBackendInfo(Long cookie)
Request resolution of a particular backend identified by a cookie.
|
abstract org.opendaylight.yangtools.concepts.Registration |
notifyWhenBackendInfoIsStale(Consumer<Long> callback)
Registers a callback to be notified when BackendInfo that may have been previously obtained is now stale and
should be refreshed.
|
abstract CompletionStage<? extends T> |
refreshBackendInfo(Long cookie,
T staleInfo)
Request re-resolution of a particular backend identified by a cookie, indicating a particular information as
being stale.
|
@Nonnull public abstract CompletionStage<? extends T> getBackendInfo(@Nonnull Long cookie)
cookie - Backend cookieCompletionStage resulting in information about the backend@Nonnull public abstract CompletionStage<? extends T> refreshBackendInfo(@Nonnull Long cookie, @Nonnull T staleInfo)
cookie - Backend cookiestaleInfo - Stale backend informationCompletionStage resulting in information about the backend@Nonnull public abstract org.opendaylight.yangtools.concepts.Registration notifyWhenBackendInfoIsStale(Consumer<Long> callback)
callback - the callback that takes the backend cookie whose BackendInfo is now stale.public void close()
close in interface AutoCloseableCopyright © 2019 OpenDaylight. All rights reserved.