@ThreadSafe public abstract class BackendInfoResolver<T extends BackendInfo> extends Object
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).| Constructor and Description |
|---|
BackendInfoResolver() |
| Modifier and Type | Method and Description |
|---|---|
Optional<T> |
getFutureBackendInfo(Long cookie)
Return the currently-resolved backend information, if available.
|
void |
invalidateBackend(long cookie,
CompletionStage<? extends BackendInfo> info)
Invalidate a particular instance of
BackendInfo, typically as a response to a request timing out. |
protected abstract void |
invalidateBackendInfo(CompletionStage<? extends BackendInfo> info)
Invalidate previously-resolved shard information.
|
protected abstract CompletableFuture<T> |
resolveBackendInfo(Long cookie)
Request new resolution of a particular backend identified by a cookie.
|
public final Optional<T> getFutureBackendInfo(Long cookie)
cookie - Backend cookiepublic final void invalidateBackend(long cookie,
@Nonnull
CompletionStage<? extends BackendInfo> info)
BackendInfo, typically as a response to a request timing out. If
the provided information is not the one currently cached this method does nothing.cookie - Backend cookieinfo - Previous information to be invalidated@Nonnull protected abstract CompletableFuture<T> resolveBackendInfo(@Nonnull Long cookie)
cookie - Backend cookieCompletableFuture resulting in information about the backendprotected abstract void invalidateBackendInfo(@Nonnull CompletionStage<? extends BackendInfo> info)
info - Previous promise of backend informationCopyright © 2016 OpenDaylight. All rights reserved.