Package io.inversion

Class Request

java.lang.Object
io.inversion.Request
All Implemented Interfaces:
Headers, io.inversion.json.JSFind

public class Request extends Object implements Headers, io.inversion.json.JSFind
  • Field Details

  • Constructor Details

  • Method Details

    • findParam

      public String findParam(String name, Param.In... where)
    • withUrl

      public Request withUrl(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(String method)
    • withHeaders

      public Request withHeaders(String key, String value)
    • withHeaders

      public Request withHeaders(io.inversion.json.JSMap headers)
    • getHeaders

      public io.inversion.json.JSMap getHeaders()
      Specified by:
      getHeaders in interface Headers
    • getServer

      public Server getServer()
    • withServer

      public Request withServer(Server server)
    • getApi

      public Api getApi()
    • withApi

      public Request withApi(Api api)
    • getEngine

      public Engine getEngine()
    • withEngine

      public Request withEngine(Engine engine)
    • isInternal

      public boolean isInternal()
    • withInternal

      public Request withInternal(boolean internal)
    • getCollection

      public Collection getCollection()
    • withCollection

      public Request withCollection(Collection collection)
    • getDb

      public Db getDb()
    • withDb

      public Request withDb(Db db)
    • getDbPath

      public io.inversion.utils.Path getDbPath()
    • withDbPath

      public Request withDbPath(io.inversion.utils.Path dbPath)
    • getEndpoint

      public Endpoint getEndpoint()
    • withEndpoint

      public Request withEndpoint(Endpoint endpoint)
    • 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(List<Chain.ActionMatch> actionMatches)
    • withActionMatch

      public Request withActionMatch(Chain.ActionMatch actionMatch)
    • getActionMatches

      public List<Chain.ActionMatch> getActionMatches()
    • withPathParams

      public Request withPathParams(Map<String,String> pathParams)
    • getPathParams

      public Map<String,String> getPathParams()
    • isDebug

      public boolean isDebug()
    • isExplain

      public boolean isExplain()
    • withExplain

      public Request withExplain(boolean explain)
    • getBody

      public String getBody()
    • withBody

      public Request withBody(String body)
    • getJson

      public io.inversion.json.JSNode getJson() throws ApiException
      Specified by:
      getJson in interface io.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:

      1. if getBody() is a JSList return it.
      2. if getBody() is a JSNode with a "data" array prop, return it
      3. if getBody() is a JSNode with a "_embedded" array prop, return it
      4. if getBody() is a JSNode wrap it in an array and return it.
      5. 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 String getMethod()
      Returns:
      the method
    • isMethod

      public boolean isMethod(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 String getReferrer()
    • getChain

      public Chain getChain()
    • withChain

      public Request withChain(Chain chain)
    • getUrl

      public Url getUrl()
    • getCollectionKey

      public String getCollectionKey()
      Returns:
      the collectionKey
    • getResourceKey

      public String getResourceKey()
      Returns:
      the resourceKey
    • getRelationshipKey

      public String getRelationshipKey()
    • getRelationship

      public Relationship getRelationship()
    • getApiUrl

      public String getApiUrl()
    • getPath

      public io.inversion.utils.Path getPath()
    • getSubpath

      public io.inversion.utils.Path getSubpath()
    • getOp

      public Op getOp()
    • withOp

      public Request withOp(Op op)
    • getRemoteAddr

      public String getRemoteAddr()
    • withRemoteAddr

      public Request withRemoteAddr(String remoteAddr)
    • getUploader

      public Uploader getUploader()
    • withUploader

      public Request withUploader(Uploader uploader)
    • getUploads

      public List<Upload> getUploads()
    • validate

      public Validation validate(String propOrJsonPath)
    • validate

      public Validation validate(String propOrJsonPath, String customErrorMessage)
    • check

      public void check(boolean value, String message, Object... args)