private void requestUpdateFailedStatus(final Throwable error) { if (!currentTokensOption.isPresent()) { currentAccessTokenFuture.completeExceptionally(error); } else if (lastTokenIsStillValid()) { //keep the old token } else { currentTokensOption = Optional.empty(); currentAccessTokenFuture = CompletableFutureUtils.failed(error); } authActor.tell(new AuthActorProtocol.FetchTokenFromSphereMessage());// }
private void requestUpdateFailedStatus(final Throwable error) { if (!currentTokensOption.isPresent()) { currentAccessTokenFuture.completeExceptionally(error); } else if (lastTokenIsStillValid()) { //keep the old token } else { currentTokensOption = Optional.empty(); currentAccessTokenFuture = CompletableFutureUtils.failed(error); } authActor.tell(new AuthActorProtocol.FetchTokenFromSphereMessage());// }