io.strimzi.kafka.oauth.services.SessionFuture Maven / Gradle / Ivy
/*
* Copyright 2017-2020, Strimzi authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.strimzi.kafka.oauth.services;
import io.strimzi.kafka.oauth.common.BearerTokenWithPayload;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
public class SessionFuture implements Future {
private Future delegate;
private BearerTokenWithPayload token;
public SessionFuture(BearerTokenWithPayload token, Future future) {
this.token = token;
this.delegate = future;
}
public BearerTokenWithPayload getToken() {
return token;
}
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return delegate.cancel(mayInterruptIfRunning);
}
@Override
public boolean isCancelled() {
return delegate.isCancelled();
}
@Override
public boolean isDone() {
return delegate.isDone();
}
@Override
public T get() throws InterruptedException, ExecutionException {
return delegate.get();
}
@Override
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
return delegate.get(timeout, unit);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy