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 SummaryFields Modifier and Type Field Description protected java.lang.Throwableexceptionprotected IFuture<?>futureprotected longlastcheckprotected AbstractRestPublishService.MappingInfomappingInfoprotected java.util.Queue<java.lang.Object>resultsprotected booleanterminated
 - 
Constructor SummaryConstructors Constructor Description RequestInfo(AbstractRestPublishService.MappingInfo mappingInfo, IFuture<?> future)Create a request info.
 - 
Method SummaryAll 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- 
resultsprotected java.util.Queue<java.lang.Object> results 
 - 
mappingInfoprotected AbstractRestPublishService.MappingInfo mappingInfo 
 - 
terminatedprotected boolean terminated 
 - 
exceptionprotected java.lang.Throwable exception 
 - 
lastcheckprotected long lastcheck 
 - 
futureprotected IFuture<?> future 
 
- 
 - 
Constructor Detail- 
RequestInfopublic RequestInfo(AbstractRestPublishService.MappingInfo mappingInfo, IFuture<?> future) Create a request info.
 
- 
 - 
Method Detail- 
setTerminatedpublic void setTerminated() Set it to terminated.
 - 
isTerminatedpublic boolean isTerminated() Check if terminated- Returns:
- True if terminated.
 
 - 
checkForResultpublic 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.
 
 - 
addResultpublic void addResult(java.lang.Object result) Add a result.- Parameters:
- result- The result to add
 
 - 
getMappingInfopublic AbstractRestPublishService.MappingInfo getMappingInfo() Get the mappingInfo.- Returns:
- The mappingInfo
 
 - 
getExceptionpublic java.lang.Throwable getException() Get the exception (if any).
 - 
setExceptionpublic void setException(java.lang.Throwable exception) Set the exception.
 - 
getNextResultpublic java.lang.Object getNextResult() Get the next result (FIFO order).- Throws:
- java.lang.NullPointerException- if there were never any results
- java.util.NoSuchElementException- if the last result was already consumed.
 
 - 
getResultspublic java.lang.Object getResults() Get the results.
 - 
getTimestamppublic long getTimestamp() Get the timestamp of the last check (i.e. last request from browser).
 - 
getFuturepublic IFuture<?> getFuture() Get the future.- Returns:
- the future
 
 
- 
 
-