Package org.apache.sling.servlets.post
Klasse AbstractJakartaPostResponseWrapper
java.lang.Object
org.apache.sling.servlets.post.AbstractJakartaPostResponseWrapper
- Alle implementierten Schnittstellen:
JakartaPostResponse
public abstract class AbstractJakartaPostResponseWrapper
extends Object
implements JakartaPostResponse
Provides a simple implementation of JakartaPostResponse that can be subclassed by developers wishing to provide specialized behavior
to an existing JakartaPostResponse instance. The default implementation of all methods is to call through to the wrapped
JakartaPostResponse instance.
- Seit:
- 2.5.0
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetError()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.abstract JakartaPostResponseUse this method to return an instance of the class being wrapped.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
-
Konstruktordetails
-
AbstractJakartaPostResponseWrapper
public AbstractJakartaPostResponseWrapper()
-
-
Methodendetails
-
getWrapped
Use this method to return an instance of the class being wrapped.- Gibt zurück:
- the wrapped PostResponse instance
-
setReferer
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the referer property- Angegeben von:
setRefererin SchnittstelleJakartaPostResponse- Parameter:
referer- the referer
-
getReferer
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseReturns the referer previously set byJakartaPostResponse.setReferer(String)- Angegeben von:
getRefererin SchnittstelleJakartaPostResponse- Gibt zurück:
- the referer
-
setPath
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the absolute path of the item upon which the request operated.- Angegeben von:
setPathin SchnittstelleJakartaPostResponse- Parameter:
path- the path
-
getPath
Beschreibung aus Schnittstelle kopiert: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.- Angegeben von:
getPathin SchnittstelleJakartaPostResponse- Gibt zurück:
- the path (might be null)
-
setCreateRequest
public void setCreateRequest(boolean isCreateRequest) Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets whether the request was a create request or not.- Angegeben von:
setCreateRequestin SchnittstelleJakartaPostResponse- Parameter:
isCreateRequest- true if the request was a create request
-
isCreateRequest
public boolean isCreateRequest()Beschreibung aus Schnittstelle kopiert:JakartaPostResponseReturnstrueif this was a create request.Before calling the
JakartaPostResponse.setCreateRequest(boolean)method, this method always returnsfalse.- Angegeben von:
isCreateRequestin SchnittstelleJakartaPostResponse- Gibt zurück:
- if this was a create request
-
setLocation
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the location of this modification. This is the externalized form of thecurrent path.- Angegeben von:
setLocationin SchnittstelleJakartaPostResponse- Parameter:
location- the location
-
getLocation
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseReturns the location of the modification.If the
JakartaPostResponse.setLocation(String)method has not been called yet, this method returnsnull.- Angegeben von:
getLocationin SchnittstelleJakartaPostResponse- Gibt zurück:
- the location
-
setParentLocation
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the parent location of the modification. This is the externalized form of the parent node of thecurrent path.- Angegeben von:
setParentLocationin SchnittstelleJakartaPostResponse- Parameter:
parentLocation- the parent location of the modification
-
getParentLocation
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseReturns the parent location of the modification.If the
JakartaPostResponse.setParentLocation(String)method has not been called yet, this method returnsnull.- Angegeben von:
getParentLocationin SchnittstelleJakartaPostResponse- Gibt zurück:
- the parent location
-
setTitle
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the title of the response message- Angegeben von:
setTitlein SchnittstelleJakartaPostResponse- Parameter:
title- the title
-
setStatus
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the response status code properties- Angegeben von:
setStatusin SchnittstelleJakartaPostResponse- Parameter:
code- the codemessage- the message
-
getStatusCode
public int getStatusCode()Beschreibung aus Schnittstelle kopiert: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.- Angegeben von:
getStatusCodein SchnittstelleJakartaPostResponse- Gibt zurück:
- the status code
-
getStatusMessage
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseReturns the status message ornullif no has been set with theJakartaPostResponse.setStatus(int, String)method.- Angegeben von:
getStatusMessagein SchnittstelleJakartaPostResponse- Gibt zurück:
- the status message (might be null)
-
setError
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the recorded error causing the operation to fail.- Angegeben von:
setErrorin SchnittstelleJakartaPostResponse- Parameter:
error- the throwable
-
getError
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseReturns any recorded error ornull- Angegeben von:
getErrorin SchnittstelleJakartaPostResponse- Gibt zurück:
- an error or
null
-
isSuccessful
public boolean isSuccessful()Beschreibung aus Schnittstelle kopiert:JakartaPostResponse- Angegeben von:
isSuccessfulin SchnittstelleJakartaPostResponse- Gibt zurück:
- true if the status code is 2xx
-
onCreated
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseRecords a 'created' change- Angegeben von:
onCreatedin SchnittstelleJakartaPostResponse- Parameter:
path- path of the item that was created
-
onModified
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseRecords a 'modified' change- Angegeben von:
onModifiedin SchnittstelleJakartaPostResponse- Parameter:
path- path of the item that was modified
-
onDeleted
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseRecords a 'deleted' change- Angegeben von:
onDeletedin SchnittstelleJakartaPostResponse- Parameter:
path- path of the item that was deleted
-
onMoved
Beschreibung aus Schnittstelle kopiert: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.
- Angegeben von:
onMovedin SchnittstelleJakartaPostResponse- Parameter:
srcPath- source path of the node that was moveddstPath- destination path of the node that was moved.
-
onCopied
Beschreibung aus Schnittstelle kopiert: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.
- Angegeben von:
onCopiedin SchnittstelleJakartaPostResponse- Parameter:
srcPath- source path of the node that was copieddstPath- destination path of the node that was copied.
-
onChange
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseRecords a generic change of the giventypewith arguments.- Angegeben von:
onChangein SchnittstelleJakartaPostResponse- Parameter:
type- The type of the modificationarguments- The arguments to the modifications
-
send
public void send(jakarta.servlet.http.HttpServletResponse response, boolean setStatus) throws IOException Beschreibung aus Schnittstelle kopiert:JakartaPostResponseWrites the response back over the provided HTTP channel. The actual format of the response is implementation dependent.- Angegeben von:
sendin SchnittstelleJakartaPostResponse- Parameter:
response- to send tosetStatus- whether to set the status code on the response- Löst aus:
IOException- if an i/o exception occurs
-