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 ornullReturns 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)intReturns the status code of this instance.Returns the status message ornullif no has been set with theJakartaPostResponse.setStatus(int, String)method.booleanReturnstrueif this was a create request.booleanvoidRecords a generic change of the giventypewith arguments.voidRecords a 'copied' change.voidRecords a 'created' changevoidRecords a 'deleted' changevoidonModified(String path) Records a 'modified' changevoidRecords a 'moved' change.voidsend(jakarta.servlet.http.HttpServletResponse response, boolean setStatus) Writes the response back over the provided HTTP channel.voidsetCreateRequest(boolean isCreateRequest) Sets whether the request was a create request or not.voidSets the recorded error causing the operation to fail.voidsetLocation(String location) Sets the location of this modification.voidsetParentLocation(String parentLocation) Sets the parent location of the modification.voidSets the absolute path of the item upon which the request operated.voidsetReferer(String referer) Sets the referer propertyvoidSets the response status code propertiesvoidSets the title of the response message
-
Constructor Details
-
JavaxToJakartaPostResponse
-
-
Method Details
-
getError
Description copied from interface:JakartaPostResponseReturns any recorded error ornull- Specified by:
getErrorin interfaceJakartaPostResponse- Returns:
- an error or
null
-
getLocation
Description copied from interface:JakartaPostResponseReturns the location of the modification.If the
JakartaPostResponse.setLocation(String)method has not been called yet, this method returnsnull.- Specified by:
getLocationin interfaceJakartaPostResponse- Returns:
- the location
-
getParentLocation
Description copied from interface:JakartaPostResponseReturns the parent location of the modification.If the
JakartaPostResponse.setParentLocation(String)method has not been called yet, this method returnsnull.- Specified by:
getParentLocationin interfaceJakartaPostResponse- Returns:
- the parent location
-
getPath
Description copied from interface:JakartaPostResponseReturns 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:
getPathin interfaceJakartaPostResponse- Returns:
- the path (might be null)
-
getReferer
Description copied from interface:JakartaPostResponseReturns the referer previously set byJakartaPostResponse.setReferer(String)- Specified by:
getRefererin interfaceJakartaPostResponse- Returns:
- the referer
-
getStatusCode
public int getStatusCode()Description copied from interface:JakartaPostResponseReturns 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:
getStatusCodein interfaceJakartaPostResponse- Returns:
- the status code
-
getStatusMessage
Description copied from interface:JakartaPostResponseReturns the status message ornullif no has been set with theJakartaPostResponse.setStatus(int, String)method.- Specified by:
getStatusMessagein interfaceJakartaPostResponse- Returns:
- the status message (might be null)
-
isCreateRequest
public boolean isCreateRequest()Description copied from interface:JakartaPostResponseReturnstrueif this was a create request.Before calling the
JakartaPostResponse.setCreateRequest(boolean)method, this method always returnsfalse.- Specified by:
isCreateRequestin interfaceJakartaPostResponse- Returns:
- if this was a create request
-
isSuccessful
public boolean isSuccessful()Description copied from interface:JakartaPostResponse- Specified by:
isSuccessfulin interfaceJakartaPostResponse- Returns:
- true if the status code is 2xx
-
onChange
Description copied from interface:JakartaPostResponseRecords a generic change of the giventypewith arguments.- Specified by:
onChangein interfaceJakartaPostResponse- Parameters:
type- The type of the modificationarguments- The arguments to the modifications
-
onCopied
Description copied from interface:JakartaPostResponseRecords 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:
onCopiedin interfaceJakartaPostResponse- Parameters:
srcPath- source path of the node that was copieddstPath- destination path of the node that was copied.
-
onCreated
Description copied from interface:JakartaPostResponseRecords a 'created' change- Specified by:
onCreatedin interfaceJakartaPostResponse- Parameters:
path- path of the item that was created
-
onDeleted
Description copied from interface:JakartaPostResponseRecords a 'deleted' change- Specified by:
onDeletedin interfaceJakartaPostResponse- Parameters:
path- path of the item that was deleted
-
onModified
Description copied from interface:JakartaPostResponseRecords a 'modified' change- Specified by:
onModifiedin interfaceJakartaPostResponse- Parameters:
path- path of the item that was modified
-
onMoved
Description copied from interface:JakartaPostResponseRecords 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:
onMovedin 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:JakartaPostResponseWrites the response back over the provided HTTP channel. The actual format of the response is implementation dependent.- Specified by:
sendin 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:JakartaPostResponseSets whether the request was a create request or not.- Specified by:
setCreateRequestin interfaceJakartaPostResponse- Parameters:
isCreateRequest- true if the request was a create request
-
setError
Description copied from interface:JakartaPostResponseSets the recorded error causing the operation to fail.- Specified by:
setErrorin interfaceJakartaPostResponse- Parameters:
error- the throwable
-
setLocation
Description copied from interface:JakartaPostResponseSets the location of this modification. This is the externalized form of thecurrent path.- Specified by:
setLocationin interfaceJakartaPostResponse- Parameters:
location- the location
-
setParentLocation
Description copied from interface:JakartaPostResponseSets the parent location of the modification. This is the externalized form of the parent node of thecurrent path.- Specified by:
setParentLocationin interfaceJakartaPostResponse- Parameters:
parentLocation- the parent location of the modification
-
setPath
Description copied from interface:JakartaPostResponseSets the absolute path of the item upon which the request operated.- Specified by:
setPathin interfaceJakartaPostResponse- Parameters:
path- the path
-
setReferer
Description copied from interface:JakartaPostResponseSets the referer property- Specified by:
setRefererin interfaceJakartaPostResponse- Parameters:
referer- the referer
-
setStatus
Description copied from interface:JakartaPostResponseSets the response status code properties- Specified by:
setStatusin interfaceJakartaPostResponse- Parameters:
code- the codemessage- the message
-
setTitle
Description copied from interface:JakartaPostResponseSets the title of the response message- Specified by:
setTitlein interfaceJakartaPostResponse- Parameters:
title- the title
-