Package io.strimzi.kafka.oauth.services
Class SessionFuture<T>
java.lang.Object
io.strimzi.kafka.oauth.services.SessionFuture<T>
- Type Parameters:
T- A generic type of the Future result
- All Implemented Interfaces:
Future<T>
A Java
Future implementation used in conjunction with Sessions.executeTask(ExecutorService, Predicate, Consumer) method-
Constructor Summary
ConstructorsConstructorDescriptionSessionFuture(BearerTokenWithPayload token, Future<T> future) Create a new instance -
Method Summary
-
Constructor Details
-
SessionFuture
Create a new instance- Parameters:
token- Token object representing a sessionfuture- Original future instance to wrap
-
-
Method Details
-
getToken
Get aBearerTokenWithPayloadobject representing a session- Returns:
- A token instance
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-