public abstract class AbstractPostResponseWrapper extends java.lang.Object implements PostResponse
Constructor and Description |
---|
AbstractPostResponseWrapper() |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getError()
Returns any recorded error or
null |
java.lang.String |
getLocation()
Returns the location of the modification.
|
java.lang.String |
getParentLocation()
Returns the parent location of the modification.
|
java.lang.String |
getPath()
Returns the absolute path of the item upon which the request operated.
|
java.lang.String |
getReferer()
Returns the referer previously set by
PostResponse.setReferer(String) |
int |
getStatusCode()
Returns the status code of this instance.
|
java.lang.String |
getStatusMessage()
Returns the status message or
null if no has been set with
the PostResponse.setStatus(int, String) method. |
abstract PostResponse |
getWrapped()
Use this method to return an instance of the class being wrapped.
|
boolean |
isCreateRequest()
Returns
true if this was a create request. |
boolean |
isSuccessful()
|
void |
onChange(java.lang.String type,
java.lang.String... arguments)
Records a generic change of the given
type with arguments. |
void |
onCopied(java.lang.String srcPath,
java.lang.String dstPath)
Records a 'copied' change.
|
void |
onCreated(java.lang.String path)
Records a 'created' change
|
void |
onDeleted(java.lang.String path)
Records a 'deleted' change
|
void |
onModified(java.lang.String path)
Records a 'modified' change
|
void |
onMoved(java.lang.String srcPath,
java.lang.String dstPath)
Records a 'moved' change.
|
void |
send(javax.servlet.http.HttpServletResponse response,
boolean setStatus)
Writes the response back over the provided HTTP channel.
|
void |
setCreateRequest(boolean isCreateRequest)
Sets whether the request was a create request or not.
|
void |
setError(java.lang.Throwable error)
Sets the recorded error causing the operation to fail.
|
void |
setLocation(java.lang.String location)
Sets the location of this modification.
|
void |
setParentLocation(java.lang.String parentLocation)
Sets the parent location of the modification.
|
void |
setPath(java.lang.String path)
Sets the absolute path of the item upon which the request operated.
|
void |
setReferer(java.lang.String referer)
Sets the referer property
|
void |
setStatus(int code,
java.lang.String message)
Sets the response status code properties
|
void |
setTitle(java.lang.String title)
Sets the title of the response message
|
public abstract PostResponse getWrapped()
public void setReferer(java.lang.String referer)
PostResponse
setReferer
in interface PostResponse
referer
- the refererpublic java.lang.String getReferer()
PostResponse
PostResponse.setReferer(String)
getReferer
in interface PostResponse
public void setPath(java.lang.String path)
PostResponse
setPath
in interface PostResponse
path
- the pathpublic java.lang.String getPath()
PostResponse
If the PostResponse.setPath(String)
method has not been called yet, this
method returns null
.
getPath
in interface PostResponse
public void setCreateRequest(boolean isCreateRequest)
PostResponse
setCreateRequest
in interface PostResponse
isCreateRequest
- true if the request was a create requestpublic boolean isCreateRequest()
PostResponse
true
if this was a create request.
Before calling the PostResponse.setCreateRequest(boolean)
method, this method
always returns false
.
isCreateRequest
in interface PostResponse
public void setLocation(java.lang.String location)
PostResponse
current path
.setLocation
in interface PostResponse
location
- the locationpublic java.lang.String getLocation()
PostResponse
If the PostResponse.setLocation(String)
method has not been called yet, this
method returns null
.
getLocation
in interface PostResponse
public void setParentLocation(java.lang.String parentLocation)
PostResponse
current path
.setParentLocation
in interface PostResponse
parentLocation
- the parent location of the modificationpublic java.lang.String getParentLocation()
PostResponse
If the PostResponse.setParentLocation(String)
method has not been called yet,
this method returns null
.
getParentLocation
in interface PostResponse
public void setTitle(java.lang.String title)
PostResponse
setTitle
in interface PostResponse
title
- the titlepublic void setStatus(int code, java.lang.String message)
PostResponse
setStatus
in interface PostResponse
code
- the codemessage
- the messagepublic int getStatusCode()
PostResponse
PostResponse.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.getStatusCode
in interface PostResponse
public java.lang.String getStatusMessage()
PostResponse
null
if no has been set with
the PostResponse.setStatus(int, String)
method.getStatusMessage
in interface PostResponse
public void setError(java.lang.Throwable error)
PostResponse
setError
in interface PostResponse
error
- the throwablepublic java.lang.Throwable getError()
PostResponse
null
getError
in interface PostResponse
null
public boolean isSuccessful()
PostResponse
isSuccessful
in interface PostResponse
public void onCreated(java.lang.String path)
PostResponse
onCreated
in interface PostResponse
path
- path of the item that was createdpublic void onModified(java.lang.String path)
PostResponse
onModified
in interface PostResponse
path
- path of the item that was modifiedpublic void onDeleted(java.lang.String path)
PostResponse
onDeleted
in interface PostResponse
path
- path of the item that was deletedpublic void onMoved(java.lang.String srcPath, java.lang.String dstPath)
PostResponse
Note: the moved change only records the basic move command. the implied changes on the moved properties and sub nodes are not recorded.
onMoved
in interface PostResponse
srcPath
- source path of the node that was moveddstPath
- destination path of the node that was moved.public void onCopied(java.lang.String srcPath, java.lang.String dstPath)
PostResponse
Note: the copy change only records the basic copy command. the implied changes on the copied properties and sub nodes are not recorded.
onCopied
in interface PostResponse
srcPath
- source path of the node that was copieddstPath
- destination path of the node that was copied.public void onChange(java.lang.String type, java.lang.String... arguments)
PostResponse
type
with arguments.onChange
in interface PostResponse
type
- The type of the modificationarguments
- The arguments to the modificationspublic void send(javax.servlet.http.HttpServletResponse response, boolean setStatus) throws java.io.IOException
PostResponse
send
in interface PostResponse
response
- to send tosetStatus
- whether to set the status code on the responsejava.io.IOException
- if an i/o exception occursCopyright © 2022 The Apache Software Foundation. All rights reserved.