Schnittstelle PostResponse
- Alle bekannten Implementierungsklassen:
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.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetError()Veraltet.Returns any recorded error ornullVeraltet.Returns the location of the modification.Veraltet.Returns the parent location of the modification.getPath()Veraltet.Returns the absolute path of the item upon which the request operated.Veraltet.Returns the referer previously set bysetReferer(String)intVeraltet.Returns the status code of this instance.Veraltet.Returns the status message ornullif no has been set with thesetStatus(int, String)method.booleanVeraltet.Returnstrueif this was a create request.booleanVeraltet.voidVeraltet.Records a generic change of the giventypewith arguments.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.voidsend(javax.servlet.http.HttpServletResponse response, boolean setStatus) Veraltet.Writes the response back over the provided HTTP channel.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.voidsetReferer(String referer) Veraltet.Sets the referer propertyvoidVeraltet.Sets the response status code propertiesvoidVeraltet.Sets the title of the response message
-
Methodendetails
-
setReferer
Veraltet.Sets the referer property- Parameter:
referer- the referer
-
getReferer
String getReferer()Veraltet.Returns the referer previously set bysetReferer(String)- Gibt zurück:
- the referer
-
setPath
Veraltet.Sets the absolute path of the item upon which the request operated.- Parameter:
path- the path
-
getPath
String getPath()Veraltet.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.- Gibt zurück:
- the path (might be null)
-
setCreateRequest
void setCreateRequest(boolean isCreateRequest) Veraltet.Sets whether the request was a create request or not.- Parameter:
isCreateRequest- true if the request was a create request
-
isCreateRequest
boolean isCreateRequest()Veraltet.Returnstrueif this was a create request.Before calling the
setCreateRequest(boolean)method, this method always returnsfalse.- Gibt zurück:
- if this was a create request
-
setLocation
Veraltet.Sets the location of this modification. This is the externalized form of thecurrent path.- Parameter:
location- the location
-
getLocation
String getLocation()Veraltet.Returns the location of the modification.If the
setLocation(String)method has not been called yet, this method returnsnull.- Gibt zurück:
- the location
-
setParentLocation
Veraltet.Sets the parent location of the modification. This is the externalized form of the parent node of thecurrent path.- Parameter:
parentLocation- the parent location of the modification
-
getParentLocation
String getParentLocation()Veraltet.Returns the parent location of the modification.If the
setParentLocation(String)method has not been called yet, this method returnsnull.- Gibt zurück:
- the parent location
-
setTitle
Veraltet.Sets the title of the response message- Parameter:
title- the title
-
setStatus
Veraltet.Sets the response status code properties- Parameter:
code- the codemessage- the message
-
getStatusCode
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.- Gibt zurück:
- the status code
-
getStatusMessage
String getStatusMessage()Veraltet.Returns the status message ornullif no has been set with thesetStatus(int, String)method.- Gibt zurück:
- the status message (might be null)
-
setError
Veraltet.Sets the recorded error causing the operation to fail.- Parameter:
error- the throwable
-
getError
Throwable getError()Veraltet.Returns any recorded error ornull- Gibt zurück:
- an error or
null
-
isSuccessful
boolean isSuccessful()Veraltet.- Gibt zurück:
- true if the status code is 2xx
-
onCreated
Veraltet.Records a 'created' change- Parameter:
path- path of the item that was created
-
onModified
Veraltet.Records a 'modified' change- Parameter:
path- path of the item that was modified
-
onDeleted
Veraltet.Records a 'deleted' change- 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.
- 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.
- Parameter:
srcPath- source path of the node that was copieddstPath- destination path of the node that was copied.
-
onChange
Veraltet.Records a generic change of the giventypewith arguments.- Parameter:
type- The type of the modificationarguments- The arguments to the modifications
-
send
Veraltet.Writes the response back over the provided HTTP channel. The actual format of the response is implementation dependent.- Parameter:
response- to send tosetStatus- whether to set the status code on the response- Löst aus:
IOException- if an i/o exception occurs
-
JakartaPostResponseinstead