Interface PostResponse
- All Known Implementing Classes:
AbstractPostResponse
,AbstractPostResponseWrapper
,HtmlPostResponseProxy
,HtmlResponse
,JakartaToJavaxPostResponse
,JSONResponse
PostResponse
interface defines the API of a response
container which can (and should) be used by PostOperation
services to
prepare responses to be sent back to the client.
This bundle provides a preconfigured HtmlResponse
and a
JSONResponse
implementation of this interface. Clients may extend the
AbstractPostResponse
class to provide their own response
implementations.
-
Method Summary
Modifier and TypeMethodDescriptiongetError()
Deprecated.Returns any recorded error ornull
Deprecated.Returns the location of the modification.Deprecated.Returns the parent location of the modification.getPath()
Deprecated.Returns the absolute path of the item upon which the request operated.Deprecated.Returns the referer previously set bysetReferer(String)
int
Deprecated.Returns the status code of this instance.Deprecated.Returns the status message ornull
if no has been set with thesetStatus(int, String)
method.boolean
Deprecated.Returnstrue
if this was a create request.boolean
Deprecated.void
Deprecated.Records a generic change of the giventype
with arguments.void
Deprecated.Records a 'copied' change.void
Deprecated.Records a 'created' changevoid
Deprecated.Records a 'deleted' changevoid
onModified
(String path) Deprecated.Records a 'modified' changevoid
Deprecated.Records a 'moved' change.void
send
(javax.servlet.http.HttpServletResponse response, boolean setStatus) Deprecated.Writes the response back over the provided HTTP channel.void
setCreateRequest
(boolean isCreateRequest) Deprecated.Sets whether the request was a create request or not.void
Deprecated.Sets the recorded error causing the operation to fail.void
setLocation
(String location) Deprecated.Sets the location of this modification.void
setParentLocation
(String parentLocation) Deprecated.Sets the parent location of the modification.void
Deprecated.Sets the absolute path of the item upon which the request operated.void
setReferer
(String referer) Deprecated.Sets the referer propertyvoid
Deprecated.Sets the response status code propertiesvoid
Deprecated.Sets the title of the response message
-
Method Details
-
setReferer
Deprecated.Sets the referer property- Parameters:
referer
- the referer
-
getReferer
String getReferer()Deprecated.Returns the referer previously set bysetReferer(String)
- Returns:
- the referer
-
setPath
Deprecated.Sets the absolute path of the item upon which the request operated.- Parameters:
path
- the path
-
getPath
String getPath()Deprecated.Returns the absolute path of the item upon which the request operated.If the
setPath(String)
method has not been called yet, this method returnsnull
.- Returns:
- the path (might be null)
-
setCreateRequest
void setCreateRequest(boolean isCreateRequest) Deprecated.Sets whether the request was a create request or not.- Parameters:
isCreateRequest
- true if the request was a create request
-
isCreateRequest
boolean isCreateRequest()Deprecated.Returnstrue
if this was a create request.Before calling the
setCreateRequest(boolean)
method, this method always returnsfalse
.- Returns:
- if this was a create request
-
setLocation
Deprecated.Sets the location of this modification. This is the externalized form of thecurrent path
.- Parameters:
location
- the location
-
getLocation
String getLocation()Deprecated.Returns the location of the modification.If the
setLocation(String)
method has not been called yet, this method returnsnull
.- Returns:
- the location
-
setParentLocation
Deprecated.Sets the parent location of the modification. This is the externalized form of the parent node of thecurrent path
.- Parameters:
parentLocation
- the parent location of the modification
-
getParentLocation
String getParentLocation()Deprecated.Returns the parent location of the modification.If the
setParentLocation(String)
method has not been called yet, this method returnsnull
.- Returns:
- the parent location
-
setTitle
Deprecated.Sets the title of the response message- Parameters:
title
- the title
-
setStatus
Deprecated.Sets the response status code properties- Parameters:
code
- the codemessage
- the message
-
getStatusCode
int getStatusCode()Deprecated.Returns the status code of this instance. If the status code has never been set by calling thesetStatus(int, String)
method, the status code is determined by checking if there was an error. If there was an error, the response is assumed to be unsuccessful and 500 is returned. If there is no error, the response is assumed to be successful and 200 is returned.- Returns:
- the status code
-
getStatusMessage
String getStatusMessage()Deprecated.Returns the status message ornull
if no has been set with thesetStatus(int, String)
method.- Returns:
- the status message (might be null)
-
setError
Deprecated.Sets the recorded error causing the operation to fail.- Parameters:
error
- the throwable
-
getError
Throwable getError()Deprecated.Returns any recorded error ornull
- Returns:
- an error or
null
-
isSuccessful
boolean isSuccessful()Deprecated.- Returns:
- true if the status code is 2xx
-
onCreated
Deprecated.Records a 'created' change- Parameters:
path
- path of the item that was created
-
onModified
Deprecated.Records a 'modified' change- Parameters:
path
- path of the item that was modified
-
onDeleted
Deprecated.Records a 'deleted' change- Parameters:
path
- path of the item that was deleted
-
onMoved
Deprecated.Records a 'moved' change.Note: the moved change only records the basic move command. the implied changes on the moved properties and sub nodes are not recorded.
- Parameters:
srcPath
- source path of the node that was moveddstPath
- destination path of the node that was moved.
-
onCopied
Deprecated.Records a 'copied' change.Note: the copy change only records the basic copy command. the implied changes on the copied properties and sub nodes are not recorded.
- Parameters:
srcPath
- source path of the node that was copieddstPath
- destination path of the node that was copied.
-
onChange
Deprecated.Records a generic change of the giventype
with arguments.- Parameters:
type
- The type of the modificationarguments
- The arguments to the modifications
-
send
Deprecated.Writes the response back over the provided HTTP channel. The actual format of the response is implementation dependent.- Parameters:
response
- to send tosetStatus
- whether to set the status code on the response- Throws:
IOException
- if an i/o exception occurs
-
JakartaPostResponse
instead