java.lang.Object
org.apache.jena.fuseki.servlets.HttpAction
HTTP action that represents the user request lifecycle. It is is handled in the
ActionBase.executeLifecycle(HttpAction)
method.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ActionCategory
final long
final org.slf4j.Logger
int
int
final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionHttpAction
(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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
void
Abort: ignore exceptions (for clearup code)void
begin()
Begin a transaction - this should be paired with anend()
void
begin
(org.apache.jena.query.TxnType txnType) Begin a transaction of anyTxnType
- this should be paired with anend()
void
Begin a read operation - this should be paired with anendRead()
void
Begin a write operation - this should be paired with anendWrite()
void
commit()
void
end()
End a write transaction - paired withbegin()
orbegin(TxnType)
.void
endRead()
End a read transaction - paired withbeginRead()
.void
endWrite()
End a write transaction - paired withbeginWrite()
.final void
This is the requestURI with the context path removed.final org.apache.jena.sparql.core.DatasetGraph
If inside the transaction for the action, return the activeDatasetGraph
, otherwise return null.org.apache.jena.sparql.util.Context
Return the Context for thisHttpAction
.Get the context path.final DataAccessPoint
Get theDataAccessPointRegistry
for this action.final DataService
org.apache.jena.sparql.core.DatasetGraph
Return the dataset, if any (may be null)final String
Get the endpoint for the action (may be null) .long
Start time, in system nanosDeprecated, for removal: This API element is subject to removal in a future version.Get theMetricsProvider
for this action.Get theOperationRegistry
for this action.jakarta.servlet.http.HttpServletRequest
int
long
getRequestHeader
(String name) getRequestHeaders
(String name) Get the request input stream, bypassing any compression.int
getRequestParameter
(String string) String[]
jakarta.servlet.http.HttpServletResponse
jakarta.servlet.ServletOutputStream
jakarta.servlet.ServletContext
GetServletContext
(may be null).long
Start time, in system nanoslong
getTime()
Return the recorded time taken in milliseconds.org.apache.jena.sparql.core.Transactional
Return the "Transactional" for this HttpAction.getUser()
Return the authenticated user for thisHttpAction
.boolean
Returns whether or not the underlying DatasetGraph is fully transactional (supports rollback)void
minimize()
Reduce to a size that can be kept around for sometime.void
setEndpoint
(Endpoint endpoint) Set the endpoint and endpoint name that this is an action for.void
void
setRequest
(DataAccessPoint dataAccessPoint, DataService dService) Initialization after action creation, during lifecycle setup.void
setResponseCharacterEncoding
(String charset) void
setResponseContentLength
(int length) void
setResponseContentLengthLong
(long length) void
void
setResponseHeader
(String name, String value) void
setResponseStatus
(int statusCode) void
final void
void
sync()
toString()
-
Field Details
-
id
public final long id -
verbose
public final boolean verbose -
category
-
log
public final org.slf4j.Logger log -
endpoint
-
statusCode
public int statusCode -
message
-
responseContentLength
public int responseContentLength -
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 IDlog
- Logger for this actionrequest
- HTTP requestresponse
- HTTP response
-
-
Method Details
-
setRequest
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
andDataService
, as theDatasetGraph
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 thisHttpAction
. -
getUser
Return the authenticated user for thisHttpAction
. Return null for no authenticated user. -
getTransactional
public org.apache.jena.sparql.core.Transactional getTransactional()Return the "Transactional" for this HttpAction. -
getActionURI
This is the requestURI with the context path removed. It should be used internally for dispatch. -
getContextPath
Get the context path. -
getOperationRegistry
Get theOperationRegistry
for this action. -
getDataAccessPointRegistry
Get theDataAccessPointRegistry
for this action. -
getServletContext
public jakarta.servlet.ServletContext getServletContext()GetServletContext
(may be null). -
getMetricsProvider
Get theMetricsProvider
for this action. -
setEndpoint
Set the endpoint and endpoint name that this is an action for.- Parameters:
endpoint
-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) -
startRequest
public final void startRequest() -
finishRequest
public final void finishRequest() -
begin
public void begin(org.apache.jena.query.TxnType txnType) Begin a transaction of anyTxnType
- this should be paired with anend()
httpAction.begin(); try { work possible promote to write commit or abort (if write) response } finally { httpAction.end(); }
Prefer one ofbeginRead()
orbeginWrite()
if the action is known to be a a read or write at the start or callbegin()
if the transaction may promote. -
begin
public void begin()Begin a transaction - this should be paired with anend()
httpAction.begin(); try { work possible promote to write commit or abort (if write) response } finally { httpAction.end(); }
-
beginWrite
public void beginWrite()Begin a write operation - this should be paired with anendWrite()
httpAction.beginWrite(); try { work commit or abort response } finally { httpAction.endWrite(); }
-
beginRead
public void beginRead()Begin a read operation - this should be paired with anendRead()
httpAction.beginRead(); try { work response } finally { httpAction.endRead(); }
-
endRead
public void endRead()End a read transaction - paired withbeginRead()
. -
endWrite
public void endWrite()End a write transaction - paired withbeginWrite()
. -
end
public void end()End a write transaction - paired withbegin()
orbegin(TxnType)
. -
commit
public void commit() -
abortSilent
public void abortSilent()Abort: ignore exceptions (for clearup code) -
abort
public void abort() -
getActiveDSG
public final org.apache.jena.sparql.core.DatasetGraph getActiveDSG()If inside the transaction for the action, return the activeDatasetGraph
, otherwise return null.- Returns:
- Current active
DatasetGraph
-
getDataAccessPoint
-
getDataService
-
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()
andsetFinishTime()
must have been called. -
sync
public void sync() -
toString
-
getMethod
Deprecated, for removal: This API element is subject to removal in a future version.UsegetRequestMethod()
. -
getRequest
public jakarta.servlet.http.HttpServletRequest getRequest() -
getResponse
public jakarta.servlet.http.HttpServletResponse getResponse() -
getRequestParameter
-
getRequestParameterNames
-
getRequestParameterValues
-
getRequestParameterMap
-
getRequestMethod
-
getRequestHeaderNames
-
getRequestHeader
-
getRequestHeaders
-
getRequestContentType
-
getRequestCharacterEncoding
-
getRequestContentLength
public int getRequestContentLength() -
getRequestContentLengthLong
public long getRequestContentLengthLong() -
getRequestInputStream
- Throws:
IOException
-
getRequestInputStreamRaw
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
-
getRequestRequestURI
-
getRequestRequestURL
-
getRequestPathInfo
-
getRequestServletPath
-
getRequestLocalPort
public int getRequestLocalPort() -
setResponseCharacterEncoding
-
setResponseContentType
-
setResponseContentLength
public void setResponseContentLength(int length) -
setResponseContentLengthLong
public void setResponseContentLengthLong(long length) -
setResponseHeader
-
setResponseStatus
public void setResponseStatus(int statusCode) -
getResponseOutputStream
- Throws:
IOException
-
getResponseWriter
- Throws:
IOException
-
getRequestMethod()
.