|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.graph.request.Request org.jboss.dna.graph.request.CompositeRequest
@Immutable public class CompositeRequest
A request that wraps multiple other requests, allowing multiple requests to be treated as a single request.
Note that Request.isCancelled()
and Request.cancel()
apply to all requests contained by the composite request. In other
words, cancelling this request immediately marks all contained requests as cancelled. However, cancelling any request in the
request has the effect of cancelling all other requests in the composite, including the composite. (This is implemented by
having all Request
objects in the composite share the same cancelled flag object.)
Field Summary | |
---|---|
static int |
UNKNOWN_NUMBER_OF_REQUESTS
|
Method Summary | |
---|---|
static CompositeRequest |
add(CompositeRequest composite,
Iterator<? extends Request> requests)
Add requests to the supplied composite request. |
static CompositeRequest |
add(CompositeRequest composite,
Request... requests)
Add requests to the supplied composite request. |
boolean |
equals(Object obj)
|
List<Request> |
getRequests()
Return the unmodifiable requests contained in this composite request. |
boolean |
isReadOnly()
Return whether this request only reads information. |
Iterator<Request> |
iterator()
|
int |
size()
Get the number of requests. |
static Request |
with(Iterator<? extends Request> requests)
Return a request that either wraps multiple requests, or the single request if only one is supplied. |
static Request |
with(List<? extends Request> requests)
Return a request that either wraps multiple requests, or the single request if only one is supplied. |
static Request |
with(Request... requests)
Return a request that either wraps multiple requests, or the single request if only one is supplied. |
Methods inherited from class org.jboss.dna.graph.request.Request |
---|
cancel, freeze, getError, hasError, isCancelled, isFrozen, setError |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNKNOWN_NUMBER_OF_REQUESTS
Method Detail |
---|
public static Request with(Request... requests)
requests
- the requests to wrap
IllegalArgumentException
- if there requests are null, empty, or contains only nullspublic static Request with(Iterator<? extends Request> requests)
requests
- the requests to wrap
IllegalArgumentException
- if there requests are null, empty, or contains only nullspublic static Request with(List<? extends Request> requests)
requests
- the requests to wrap
IllegalArgumentException
- if there requests are null or emptypublic static CompositeRequest add(CompositeRequest composite, Request... requests)
composite
- the composite request to which the requests are to be addedrequests
- the requests to wrap
IllegalArgumentException
- if the composite request is nullpublic static CompositeRequest add(CompositeRequest composite, Iterator<? extends Request> requests)
composite
- the composite request to which the requests are to be addedrequests
- the requests to wrap
IllegalArgumentException
- if the composite request is nullpublic List<Request> getRequests()
public int size()
public Iterator<Request> iterator()
iterator
in interface Iterable<Request>
Iterable.iterator()
public boolean isReadOnly()
isReadOnly
in class Request
Request.isReadOnly()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |