public class RequestBundle extends Object implements Callable<ResponseBundle>
Constructor and Description |
---|
RequestBundle(BroadWorksServer bws) |
RequestBundle(BroadWorksServer bws,
Request.Protocol protocol) |
Modifier and Type | Method and Description |
---|---|
void |
addRequest(Request<?> request)
Adds a new request to the bundle
|
ResponseBundle |
call() |
ResponseBundle |
execute(OCSClient ocsClient,
String responseString)
This generates a Response object from a Request.
|
ResponseBundle |
fire()
This generates a Response object from a Request.
|
void |
formRequest(boolean readFromCache)
Forms the RequestBundle
|
BroadWorksServer |
getBroadWorksServer() |
BroadWorksServer |
getBroadWorksServerForRequest() |
Request.Protocol |
getOCSProtocol()
Get the OCS protocol
|
List<Request<?>> |
getRequestBundle() |
Future<String> |
getResponseFuture() |
boolean |
isFull()
Checks if the Request Bundle can hold any more elements
|
boolean |
isValid()
Returns True if the Request has no constraint violations
|
Future<String> |
send()
This generates a
Future message from a Request. |
String |
send(OCSClient ocsClient)
This generates a String message from a Request through the given
OCSClient . |
void |
setBroadWorksServer(BroadWorksServer bws) |
void |
setHandler(ResponseBundleHandler handler) |
void |
setResponseFuture(Future<String> responseFuture) |
String |
toString()
The RequestBundle as transformed into the expected XML message
|
Set<javax.validation.ConstraintViolation<Request<?>>> |
validate()
Returns the set of Constraint Violations for the RequestBundle.
|
public RequestBundle(BroadWorksServer bws)
public RequestBundle(BroadWorksServer bws, Request.Protocol protocol)
public void addRequest(Request<?> request) throws RequestException
request
- The Request to be added.RequestException
- Thrown if the Request is invalid or the bundle is too large.public ResponseBundle fire() throws RequestException
RequestException
- Thrown if an error occurs while sending this bundle to BroadWorks.public String send(OCSClient ocsClient)
OCSClient
.ocsClient
- The OCSClient to send the request through.public ResponseBundle execute(OCSClient ocsClient, String responseString) throws RequestException
ocsClient
- Specify the OCSClient to send this request bundle. If NULL the OCSSwitchboard is used.responseString
- The response string if the request has already been sentRequestException
- Thrown if an error occurs while sending this bundle to BroadWorks.public void formRequest(boolean readFromCache)
readFromCache
- Enables reading from the JCS cache for retrieving the response. Defaults to 'true'.public BroadWorksServer getBroadWorksServer()
public void setBroadWorksServer(BroadWorksServer bws)
public BroadWorksServer getBroadWorksServerForRequest()
public void setHandler(ResponseBundleHandler handler)
public Request.Protocol getOCSProtocol()
public boolean isFull()
public boolean isValid()
public String toString()
public Set<javax.validation.ConstraintViolation<Request<?>>> validate()
public ResponseBundle call() throws Exception
call
in interface Callable<ResponseBundle>
Exception
Copyright © 2017 ECG. All rights reserved.