public class Request
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Request.Upload |
static interface |
Request.Uploader
Implemented by different runtimes, for example a servlet vs a lambda, to enable different file upload mechanisms.
|
static class |
Request.Validation
Utility designed to make it easy to validate request properties or request body
json values while you are retrieving them.
|
| Modifier and Type | Field and Description |
|---|---|
protected Api |
api |
protected Path |
apiPath |
protected java.lang.String |
body |
protected Chain |
chain |
protected Collection |
collection |
static java.lang.String |
COLLECTION_KEY |
protected Path |
collectionPath |
protected Endpoint |
endpoint |
protected Path |
endpointPath |
protected Engine |
engine |
protected org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> |
headers |
protected JSNode |
json |
protected java.lang.String |
method |
protected java.lang.String |
referrer |
static java.lang.String |
RELATIONSHIP_KEY |
protected java.lang.String |
remoteAddr |
static java.lang.String |
RESOURCE_KEY |
protected int |
retryMax |
protected java.lang.String |
tenant |
protected Request.Uploader |
uploader |
protected Url |
url |
| Constructor and Description |
|---|
Request() |
Request(Engine engine,
java.lang.String method,
java.lang.String url,
java.lang.Object body) |
Request(java.lang.String method,
java.lang.String url) |
Request(java.lang.String method,
java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> headers,
java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String body) |
Request(java.lang.String method,
java.lang.String url,
java.lang.String body) |
Request(java.lang.String method,
java.lang.String url,
java.lang.String body,
org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> headers,
int retryAttempts) |
Request(java.lang.String method,
java.lang.String url,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.String> params,
org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> headers,
int retryMax) |
| Modifier and Type | Method and Description |
|---|---|
Api |
getApi() |
Path |
getApiPath() |
java.lang.String |
getApiUrl() |
java.lang.String |
getBody() |
Chain |
getChain() |
Collection |
getCollection() |
java.lang.String |
getCollectionKey() |
JSArray |
getData()
Attempts to massage an inbound json body into an array
according to:
1.
|
Endpoint |
getEndpoint() |
Path |
getEndpointPath() |
Engine |
getEngine() |
java.lang.String |
getHeader(java.lang.String key) |
org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> |
getHeaders() |
JSNode |
getJson() |
java.lang.String |
getMethod() |
Path |
getPath()
Returns the URL path with the apiPath subtracted from the beginning
|
java.lang.String |
getReferrer() |
java.lang.String |
getRelationshipKey() |
java.lang.String |
getRemoteAddr() |
java.lang.String |
getResourceKey() |
int |
getRetryCount() |
java.io.File |
getRetryFile() |
int |
getRetryMax() |
Path |
getSubpath() |
Request.Uploader |
getUploader() |
java.util.List<Request.Upload> |
getUploads() |
Url |
getUrl() |
boolean |
hasCollectionKey(java.lang.String... collectionKeys) |
void |
incrementRetryCount() |
boolean |
isDebug() |
boolean |
isDelete() |
boolean |
isExplain() |
boolean |
isGet() |
boolean |
isLocalRequest() |
boolean |
isMethod(java.lang.String... methods) |
boolean |
isPatch() |
boolean |
isPost() |
boolean |
isPut() |
void |
removeHeader(java.lang.String key) |
void |
setRetryFile(java.io.File retryFile) |
Request.Validation |
validate(java.lang.String propOrJsonPath) |
Request.Validation |
validate(java.lang.String propOrJsonPath,
java.lang.String customErrorMessage) |
Request |
withApi(Api api,
Path apiPath) |
Request |
withBody(java.lang.String body) |
Request |
withChain(Chain chain) |
Request |
withCollection(Collection collection) |
Request |
withCollection(Collection collection,
Path collectionPath) |
Request |
withEndpoint(Endpoint endpoint,
Path endpointPath) |
Request |
withEngine(Engine service) |
Request |
withExplain(boolean explain) |
void |
withHeader(java.lang.String key,
java.lang.String value) |
Request |
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers) |
Request |
withHeaders(java.lang.String key,
java.lang.String value) |
Request |
withJson(JSNode json) |
Request |
withMethod(java.lang.String method) |
Request |
withRemoteAddr(java.lang.String remoteAddr) |
Request |
withRetryMax(int retryMax) |
Request |
withUploader(Request.Uploader uploader) |
Request |
withUrl(java.lang.String url) |
public static final java.lang.String COLLECTION_KEY
public static final java.lang.String RESOURCE_KEY
public static final java.lang.String RELATIONSHIP_KEY
protected Chain chain
protected java.lang.String referrer
protected java.lang.String remoteAddr
protected org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> headers
protected Url url
protected java.lang.String method
protected Engine engine
protected Api api
protected Path apiPath
protected java.lang.String tenant
protected Path endpointPath
protected Endpoint endpoint
protected Collection collection
protected Path collectionPath
protected java.lang.String body
protected JSNode json
protected Request.Uploader uploader
protected int retryMax
public Request()
public Request(java.lang.String method,
java.lang.String url)
public Request(java.lang.String method,
java.lang.String url,
java.lang.String body)
public Request(Engine engine, java.lang.String method, java.lang.String url, java.lang.Object body)
public Request(java.lang.String method,
java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> headers,
java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String body)
public Request(java.lang.String method,
java.lang.String url,
java.lang.String body,
org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> headers,
int retryAttempts)
public Request(java.lang.String method,
java.lang.String url,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.String> params,
org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> headers,
int retryMax)
public Engine getEngine()
public Request withUrl(java.lang.String url)
public Request withMethod(java.lang.String method)
public Request withHeaders(java.lang.String key, java.lang.String value)
public Request withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
public Collection getCollection()
public boolean hasCollectionKey(java.lang.String... collectionKeys)
collectionKeys case insensitive match collectoinKeypublic Request withCollection(Collection collection)
public Request withCollection(Collection collection, Path collectionPath)
public Endpoint getEndpoint()
public boolean isDebug()
public boolean isExplain()
public Request withExplain(boolean explain)
public java.lang.String getBody()
public Request withBody(java.lang.String body)
public JSNode getJson() throws ApiException
ApiExceptionpublic JSArray getData()
public java.lang.String getMethod()
public boolean isMethod(java.lang.String... methods)
public boolean isPut()
public boolean isPost()
public boolean isPatch()
public boolean isGet()
public boolean isDelete()
public java.lang.String getReferrer()
public java.lang.String getHeader(java.lang.String key)
public void removeHeader(java.lang.String key)
public org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,java.lang.String> getHeaders()
public void withHeader(java.lang.String key,
java.lang.String value)
public Api getApi()
public Chain getChain()
public Url getUrl()
public Path getPath()
public Path getSubpath()
public java.lang.String getCollectionKey()
public java.lang.String getResourceKey()
public java.lang.String getRelationshipKey()
public java.lang.String getApiUrl()
public Path getApiPath()
public Path getEndpointPath()
public java.lang.String getRemoteAddr()
public Request withRemoteAddr(java.lang.String remoteAddr)
public Request.Uploader getUploader()
public Request withUploader(Request.Uploader uploader)
public Request.Validation validate(java.lang.String propOrJsonPath)
public Request.Validation validate(java.lang.String propOrJsonPath, java.lang.String customErrorMessage)
public boolean isLocalRequest()
public int getRetryMax()
public Request withRetryMax(int retryMax)
public int getRetryCount()
public void incrementRetryCount()
public java.io.File getRetryFile()
public void setRetryFile(java.io.File retryFile)
public java.util.List<Request.Upload> getUploads()
Copyright © 2024 Rocket Partners, LLC. All rights reserved.