com.kuka.nav.command
Interface RequestContainer

All Known Subinterfaces:
GenericRequestContainer

public interface RequestContainer

Base interface for request results. An executing request is tracked by a request container that receives the updates and results from the request. listener.


Method Summary
 void awaitFinished()
          Blocks until the request is finished or cancelled.
 void awaitFinished(long timeout, TimeUnit timeUnit)
          Blocks until the request is finished or cancelled.
 void awaitUpdate()
          Blocks until the result has been updated.
 void awaitUpdate(long timeout, TimeUnit timeUnit)
          Blocks until the result has been updated or until the timeout is reached.
 void cancel()
          Cancels this request and immediately finishes it.
 Throwable getError()
           
 boolean hasError()
           
 boolean isCancelled()
           
 boolean isFinished()
           
 boolean isValid()
           
 

Method Detail

cancel

void cancel()
Cancels this request and immediately finishes it. If the request is pending the system will abort it, has no effect if it is already finished.


isCancelled

boolean isCancelled()
Returns:
True if the request has been cancelled.

isFinished

boolean isFinished()
Returns:
True if the request has finished and no further updates occur. It can either finish on its own, it could have been cancelled or encountered an error.

isValid

boolean isValid()
Returns:
True if valid result data can be read.

Note: If this method returns false, calling any getter on this container may lead to an exception.


hasError

boolean hasError()
Returns:
True if the request was aborted unexpectedly.

getError

Throwable getError()
Returns:
The error that caused the request to abort or null if the request is still running or it completed without error.

awaitFinished

void awaitFinished()
Blocks until the request is finished or cancelled.


awaitFinished

void awaitFinished(long timeout,
                   TimeUnit timeUnit)
                   throws TimeoutException
Blocks until the request is finished or cancelled.

Parameters:
timeout - The maximum time to wait for the request to finish.
timeUnit - The time unit.
Throws:
TimeoutException - If the timeout occurs.

awaitUpdate

void awaitUpdate()
Blocks until the result has been updated.


awaitUpdate

void awaitUpdate(long timeout,
                 TimeUnit timeUnit)
                 throws TimeoutException
Blocks until the result has been updated or until the timeout is reached.

Parameters:
timeout - The timeout.
timeUnit - The time unit.
Throws:
TimeoutException - If the timeout occurs.


Copyright © 2019. All rights reserved.