nxt.addons

## Class RequestContext

- java.lang.Object
- - nxt.addons.AbstractContractContext
  - - nxt.addons.RequestContext

-     public class RequestContext
      extends AbstractContractContext

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class nxt.addons.AbstractContractContext

      `AbstractContractContext.EventSource`

  - ### Field Summary

    - ### Fields inherited from class nxt.addons.AbstractContractContext

      `chainById, chainByName, config, contractName, FEE_CANNOT_CALCULATE, FEE_EXCEEDS_AMOUNT, INTERNAL_ERROR_CODE_THRESHOLD, MESSAGE_TO_ENCRYPT_WITHOUT_SECRET_PHRASE, source, VALIDATE_SAME_ACCOUNT_CODE, VALIDATE_SAME_CHAIN, VALIDATE_SAME_TRANSACTION_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestContext(javax.servlet.http.HttpServletRequest req, ContractRunnerConfig config, java.lang.String contractName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `getAttribute(java.lang.String name)`
    `java.util.Enumeration<java.lang.String>` | `getAttributeNames()`
    `BlockResponse` | `getBlock()` Returns the Json representation of the current block
    `java.lang.String` | `getCharacterEncoding()`
    `int` | `getContentLength()`
    `long` | `getContentLengthLong()`
    `java.lang.String` | `getContentType()`
    `java.io.InputStream` | `getInputStream()`
    `java.util.Locale` | `getLocale()`
    `java.util.Enumeration<java.util.Locale>` | `getLocales()`
    `java.lang.String` | `getParameter(java.lang.String name)`
    `java.util.Map<java.lang.String,java.lang.String[]>` | `getParameterMap()`
    `java.util.Enumeration<java.lang.String>` | `getParameterNames()`
    `java.lang.String[]` | `getParameterValues(java.lang.String name)`
    `java.lang.String` | `getProtocol()`
    `java.io.BufferedReader` | `getReader()`
    `protected java.lang.String` | `getReferencedTransaction()`
    `java.lang.String` | `getRemoteAddr()`
    `java.lang.String` | `getRemoteHost()`
    `javax.servlet.http.HttpServletRequest` | `getRequest()`
    `JO` | `getRuntimeParams()`
    `java.lang.String` | `getScheme()`
    `java.lang.String` | `getServerName()`
    `int` | `getServerPort()`
    `boolean` | `isSecure()`
    `void` | `removeAttribute(java.lang.String name)`
    `void` | `setAttribute(java.lang.String name, java.lang.Object o)`
    `void` | `setCharacterEncoding(java.lang.String enc)`

    - ### Methods inherited from class nxt.addons.AbstractContractContext

      `addTriggerData, createTransaction, createTransaction, fullHashToId, fullHashToId, generateErrorResponse, generateInfoResponse, generateInternalErrorResponse, generateResponse, getAccount, getAccountRs, getBlockchainConstants, getBlockchainHeight, getChain, getChain, getConfig, getContext, getContractName, getContractRunnerConfigParams, getContractSetupParameters, getHash, getHash, getParams, getParentChain, getPhasingAttachment, getPublicKey, getPublicKey, getPublicKeyHexString, getRandomnessSource, getResponse, getSource, initRandom, isPermissionGranted, loadContract, logErrorMessage, logInfoMessage, parseAccountId, parseHexString, publicKeyToAccountId, publicKeyToAccountId, rsAccount, setContractSetupParameters, sign, toHexString, verify`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RequestContext

          public RequestContext(javax.servlet.http.HttpServletRequest req,
                                ContractRunnerConfig config,
                                java.lang.String contractName)

  - ### Method Detail

    - #### getBlock

          public BlockResponse getBlock()

      Description copied from class: `AbstractContractContext`
      Returns the Json representation of the current block
      Specified by:
        `getBlock` in class `AbstractContractContext`
      Returns:
        the current block represented as Json

    - #### getRuntimeParams

          public JO getRuntimeParams()

      Overrides:
        `getRuntimeParams` in class `AbstractContractContext`

    - #### getRequest

          public javax.servlet.http.HttpServletRequest getRequest()

    - #### getAttribute

          public java.lang.Object getAttribute(java.lang.String name)

    - #### getAttributeNames

          public java.util.Enumeration<java.lang.String> getAttributeNames()

    - #### getCharacterEncoding

          public java.lang.String getCharacterEncoding()

    - #### setCharacterEncoding

          public void setCharacterEncoding(java.lang.String enc)
                                    throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### getContentLength

          public int getContentLength()

    - #### getContentLengthLong

          public long getContentLengthLong()

    - #### getContentType

          public java.lang.String getContentType()

    - #### getInputStream

          public java.io.InputStream getInputStream()
                                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getParameter

          public java.lang.String getParameter(java.lang.String name)

    - #### getParameterMap

          public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()

    - #### getParameterNames

          public java.util.Enumeration<java.lang.String> getParameterNames()

    - #### getParameterValues

          public java.lang.String[] getParameterValues(java.lang.String name)

    - #### getProtocol

          public java.lang.String getProtocol()

    - #### getScheme

          public java.lang.String getScheme()

    - #### getServerName

          public java.lang.String getServerName()

    - #### getServerPort

          public int getServerPort()

    - #### getReader

          public java.io.BufferedReader getReader()
                                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getRemoteAddr

          public java.lang.String getRemoteAddr()

    - #### getRemoteHost

          public java.lang.String getRemoteHost()

    - #### setAttribute

          public void setAttribute(java.lang.String name,
                                   java.lang.Object o)

    - #### removeAttribute

          public void removeAttribute(java.lang.String name)

    - #### getLocale

          public java.util.Locale getLocale()

    - #### getLocales

          public java.util.Enumeration<java.util.Locale> getLocales()

    - #### isSecure

          public boolean isSecure()

    - #### getReferencedTransaction

          protected java.lang.String getReferencedTransaction()

      Specified by:
        `getReferencedTransaction` in class `AbstractContractContext`