Package io.inversion
Class Request
- java.lang.Object
-
- io.inversion.Request
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOLLECTION_KEYstatic java.lang.StringRELATIONSHIP_KEYstatic java.lang.StringRESOURCE_KEY
-
Constructor Summary
Constructors Constructor 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.lang.String body)Request(java.lang.String method, java.lang.String url, java.lang.String body, io.inversion.utils.ListMap<java.lang.String,java.lang.String> headers)Request(java.lang.String method, java.lang.String url, java.lang.String body, java.util.Map<java.lang.String,java.lang.String> params, io.inversion.utils.ListMap<java.lang.String,java.lang.String> headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(boolean value, java.lang.String message, java.lang.Object... args)java.lang.StringfindParam(java.lang.String name, Param.In... where)java.util.List<Chain.ActionMatch>getActionMatches()io.inversion.utils.PathgetActionPath()ApigetApi()java.lang.StringgetApiUrl()java.lang.StringgetBody()ChaingetChain()CollectiongetCollection()java.lang.StringgetCollectionKey()io.inversion.utils.PathgetCollectionPath()io.inversion.json.JSListgetData()Attempts to massage an inbound json body into an array.DbgetDb()io.inversion.utils.PathgetDbPath()longgetDuration()longgetEndAt()EndpointgetEndpoint()io.inversion.utils.PathgetEndpointPath()EnginegetEngine()io.inversion.json.JSMapgetHeaders()io.inversion.json.JSNodegetJson()java.lang.StringgetMethod()OpgetOp()io.inversion.utils.PathgetOperationPath()io.inversion.utils.PathgetPath()java.util.Map<java.lang.String,java.lang.String>getPathParams()java.lang.StringgetReferrer()RelationshipgetRelationship()java.lang.StringgetRelationshipKey()java.lang.StringgetRemoteAddr()java.lang.StringgetResourceKey()ServergetServer()Server.ServerMatchergetServerMatch()io.inversion.utils.PathgetServerPath()io.inversion.utils.PathgetServerPathMatch()longgetStartAt()io.inversion.utils.PathgetSubpath()UploadergetUploader()java.util.List<Upload>getUploads()UrlgetUrl()booleanisDebug()booleanisDelete()booleanisExplain()booleanisGet()booleanisInternal()booleanisMethod(java.lang.String... methods)booleanisOptions()booleanisPatch()booleanisPost()booleanisPut()Validationvalidate(java.lang.String propOrJsonPath)Validationvalidate(java.lang.String propOrJsonPath, java.lang.String customErrorMessage)RequestwithActionMatch(Chain.ActionMatch actionMatch)RequestwithActionMatches(java.util.List<Chain.ActionMatch> actionMatches)RequestwithActionPath(io.inversion.utils.Path actionPath)RequestwithApi(Api api)RequestwithBody(java.lang.String body)RequestwithChain(Chain chain)RequestwithCollection(Collection collection)RequestwithCollectionPath(io.inversion.utils.Path collectionPath)RequestwithDb(Db db)RequestwithDbPath(io.inversion.utils.Path dbPath)RequestwithEndAt(long endAt)RequestwithEndpoint(Endpoint endpoint)RequestwithEndpointPath(io.inversion.utils.Path endpointPath)RequestwithEngine(Engine engine)RequestwithExplain(boolean explain)RequestwithHeaders(io.inversion.json.JSMap headers)RequestwithHeaders(java.lang.String key, java.lang.String value)RequestwithInternal(boolean internal)RequestwithJson(io.inversion.json.JSNode json)RequestwithMethod(java.lang.String method)RequestwithOp(Op op)RequestwithOperationPath(io.inversion.utils.Path operationPath)RequestwithPathParams(java.util.Map<java.lang.String,java.lang.String> pathParams)RequestwithRemoteAddr(java.lang.String remoteAddr)RequestwithServer(Server server)RequestwithServerMatch(Server.ServerMatcher serverMatch)RequestwithServerPath(io.inversion.utils.Path serverPath)RequestwithServerPathMatch(io.inversion.utils.Path serverPathMatch)RequestwithStartAt(long startAt)RequestwithUploader(Uploader uploader)RequestwithUrl(java.lang.String url)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.inversion.Headers
addHeader, addHeaders, getAllHeaders, getHeader, lazyHeaders, removeHeader, removeHeader, setHeader
-
-
-
-
Field Detail
-
COLLECTION_KEY
public static final java.lang.String COLLECTION_KEY
- See Also:
- Constant Field Values
-
RESOURCE_KEY
public static final java.lang.String RESOURCE_KEY
- See Also:
- Constant Field Values
-
RELATIONSHIP_KEY
public static final java.lang.String RELATIONSHIP_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Request
public Request()
-
Request
public Request(java.lang.String method, java.lang.String url)
-
Request
public Request(java.lang.String method, java.lang.String url, java.lang.String body)
-
Request
public Request(Engine engine, java.lang.String method, java.lang.String url, java.lang.Object body)
-
Request
public Request(java.lang.String method, java.lang.String url, java.lang.String body, io.inversion.utils.ListMap<java.lang.String,java.lang.String> headers)
-
Request
public Request(java.lang.String method, java.lang.String url, java.lang.String body, java.util.Map<java.lang.String,java.lang.String> params, io.inversion.utils.ListMap<java.lang.String,java.lang.String> headers)
-
-
Method Detail
-
findParam
public java.lang.String findParam(java.lang.String name, Param.In... where)
-
withUrl
public Request withUrl(java.lang.String url)
-
getStartAt
public long getStartAt()
-
withStartAt
public Request withStartAt(long startAt)
-
getEndAt
public long getEndAt()
-
withEndAt
public Request withEndAt(long endAt)
-
getDuration
public long getDuration()
-
withMethod
public Request withMethod(java.lang.String method)
-
withHeaders
public Request withHeaders(java.lang.String key, java.lang.String value)
-
withHeaders
public Request withHeaders(io.inversion.json.JSMap headers)
-
getHeaders
public io.inversion.json.JSMap getHeaders()
- Specified by:
getHeadersin interfaceHeaders
-
getServer
public Server getServer()
-
getApi
public Api getApi()
-
getEngine
public Engine getEngine()
-
isInternal
public boolean isInternal()
-
withInternal
public Request withInternal(boolean internal)
-
getCollection
public Collection getCollection()
-
withCollection
public Request withCollection(Collection collection)
-
getDb
public Db getDb()
-
getDbPath
public io.inversion.utils.Path getDbPath()
-
withDbPath
public Request withDbPath(io.inversion.utils.Path dbPath)
-
getEndpoint
public Endpoint getEndpoint()
-
getServerMatch
public Server.ServerMatcher getServerMatch()
-
withServerMatch
public Request withServerMatch(Server.ServerMatcher serverMatch)
-
getServerPath
public io.inversion.utils.Path getServerPath()
-
withServerPath
public Request withServerPath(io.inversion.utils.Path serverPath)
-
getServerPathMatch
public io.inversion.utils.Path getServerPathMatch()
-
withServerPathMatch
public Request withServerPathMatch(io.inversion.utils.Path serverPathMatch)
-
getOperationPath
public io.inversion.utils.Path getOperationPath()
-
withOperationPath
public Request withOperationPath(io.inversion.utils.Path operationPath)
-
getEndpointPath
public io.inversion.utils.Path getEndpointPath()
-
withEndpointPath
public Request withEndpointPath(io.inversion.utils.Path endpointPath)
-
getActionPath
public io.inversion.utils.Path getActionPath()
-
withActionPath
public Request withActionPath(io.inversion.utils.Path actionPath)
-
getCollectionPath
public io.inversion.utils.Path getCollectionPath()
-
withCollectionPath
public Request withCollectionPath(io.inversion.utils.Path collectionPath)
-
withActionMatches
public Request withActionMatches(java.util.List<Chain.ActionMatch> actionMatches)
-
withActionMatch
public Request withActionMatch(Chain.ActionMatch actionMatch)
-
getActionMatches
public java.util.List<Chain.ActionMatch> getActionMatches()
-
withPathParams
public Request withPathParams(java.util.Map<java.lang.String,java.lang.String> pathParams)
-
getPathParams
public java.util.Map<java.lang.String,java.lang.String> getPathParams()
-
isDebug
public boolean isDebug()
-
isExplain
public boolean isExplain()
-
withExplain
public Request withExplain(boolean explain)
-
getBody
public java.lang.String getBody()
-
withBody
public Request withBody(java.lang.String body)
-
getJson
public io.inversion.json.JSNode getJson() throws ApiException- Specified by:
getJsonin interfaceio.inversion.json.JSFind- Throws:
ApiException
-
getData
public io.inversion.json.JSList getData()
Attempts to massage an inbound json body into an array.This is useful so actions can treat all inbound requests as if they are arrays instead of having to check.
Conversion rules:
- if getBody() is a JSList return it.
- if getBody() is a JSNode with a "data" array prop, return it
- if getBody() is a JSNode with a "_embedded" array prop, return it
- if getBody() is a JSNode wrap it in an array and return it.
- if getBody() is not a JSNode and getBody() is null, return an empty array.
- Returns:
- the JSON boty messaged into an array
-
withJson
public Request withJson(io.inversion.json.JSNode json)
-
getMethod
public java.lang.String getMethod()
- Returns:
- the method
-
isMethod
public boolean isMethod(java.lang.String... methods)
-
isPut
public boolean isPut()
-
isPost
public boolean isPost()
-
isPatch
public boolean isPatch()
-
isGet
public boolean isGet()
-
isDelete
public boolean isDelete()
-
isOptions
public boolean isOptions()
-
getReferrer
public java.lang.String getReferrer()
-
getChain
public Chain getChain()
-
getUrl
public Url getUrl()
-
getCollectionKey
public java.lang.String getCollectionKey()
- Returns:
- the collectionKey
-
getResourceKey
public java.lang.String getResourceKey()
- Returns:
- the resourceKey
-
getRelationshipKey
public java.lang.String getRelationshipKey()
-
getRelationship
public Relationship getRelationship()
-
getApiUrl
public java.lang.String getApiUrl()
-
getPath
public io.inversion.utils.Path getPath()
-
getSubpath
public io.inversion.utils.Path getSubpath()
-
getOp
public Op getOp()
-
getRemoteAddr
public java.lang.String getRemoteAddr()
-
withRemoteAddr
public Request withRemoteAddr(java.lang.String remoteAddr)
-
getUploader
public Uploader getUploader()
-
getUploads
public java.util.List<Upload> getUploads()
-
validate
public Validation validate(java.lang.String propOrJsonPath)
-
validate
public Validation validate(java.lang.String propOrJsonPath, java.lang.String customErrorMessage)
-
check
public void check(boolean value, java.lang.String message, java.lang.Object... args)
-
-