java.lang.Object
org.apache.jena.fuseki.servlets.HttpAction

public class HttpAction extends Object
HTTP action that represents the user request lifecycle. It is is handled in the ActionBase.executeLifecycle(HttpAction) method.
  • Field Details

    • id

      public final long id
    • verbose

      public final boolean verbose
    • category

      public final ActionCategory category
    • log

      public final org.slf4j.Logger log
    • endpoint

      public Endpoint endpoint
    • statusCode

      public int statusCode
    • message

      public String message
    • responseContentLength

      public int responseContentLength
    • responseContentType

      public String responseContentType
  • Constructor Details

    • HttpAction

      public HttpAction(long id, org.slf4j.Logger log, ActionCategory category, jakarta.servlet.http.HttpServletRequest request, jakarta.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 Details

    • 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 org.apache.jena.sparql.core.DatasetGraph getDataset()
      Return the dataset, if any (may be null)
    • getContext

      public org.apache.jena.sparql.util.Context getContext()
      Return the Context for this HttpAction.
    • getUser

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

      public org.apache.jena.sparql.core.Transactional getTransactional()
      Return the "Transactional" for this HttpAction.
    • getActionURI

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

      public String getContextPath()
      Get the context path.
    • getOperationRegistry

      public OperationRegistry getOperationRegistry()
      Get the OperationRegistry for this action.
    • getDataAccessPointRegistry

      public DataAccessPointRegistry getDataAccessPointRegistry()
      Get the DataAccessPointRegistry for this action.
    • 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(org.apache.jena.query.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 org.apache.jena.sparql.core.DatasetGraph getActiveDSG()
      If inside the transaction for the action, return the active DatasetGraph, otherwise return null.
      Returns:
      Current active DatasetGraph
    • getDataAccessPoint

      public final DataAccessPoint getDataAccessPoint()
    • getDataService

      public final DataService getDataService()
    • getDatasetName

      public final 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()
    • getTime

      public long getTime()
      Return the recorded time taken in milliseconds. setStartTime() and setFinishTime() must have been called.
    • sync

      public void sync()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMethod

      public String getMethod()
    • getRequest

      public jakarta.servlet.http.HttpServletRequest getRequest()
    • getResponse

      public jakarta.servlet.http.HttpServletResponse getResponse()
    • getRequestParameter

      public String getRequestParameter(String string)
    • getRequestParameterNames

      public Enumeration<String> getRequestParameterNames()
    • getRequestParameterValues

      public String[] getRequestParameterValues(String name)
    • getRequestParameterMap

      public Map<String,String[]> getRequestParameterMap()
    • getRequestMethod

      public String getRequestMethod()
    • getRequestHeaderNames

      public Enumeration<String> getRequestHeaderNames()
    • getRequestHeader

      public String getRequestHeader(String name)
    • getRequestHeaders

      public Enumeration<String> getRequestHeaders(String name)
    • getRequestContentType

      public String getRequestContentType()
    • getRequestCharacterEncoding

      public String getRequestCharacterEncoding()
    • getRequestContentLength

      public int getRequestContentLength()
    • getRequestContentLengthLong

      public long getRequestContentLengthLong()
    • getRequestInputStream

      public InputStream getRequestInputStream() throws IOException
      Throws:
      IOException
    • getRequestInputStreamRaw

      public InputStream getRequestInputStreamRaw() throws IOException
      Get the request input stream, bypassing any compression. The state of the input stream is unknown. Only useful for skipping a body on a connection.
      Throws:
      IOException
    • getRequestQueryString

      public String getRequestQueryString()
    • getRequestRequestURI

      public String getRequestRequestURI()
    • getRequestRequestURL

      public StringBuffer getRequestRequestURL()
    • getRequestPathInfo

      public String getRequestPathInfo()
    • getRequestServletPath

      public String getRequestServletPath()
    • getRequestLocalPort

      public int getRequestLocalPort()
    • setResponseCharacterEncoding

      public void setResponseCharacterEncoding(String charset)
    • setResponseContentType

      public void setResponseContentType(String ct)
    • setResponseContentLength

      public void setResponseContentLength(int length)
    • setResponseContentLengthLong

      public void setResponseContentLengthLong(long length)
    • setResponseHeader

      public void setResponseHeader(String name, String value)
    • setResponseStatus

      public void setResponseStatus(int statusCode)
    • getResponseOutputStream

      public jakarta.servlet.ServletOutputStream getResponseOutputStream() throws IOException
      Throws:
      IOException
    • getResponseWriter

      public PrintWriter getResponseWriter() throws IOException
      Throws:
      IOException