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.ObjectStruct for storing info about a request and the results.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Throwableexceptionprotected IFuture<?>futureprotected longlastcheckprotected AbstractRestPublishService.MappingInfomappingInfoprotected java.util.Queue<java.lang.Object>resultsprotected booleanterminated
-
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 voidaddResult(java.lang.Object result)Add a result.booleancheckForResult()Check, if there is a result that is not yet consumed.java.lang.ThrowablegetException()Get the exception (if any).IFuture<?>getFuture()Get the future.AbstractRestPublishService.MappingInfogetMappingInfo()Get the mappingInfo.java.lang.ObjectgetNextResult()Get the next result (FIFO order).java.lang.ObjectgetResults()Get the results.longgetTimestamp()Get the timestamp of the last check (i.e.booleanisTerminated()Check if terminatedvoidsetException(java.lang.Throwable exception)Set the exception.voidsetTerminated()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
-
-