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, 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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
void
Abort: ignore exceptions (for clearup code)void
begin()
void
void
void
void
commit()
void
end()
void
endRead()
final void
This is the requestURI with the context path removed.final DatasetGraph
If inside the transaction for the action, return the activeDatasetGraph
, otherwise return null.Return the Context for thisHttpAction
.Get the context path.final DataAccessPoint
Get theDataAccessPointRegistry
for this action.final DataService
Return the dataset, if any (may be null)final String
Get the endpoint for the action (may be null) .long
Start time, in system nanosGet theOperationRegistry
for this action.javax.servlet.http.HttpServletRequest
int
long
getRequestHeader
(String name) getRequestHeaders
(String name) Get the request input stream, bypassing any compression.int
getRequestParameter
(String string) String[]
javax.servlet.http.HttpServletResponse
javax.servlet.ServletOutputStream
long
Start time, in system nanoslong
getTime()
Return the recorded time taken in milliseconds.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, 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 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:
-
getDataset
Return the dataset, if any (may be null) -
getContext
Return the Context for thisHttpAction
. -
getUser
Return the authenticated user for thisHttpAction
. Return null for no authenticated user. -
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. -
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) -
begin
-
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
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
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest() -
getResponse
public javax.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
-