Package jadex.extension.rs.publish
Class AbstractRestPublishService.RequestInfo
- java.lang.Object
-
- jadex.extension.rs.publish.AbstractRestPublishService.RequestInfo
-
- Enclosing class:
- AbstractRestPublishService
public static class AbstractRestPublishService.RequestInfo extends java.lang.Object
Struct for storing info about a request and the results.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Throwable
exception
protected IFuture<?>
future
protected long
lastcheck
protected AbstractRestPublishService.MappingInfo
mappingInfo
protected java.util.Queue<java.lang.Object>
results
protected boolean
terminated
-
Constructor Summary
Constructors Constructor Description RequestInfo(AbstractRestPublishService.MappingInfo mappingInfo, IFuture<?> future)
Create a request info.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResult(java.lang.Object result)
Add a result.boolean
checkForResult()
Check, if there is a result that is not yet consumed.java.lang.Throwable
getException()
Get the exception (if any).IFuture<?>
getFuture()
Get the future.AbstractRestPublishService.MappingInfo
getMappingInfo()
Get the mappingInfo.java.lang.Object
getNextResult()
Get the next result (FIFO order).java.lang.Object
getResults()
Get the results.long
getTimestamp()
Get the timestamp of the last check (i.e. last request from browser).boolean
isTerminated()
Check if terminatedvoid
setException(java.lang.Throwable exception)
Set the exception.void
setTerminated()
Set it to terminated.
-
-
-
Field Detail
-
results
protected java.util.Queue<java.lang.Object> results
-
mappingInfo
protected AbstractRestPublishService.MappingInfo mappingInfo
-
terminated
protected boolean terminated
-
exception
protected java.lang.Throwable exception
-
lastcheck
protected long lastcheck
-
future
protected IFuture<?> future
-
-
Constructor Detail
-
RequestInfo
public RequestInfo(AbstractRestPublishService.MappingInfo mappingInfo, IFuture<?> future)
Create a request info.
-
-
Method Detail
-
setTerminated
public void setTerminated()
Set it to terminated.
-
isTerminated
public boolean isTerminated()
Check if terminated- Returns:
- True if terminated.
-
checkForResult
public boolean checkForResult()
Check, if there is a result that is not yet consumed. Also increases the check timer to detect timeout when browser is disconnected.- Returns:
- True if there is a result.
-
addResult
public void addResult(java.lang.Object result)
Add a result.- Parameters:
result
- The result to add
-
getMappingInfo
public AbstractRestPublishService.MappingInfo getMappingInfo()
Get the mappingInfo.- Returns:
- The mappingInfo
-
getException
public java.lang.Throwable getException()
Get the exception (if any).
-
setException
public void setException(java.lang.Throwable exception)
Set the exception.
-
getNextResult
public java.lang.Object getNextResult()
Get the next result (FIFO order).- Throws:
java.lang.NullPointerException
- if there were never any resultsjava.util.NoSuchElementException
- if the last result was already consumed.
-
getResults
public java.lang.Object getResults()
Get the results.
-
getTimestamp
public long getTimestamp()
Get the timestamp of the last check (i.e. last request from browser).
-
getFuture
public IFuture<?> getFuture()
Get the future.- Returns:
- the future
-
-