Package org.apache.sling.servlets.post
Klasse AbstractPostResponse
java.lang.Object
org.apache.sling.servlets.post.AbstractPostResponse
- Alle implementierten Schnittstellen:
PostResponse
- Bekannte direkte Unterklassen:
HtmlResponse,JSONResponse
Veraltet.
The
AbstractPostResponse class provides a basic implementation
of the PostResponse interface maintaining properties to be
prepared for sending the response in an internal map.-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final StringVeraltet.Name of the error property set bysetError(Throwable)static final StringVeraltet.Name of the create status property set bysetCreateRequest(boolean)static final StringVeraltet.Name of the location property set bysetLocation(String)static final StringVeraltet.Name of the parent location property set bysetParentLocation(String)static final StringVeraltet.Name of the path property set bysetPath(String)static final StringVeraltet.Name of the referer property set bysetReferer(String)static final StringVeraltet.Name of the status code property set bysetStatus(int, String)static final StringVeraltet.Name of the status message property set bysetStatus(int, String)static final StringVeraltet.Name of the title property set bysetTitle(String) -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract voiddoSend(javax.servlet.http.HttpServletResponse response) Veraltet.getError()Veraltet.Returns any recorded error ornullVeraltet.Returns the location of the modification.Veraltet.Returns the parent location of the modification. this is the externalized form of the parent node of the current path.getPath()Veraltet.Returns the absolute path of the item upon which the request operated.protected ObjectgetProperty(String name) Veraltet.Returns the generic response property with the given name and type ornullif no such property exists.protected <Type> TypegetProperty(String name, Class<Type> type) Veraltet.Returns the generic response property with the given name and type ornullif no such property exists or the property is not of the requested type.Veraltet.Returns the referer previously set byPostResponse.setReferer(String)intVeraltet.Returns the status code of this instance.Veraltet.Returns the status message ornullif no has been set with thePostResponse.setStatus(int, String)method.booleanVeraltet.Returnstrueif this was a create request.protected booleanVeraltet.determines if the referer has a proper referer including protocolbooleanVeraltet.voidVeraltet.Records a 'copied' change.voidVeraltet.Records a 'created' changevoidVeraltet.Records a 'deleted' changevoidonModified(String path) Veraltet.Records a 'modified' changevoidVeraltet.Records a 'moved' change.final voidsend(javax.servlet.http.HttpServletResponse response, boolean setStatus) Veraltet.Writes the response to the given writer and replaces all ${var} patterns by the value of the respective property. if the property is not defined the pattern is not modified.voidsetCreateRequest(boolean isCreateRequest) Veraltet.Sets whether the request was a create request or not.voidVeraltet.Sets the recorded error causing the operation to fail.voidsetLocation(String location) Veraltet.Sets the location of this modification.voidsetParentLocation(String parentLocation) Veraltet.Sets the parent location of the modification.voidVeraltet.Sets the absolute path of the item upon which the request operated.protected voidsetProperty(String name, Object value) Veraltet.Sets a generic response property with the givenvoidsetReferer(String referer) Veraltet.Sets the referer propertyvoidVeraltet.sets the response status code propertiesvoidVeraltet.Sets the title of the response messageVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden org.apache.sling.servlets.post.PostResponse
onChange
-
Felddetails
-
PN_TITLE
Veraltet.Name of the title property set bysetTitle(String)- Siehe auch:
-
PN_STATUS_CODE
Veraltet.Name of the status code property set bysetStatus(int, String)- Siehe auch:
-
PN_STATUS_MESSAGE
Veraltet.Name of the status message property set bysetStatus(int, String)- Siehe auch:
-
PN_LOCATION
Veraltet.Name of the location property set bysetLocation(String)- Siehe auch:
-
PN_PARENT_LOCATION
Veraltet.Name of the parent location property set bysetParentLocation(String)- Siehe auch:
-
PN_PATH
Veraltet.Name of the path property set bysetPath(String)- Siehe auch:
-
PN_REFERER
Veraltet.Name of the referer property set bysetReferer(String)- Siehe auch:
-
PN_IS_CREATED
Veraltet.Name of the create status property set bysetCreateRequest(boolean)- Siehe auch:
-
PN_ERROR
Veraltet.Name of the error property set bysetError(Throwable)- Siehe auch:
-
-
Konstruktordetails
-
AbstractPostResponse
public AbstractPostResponse()Veraltet.
-
-
Methodendetails
-
getReferer
Veraltet.Returns the referer previously set byPostResponse.setReferer(String)- Angegeben von:
getRefererin SchnittstellePostResponse- Gibt zurück:
- the referer
-
setReferer
Veraltet.Sets the referer property- Angegeben von:
setRefererin SchnittstellePostResponse- Parameter:
referer- the referer
-
getPath
Veraltet.Returns the absolute path of the item upon which the request operated.If the
PostResponse.setPath(String)method has not been called yet, this method returnsnull.- Angegeben von:
getPathin SchnittstellePostResponse- Gibt zurück:
- the path (might be null)
-
setPath
Veraltet.Sets the absolute path of the item upon which the request operated.- Angegeben von:
setPathin SchnittstellePostResponse- Parameter:
path- the path
-
isCreateRequest
public boolean isCreateRequest()Veraltet.Returnstrueif this was a create request.Before calling the
PostResponse.setCreateRequest(boolean)method, this method always returnsfalse.- Angegeben von:
isCreateRequestin SchnittstellePostResponse- Gibt zurück:
- if this was a create request
-
setCreateRequest
public void setCreateRequest(boolean isCreateRequest) Veraltet.Sets whether the request was a create request or not.- Angegeben von:
setCreateRequestin SchnittstellePostResponse- Parameter:
isCreateRequest- true if the request was a create request
-
getLocation
Veraltet.Returns the location of the modification.If the
PostResponse.setLocation(String)method has not been called yet, this method returnsnull.- Angegeben von:
getLocationin SchnittstellePostResponse- Gibt zurück:
- the location
-
setLocation
Veraltet.Beschreibung aus Schnittstelle kopiert:PostResponseSets the location of this modification. This is the externalized form of thecurrent path.- Angegeben von:
setLocationin SchnittstellePostResponse- Parameter:
location- the location
-
getParentLocation
Veraltet.Returns the parent location of the modification. this is the externalized form of the parent node of the current path.- Angegeben von:
getParentLocationin SchnittstellePostResponse- Gibt zurück:
- the location of the modification.
-
setParentLocation
Veraltet.Beschreibung aus Schnittstelle kopiert:PostResponseSets the parent location of the modification. This is the externalized form of the parent node of thecurrent path.- Angegeben von:
setParentLocationin SchnittstellePostResponse- Parameter:
parentLocation- the parent location of the modification
-
setTitle
Veraltet.Sets the title of the response message- Angegeben von:
setTitlein SchnittstellePostResponse- Parameter:
title- the title
-
setStatus
Veraltet.sets the response status code properties- Angegeben von:
setStatusin SchnittstellePostResponse- Parameter:
code- the codemessage- the message
-
getStatusCode
public int getStatusCode()Veraltet.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.- Angegeben von:
getStatusCodein SchnittstellePostResponse- Gibt zurück:
- the status code
-
getStatusMessage
Veraltet.Beschreibung aus Schnittstelle kopiert:PostResponseReturns the status message ornullif no has been set with thePostResponse.setStatus(int, String)method.- Angegeben von:
getStatusMessagein SchnittstellePostResponse- Gibt zurück:
- the status message (might be null)
-
getError
Veraltet.Returns any recorded error ornull- Angegeben von:
getErrorin SchnittstellePostResponse- Gibt zurück:
- an error or
null
-
setError
Veraltet.Beschreibung aus Schnittstelle kopiert:PostResponseSets the recorded error causing the operation to fail.- Angegeben von:
setErrorin SchnittstellePostResponse- Parameter:
error- the throwable
-
isSuccessful
public boolean isSuccessful()Veraltet.- Angegeben von:
isSuccessfulin SchnittstellePostResponse- Gibt zurück:
- true if the status code is 2xx
-
onModified
Veraltet.Records a 'modified' change- Angegeben von:
onModifiedin SchnittstellePostResponse- Parameter:
path- path of the item that was modified
-
onCreated
Veraltet.Records a 'created' change- Angegeben von:
onCreatedin SchnittstellePostResponse- Parameter:
path- path of the item that was created
-
onDeleted
Veraltet.Records a 'deleted' change- Angegeben von:
onDeletedin SchnittstellePostResponse- Parameter:
path- path of the item that was deleted
-
onMoved
Veraltet.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.
- Angegeben von:
onMovedin SchnittstellePostResponse- Parameter:
srcPath- source path of the node that was moveddstPath- destination path of the node that was moved.
-
onCopied
Veraltet.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.
- Angegeben von:
onCopiedin SchnittstellePostResponse- Parameter:
srcPath- source path of the node that was copieddstPath- destination path of the node that was copied.
-
setProperty
Veraltet.Sets a generic response property with the given- Parameter:
name- name of the propertyvalue- value of the property
-
getProperty
Veraltet.Returns the generic response property with the given name and type ornullif no such property exists or the property is not of the requested type.- Typparameter:
Type- the return type- Parameter:
name- the name of the requetested propertytype- the type of the parameter which should be returned- Gibt zurück:
- the property as the requested type or null if not available at all or not in the requested type
-
getProperty
Veraltet.Returns the generic response property with the given name and type ornullif no such property exists.- Parameter:
name- the name of the response property- Gibt zurück:
- the requested property (might be null)
-
isSafeReferer
protected boolean isSafeReferer()Veraltet.determines if the referer has a proper referer including protocol- Gibt zurück:
- true if HTTP or HTTPS protocol information is available in the referer
-
doSend
Veraltet.- Löst aus:
IOException
-
send
public final void send(javax.servlet.http.HttpServletResponse response, boolean setStatus) throws IOException Veraltet.Writes the response to the given writer and replaces all ${var} patterns by the value of the respective property. if the property is not defined the pattern is not modified.- Angegeben von:
sendin SchnittstellePostResponse- Parameter:
response- to send tosetStatus- whether to set the status code on the response- Löst aus:
IOException- if an i/o exception occurs
-
AbstractJakartaPostResponseinstead.