Class HttpAction

    • Field Detail

      • id

        public final long id
      • verbose

        public final boolean verbose
      • log

        public final org.slf4j.Logger log
      • statusCode

        public int statusCode
      • message

        public java.lang.String message
      • responseContentLength

        public int responseContentLength
      • responseContentType

        public java.lang.String responseContentType
      • headers

        public java.util.Map<java.lang.String,​java.lang.String> headers
      • request

        public javax.servlet.http.HttpServletRequest request
    • Constructor Detail

      • HttpAction

        public HttpAction​(long id,
                          org.slf4j.Logger log,
                          ActionCategory category,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
        Creates a new HTTP Action, using the HTTP request and response, and a given ID.
        Parameters:
        id - given ID
        log - Logger for this action
        request - HTTP request
        response - HTTP response
    • Method Detail

      • setRequest

        public void setRequest​(DataAccessPoint dataAccessPoint,
                               DataService dService)
        Initialization after action creation, during lifecycle setup. This is "set once" (in other words, constructor-like but delayed because the information is not yet available at the point we want to create the HttpAction). This method sets the action dataset for service requests. Does not apply to "admin" and "ctl" servlets. Setting will replace any existing DataAccessPoint and DataService, as the DatasetGraph of the current HTTP Action.

        Once it has updated its members, the HTTP Action will change its transactional state and Transactional instance according to its base dataset graph.

        Parameters:
        dataAccessPoint - DataAccessPoint
        dService - DataService
        See Also:
        Transactional
      • getDataset

        public DatasetGraph getDataset()
        Return the dataset, if any (may be null)
      • getContext

        public Context getContext()
        Return the Context for this HttpAction.
      • getUser

        public java.lang.String getUser()
        Return the authenticated user this HttpAction. Return null for no authenticated user.
      • getTransactional

        public Transactional getTransactional()
        Return the "Transactional" for this HttpAction.
      • getActionURI

        public java.lang.String getActionURI()
        This is the requestURI with the context path removed. It should be used internally for dispatch.
      • getContextPath

        public java.lang.String getContextPath()
        Get the context path.
      • setEndpoint

        public void setEndpoint​(Endpoint endpoint)
        Set the endpoint and endpoint name that this is an action for.
        Parameters:
        endpoint - Endpoint
      • getEndpoint

        public Endpoint getEndpoint()
        Get the endpoint for the action (may be null) .
      • isTransactional

        public boolean isTransactional()
        Returns whether or not the underlying DatasetGraph is fully transactional (supports rollback)
      • begin

        public void begin​(TxnType txnType)
      • begin

        public void begin()
      • beginWrite

        public void beginWrite()
      • beginRead

        public void beginRead()
      • endRead

        public void endRead()
      • end

        public void end()
      • commit

        public void commit()
      • abortSilent

        public void abortSilent()
        Abort: ignore exceptions (for clearup code)
      • abort

        public void abort()
      • startRequest

        public final void startRequest()
      • finishRequest

        public final void finishRequest()
      • getActiveDSG

        public final DatasetGraph getActiveDSG()
        If inside the transaction for the action, return the active DatasetGraph, otherwise return null.
        Returns:
        Current active DatasetGraph
      • getDataService

        public final DataService getDataService()
      • getDatasetName

        public final java.lang.String getDatasetName()
      • minimize

        public void minimize()
        Reduce to a size that can be kept around for sometime.
      • setStartTime

        public void setStartTime()
      • getStartTime

        public long getStartTime()
        Start time, in system nanos
      • getFinishTime

        public long getFinishTime()
        Start time, in system nanos
      • setFinishTime

        public void setFinishTime()
      • getMethod

        public java.lang.String getMethod()
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
      • sync

        public void sync()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object