Class HtmlPostResponseProxy
- java.lang.Object
-
- org.apache.sling.servlets.post.impl.helper.HtmlPostResponseProxy
-
- All Implemented Interfaces:
PostResponse
@Deprecated public class HtmlPostResponseProxy extends Object implements PostResponse
Deprecated.TheHtmlPostResponseProxyclass implements thePostResponseinterface using a Sling APIHtmlResponse.This class is mainly used by the deprecated
AbstractSlingPostOperationfor bridging into the newAbstractPostOperation.
-
-
Constructor Summary
Constructors Constructor Description HtmlPostResponseProxy(org.apache.sling.api.servlets.HtmlResponse apiHtmlResponse)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ThrowablegetError()Deprecated.Returns any recorded error ornullorg.apache.sling.api.servlets.HtmlResponsegetHtmlResponse()Deprecated.StringgetLocation()Deprecated.Returns the location of the modification.StringgetParentLocation()Deprecated.Returns the parent location of the modification.StringgetPath()Deprecated.Returns the absolute path of the item upon which the request operated.ObjectgetProperty(String name)Deprecated.<Type> TypegetProperty(String name, Class<Type> type)Deprecated.StringgetReferer()Deprecated.Returns the referer previously set byPostResponse.setReferer(String)intgetStatusCode()Deprecated.Returns the status code of this instance.StringgetStatusMessage()Deprecated.Returns the status message ornullif no has been set with thePostResponse.setStatus(int, String)method.booleanisCreateRequest()Deprecated.Returnstrueif this was a create request.booleanisSuccessful()Deprecated.voidonChange(String type, String... arguments)Deprecated.Records a generic change of the giventypewith arguments.voidonCopied(String srcPath, String dstPath)Deprecated.Records a 'copied' change.voidonCreated(String path)Deprecated.Records a 'created' changevoidonDeleted(String path)Deprecated.Records a 'deleted' changevoidonModified(String path)Deprecated.Records a 'modified' changevoidonMoved(String srcPath, String dstPath)Deprecated.Records a 'moved' change.voidsend(javax.servlet.http.HttpServletResponse response, boolean setStatus)Deprecated.Writes the response back over the provided HTTP channel.voidsetCreateRequest(boolean isCreateRequest)Deprecated.Sets whether the request was a create request or not.voidsetError(Throwable error)Deprecated.Sets the recorded error causing the operation to fail.voidsetLocation(String location)Deprecated.Sets the location of this modification.voidsetParentLocation(String parentLocation)Deprecated.Sets the parent location of the modification.voidsetPath(String path)Deprecated.Sets the absolute path of the item upon which the request operated.voidsetProperty(String name, Object value)Deprecated.voidsetReferer(String referer)Deprecated.Sets the referer propertyvoidsetStatus(int code, String message)Deprecated.Sets the response status code propertiesvoidsetTitle(String title)Deprecated.Sets the title of the response message
-
-
-
Method Detail
-
getHtmlResponse
public org.apache.sling.api.servlets.HtmlResponse getHtmlResponse()
Deprecated.
-
getError
public Throwable getError()
Deprecated.Description copied from interface:PostResponseReturns any recorded error ornull- Specified by:
getErrorin interfacePostResponse- Returns:
- an error or
null
-
getLocation
public String getLocation()
Deprecated.Description copied from interface:PostResponseReturns the location of the modification.If the
PostResponse.setLocation(String)method has not been called yet, this method returnsnull.- Specified by:
getLocationin interfacePostResponse- Returns:
- the location
-
getParentLocation
public String getParentLocation()
Deprecated.Description copied from interface:PostResponseReturns the parent location of the modification.If the
PostResponse.setParentLocation(String)method has not been called yet, this method returnsnull.- Specified by:
getParentLocationin interfacePostResponse- Returns:
- the parent location
-
getPath
public String getPath()
Deprecated.Description copied from interface:PostResponseReturns 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.- Specified by:
getPathin interfacePostResponse- Returns:
- the path (might be null)
-
getReferer
public String getReferer()
Deprecated.Description copied from interface:PostResponseReturns the referer previously set byPostResponse.setReferer(String)- Specified by:
getRefererin interfacePostResponse- Returns:
- the referer
-
getStatusCode
public int getStatusCode()
Deprecated.Description copied from interface:PostResponseReturns the status code of this instance. If the status code has never been set by calling thePostResponse.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 interfacePostResponse- Returns:
- the status code
-
getStatusMessage
public String getStatusMessage()
Deprecated.Description copied from interface:PostResponseReturns the status message ornullif no has been set with thePostResponse.setStatus(int, String)method.- Specified by:
getStatusMessagein interfacePostResponse- Returns:
- the status message (might be null)
-
isCreateRequest
public boolean isCreateRequest()
Deprecated.Description copied from interface:PostResponseReturnstrueif this was a create request.Before calling the
PostResponse.setCreateRequest(boolean)method, this method always returnsfalse.- Specified by:
isCreateRequestin interfacePostResponse- Returns:
- if this was a create request
-
isSuccessful
public boolean isSuccessful()
Deprecated.Description copied from interface:PostResponse- Specified by:
isSuccessfulin interfacePostResponse- Returns:
- true if the status code is 2xx
-
onChange
public void onChange(String type, String... arguments)
Deprecated.Description copied from interface:PostResponseRecords a generic change of the giventypewith arguments.- Specified by:
onChangein interfacePostResponse- Parameters:
type- The type of the modificationarguments- The arguments to the modifications
-
onCopied
public void onCopied(String srcPath, String dstPath)
Deprecated.Description copied from interface:PostResponseRecords 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 interfacePostResponse- Parameters:
srcPath- source path of the node that was copieddstPath- destination path of the node that was copied.
-
onCreated
public void onCreated(String path)
Deprecated.Description copied from interface:PostResponseRecords a 'created' change- Specified by:
onCreatedin interfacePostResponse- Parameters:
path- path of the item that was created
-
onDeleted
public void onDeleted(String path)
Deprecated.Description copied from interface:PostResponseRecords a 'deleted' change- Specified by:
onDeletedin interfacePostResponse- Parameters:
path- path of the item that was deleted
-
onModified
public void onModified(String path)
Deprecated.Description copied from interface:PostResponseRecords a 'modified' change- Specified by:
onModifiedin interfacePostResponse- Parameters:
path- path of the item that was modified
-
onMoved
public void onMoved(String srcPath, String dstPath)
Deprecated.Description copied from interface:PostResponseRecords 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 interfacePostResponse- Parameters:
srcPath- source path of the node that was moveddstPath- destination path of the node that was moved.
-
send
public void send(javax.servlet.http.HttpServletResponse response, boolean setStatus) throws IOExceptionDeprecated.Description copied from interface:PostResponseWrites the response back over the provided HTTP channel. The actual format of the response is implementation dependent.- Specified by:
sendin interfacePostResponse- 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)
Deprecated.Description copied from interface:PostResponseSets whether the request was a create request or not.- Specified by:
setCreateRequestin interfacePostResponse- Parameters:
isCreateRequest- true if the request was a create request
-
setError
public void setError(Throwable error)
Deprecated.Description copied from interface:PostResponseSets the recorded error causing the operation to fail.- Specified by:
setErrorin interfacePostResponse- Parameters:
error- the throwable
-
setLocation
public void setLocation(String location)
Deprecated.Description copied from interface:PostResponseSets the location of this modification. This is the externalized form of thecurrent path.- Specified by:
setLocationin interfacePostResponse- Parameters:
location- the location
-
setParentLocation
public void setParentLocation(String parentLocation)
Deprecated.Description copied from interface:PostResponseSets the parent location of the modification. This is the externalized form of the parent node of thecurrent path.- Specified by:
setParentLocationin interfacePostResponse- Parameters:
parentLocation- the parent location of the modification
-
setPath
public void setPath(String path)
Deprecated.Description copied from interface:PostResponseSets the absolute path of the item upon which the request operated.- Specified by:
setPathin interfacePostResponse- Parameters:
path- the path
-
setReferer
public void setReferer(String referer)
Deprecated.Description copied from interface:PostResponseSets the referer property- Specified by:
setRefererin interfacePostResponse- Parameters:
referer- the referer
-
setStatus
public void setStatus(int code, String message)Deprecated.Description copied from interface:PostResponseSets the response status code properties- Specified by:
setStatusin interfacePostResponse- Parameters:
code- the codemessage- the message
-
setTitle
public void setTitle(String title)
Deprecated.Description copied from interface:PostResponseSets the title of the response message- Specified by:
setTitlein interfacePostResponse- Parameters:
title- the title
-
-