public class ValidatingResponseExtractor extends Object implements J4pResponseExtractor
Modifier and Type | Field and Description |
---|---|
static ValidatingResponseExtractor |
DEFAULT
Extractor which only considers status code 200 as valid
|
static ValidatingResponseExtractor |
OPTIONAL
Extractor which permits code 200 and 404 (NotFound) as possible values.
|
Constructor and Description |
---|
ValidatingResponseExtractor(int... pCodesAllowed) |
Modifier and Type | Method and Description |
---|---|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
extract(REQ pRequest,
org.json.simple.JSONObject pJsonResp)
Extract a response object for the given request and the returned JSON structure
|
public static final ValidatingResponseExtractor DEFAULT
public static final ValidatingResponseExtractor OPTIONAL
public ValidatingResponseExtractor(int... pCodesAllowed)
public <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> RESP extract(REQ pRequest, org.json.simple.JSONObject pJsonResp) throws J4pRemoteException
J4pResponseExtractor
extract
in interface J4pResponseExtractor
RESP
- response typREQ
- request typepRequest
- the original requestpJsonResp
- the response as obtained from the agentJ4pRemoteException
- if the response is in an error state this exception should be thrown.Copyright © 2021. All rights reserved.