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 |
apiMatchPath |
protected Path |
apiPath |
protected java.lang.String |
body |
protected Chain |
chain |
protected Collection |
collection |
static java.lang.String |
COLLECTION_KEY |
protected Path |
collectionMatchPath |
protected Path |
collectionPath |
protected long |
endAt |
protected Endpoint |
endpoint |
protected Path |
endpointMatchPath |
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 long |
startAt |
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 |
|---|---|
java.lang.String |
buildPath(java.lang.String path)
Replaces path parameters with their corresponding request params
|
Api |
getApi() |
Path |
getApiMatchPath() |
Path |
getApiPath() |
java.lang.String |
getApiUrl() |
java.lang.String |
getBody() |
Chain |
getChain() |
Collection |
getCollection() |
java.lang.String |
getCollectionKey() |
Path |
getCollectionMatchPath() |
Path |
getCollectionPath() |
JSArray |
getData()
Attempts to massage an inbound json body into an array.
|
long |
getEndAt() |
Endpoint |
getEndpoint() |
Path |
getEndpointMatchPath() |
Path |
getEndpointPath() |
Engine |
getEngine() |
java.lang.String |
getEntityKey()
Deprecated.
Replaced by
getResourceKey() |
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() |
java.util.Map<java.lang.String,java.lang.String> |
getParams()
Deprecated.
Replaced by
Url.getParams() |
Path |
getPath() |
java.lang.String |
getReferrer() |
java.lang.String |
getRelationshipKey() |
java.lang.String |
getRemoteAddr() |
java.lang.String |
getResourceKey() |
int |
getRetryCount() |
java.io.File |
getRetryFile() |
int |
getRetryMax() |
long |
getStartAt() |
java.lang.String |
getSubCollectionKey()
Deprecated.
Replaced by
getRelationshipKey() |
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,
Path apiMatchPath) |
Request |
withBody(java.lang.String body) |
Request |
withChain(Chain chain) |
Request |
withCollection(Collection collection) |
Request |
withCollection(Collection collection,
Path collectionPath,
Path collectionMatchPath) |
Request |
withEndAt(long endAt) |
Request |
withEndpoint(Endpoint endpoint,
Path endpointPath,
Path endpointMatchPath) |
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 |
withStartAt(long startAt) |
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 long startAt
protected long endAt
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 Path apiMatchPath
protected Endpoint endpoint
protected Path endpointPath
protected Path endpointMatchPath
protected Collection collection
protected Path collectionPath
protected Path collectionMatchPath
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 long getStartAt()
public Request withStartAt(long startAt)
public long getEndAt()
public Request withEndAt(long endAt)
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 - the name of the collection to check forcollectionKeys case insensitive match collectoinKeypublic Request withCollection(Collection collection)
public Request withCollection(Collection collection, Path collectionPath, Path collectionMatchPath)
public Endpoint getEndpoint()
public Request withEndpoint(Endpoint endpoint, Path endpointPath, Path endpointMatchPath)
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()
This is useful so actions can treat all inbound requests as if they are arrays instead of having to check.
Conversion rules:
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()
@Deprecated public java.lang.String getEntityKey()
getResourceKey()public java.lang.String getRelationshipKey()
@Deprecated public java.lang.String getSubCollectionKey()
getRelationshipKey()@Deprecated public java.util.Map<java.lang.String,java.lang.String> getParams()
Url.getParams()public java.lang.String getApiUrl()
public Path getApiPath()
public Path getEndpointPath()
public Path getApiMatchPath()
public Path getEndpointMatchPath()
public Path getCollectionPath()
public Path getCollectionMatchPath()
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()
public java.lang.String buildPath(java.lang.String path)
Copyright © 2021 Rocket Partners, LLC. All rights reserved.