Class JavaxToJakartaPostResponse
java.lang.Object
org.apache.sling.servlets.post.impl.wrapper.JavaxToJakartaPostResponse
- All Implemented Interfaces:
JakartaPostResponse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetError()
Returns any recorded error ornull
Returns the location of the modification.Returns the parent location of the modification.getPath()
Returns the absolute path of the item upon which the request operated.Returns the referer previously set byJakartaPostResponse.setReferer(String)
int
Returns the status code of this instance.Returns the status message ornull
if no has been set with theJakartaPostResponse.setStatus(int, String)
method.boolean
Returnstrue
if this was a create request.boolean
void
Records a generic change of the giventype
with arguments.void
Records a 'copied' change.void
Records a 'created' changevoid
Records a 'deleted' changevoid
onModified
(String path) Records a 'modified' changevoid
Records a 'moved' change.void
send
(jakarta.servlet.http.HttpServletResponse response, boolean setStatus) Writes the response back over the provided HTTP channel.void
setCreateRequest
(boolean isCreateRequest) Sets whether the request was a create request or not.void
Sets the recorded error causing the operation to fail.void
setLocation
(String location) Sets the location of this modification.void
setParentLocation
(String parentLocation) Sets the parent location of the modification.void
Sets the absolute path of the item upon which the request operated.void
setReferer
(String referer) Sets the referer propertyvoid
Sets the response status code propertiesvoid
Sets the title of the response message
-
Constructor Details
-
JavaxToJakartaPostResponse
-
-
Method Details
-
getError
Description copied from interface:JakartaPostResponse
Returns any recorded error ornull
- Specified by:
getError
in interfaceJakartaPostResponse
- Returns:
- an error or
null
-
getLocation
Description copied from interface:JakartaPostResponse
Returns the location of the modification.If the
JakartaPostResponse.setLocation(String)
method has not been called yet, this method returnsnull
.- Specified by:
getLocation
in interfaceJakartaPostResponse
- Returns:
- the location
-
getParentLocation
Description copied from interface:JakartaPostResponse
Returns the parent location of the modification.If the
JakartaPostResponse.setParentLocation(String)
method has not been called yet, this method returnsnull
.- Specified by:
getParentLocation
in interfaceJakartaPostResponse
- Returns:
- the parent location
-
getPath
Description copied from interface:JakartaPostResponse
Returns the absolute path of the item upon which the request operated.If the
JakartaPostResponse.setPath(String)
method has not been called yet, this method returnsnull
.- Specified by:
getPath
in interfaceJakartaPostResponse
- Returns:
- the path (might be null)
-
getReferer
Description copied from interface:JakartaPostResponse
Returns the referer previously set byJakartaPostResponse.setReferer(String)
- Specified by:
getReferer
in interfaceJakartaPostResponse
- Returns:
- the referer
-
getStatusCode
public int getStatusCode()Description copied from interface:JakartaPostResponse
Returns the status code of this instance. If the status code has never been set by calling theJakartaPostResponse.setStatus(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.- Specified by:
getStatusCode
in interfaceJakartaPostResponse
- Returns:
- the status code
-
getStatusMessage
Description copied from interface:JakartaPostResponse
Returns the status message ornull
if no has been set with theJakartaPostResponse.setStatus(int, String)
method.- Specified by:
getStatusMessage
in interfaceJakartaPostResponse
- Returns:
- the status message (might be null)
-
isCreateRequest
public boolean isCreateRequest()Description copied from interface:JakartaPostResponse
Returnstrue
if this was a create request.Before calling the
JakartaPostResponse.setCreateRequest(boolean)
method, this method always returnsfalse
.- Specified by:
isCreateRequest
in interfaceJakartaPostResponse
- Returns:
- if this was a create request
-
isSuccessful
public boolean isSuccessful()Description copied from interface:JakartaPostResponse
- Specified by:
isSuccessful
in interfaceJakartaPostResponse
- Returns:
- true if the status code is 2xx
-
onChange
Description copied from interface:JakartaPostResponse
Records a generic change of the giventype
with arguments.- Specified by:
onChange
in interfaceJakartaPostResponse
- Parameters:
type
- The type of the modificationarguments
- The arguments to the modifications
-
onCopied
Description copied from interface:JakartaPostResponse
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.
- Specified by:
onCopied
in interfaceJakartaPostResponse
- Parameters:
srcPath
- source path of the node that was copieddstPath
- destination path of the node that was copied.
-
onCreated
Description copied from interface:JakartaPostResponse
Records a 'created' change- Specified by:
onCreated
in interfaceJakartaPostResponse
- Parameters:
path
- path of the item that was created
-
onDeleted
Description copied from interface:JakartaPostResponse
Records a 'deleted' change- Specified by:
onDeleted
in interfaceJakartaPostResponse
- Parameters:
path
- path of the item that was deleted
-
onModified
Description copied from interface:JakartaPostResponse
Records a 'modified' change- Specified by:
onModified
in interfaceJakartaPostResponse
- Parameters:
path
- path of the item that was modified
-
onMoved
Description copied from interface:JakartaPostResponse
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.
- Specified by:
onMoved
in interfaceJakartaPostResponse
- Parameters:
srcPath
- source path of the node that was moveddstPath
- destination path of the node that was moved.
-
send
public void send(jakarta.servlet.http.HttpServletResponse response, boolean setStatus) throws IOException Description copied from interface:JakartaPostResponse
Writes the response back over the provided HTTP channel. The actual format of the response is implementation dependent.- Specified by:
send
in interfaceJakartaPostResponse
- Parameters:
response
- to send tosetStatus
- whether to set the status code on the response- Throws:
IOException
- if an i/o exception occurs
-
setCreateRequest
public void setCreateRequest(boolean isCreateRequest) Description copied from interface:JakartaPostResponse
Sets whether the request was a create request or not.- Specified by:
setCreateRequest
in interfaceJakartaPostResponse
- Parameters:
isCreateRequest
- true if the request was a create request
-
setError
Description copied from interface:JakartaPostResponse
Sets the recorded error causing the operation to fail.- Specified by:
setError
in interfaceJakartaPostResponse
- Parameters:
error
- the throwable
-
setLocation
Description copied from interface:JakartaPostResponse
Sets the location of this modification. This is the externalized form of thecurrent path
.- Specified by:
setLocation
in interfaceJakartaPostResponse
- Parameters:
location
- the location
-
setParentLocation
Description copied from interface:JakartaPostResponse
Sets the parent location of the modification. This is the externalized form of the parent node of thecurrent path
.- Specified by:
setParentLocation
in interfaceJakartaPostResponse
- Parameters:
parentLocation
- the parent location of the modification
-
setPath
Description copied from interface:JakartaPostResponse
Sets the absolute path of the item upon which the request operated.- Specified by:
setPath
in interfaceJakartaPostResponse
- Parameters:
path
- the path
-
setReferer
Description copied from interface:JakartaPostResponse
Sets the referer property- Specified by:
setReferer
in interfaceJakartaPostResponse
- Parameters:
referer
- the referer
-
setStatus
Description copied from interface:JakartaPostResponse
Sets the response status code properties- Specified by:
setStatus
in interfaceJakartaPostResponse
- Parameters:
code
- the codemessage
- the message
-
setTitle
Description copied from interface:JakartaPostResponse
Sets the title of the response message- Specified by:
setTitle
in interfaceJakartaPostResponse
- Parameters:
title
- the title
-