@Deprecated public class HtmlResponse extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PN_CHANGE_LOG
Deprecated.
human readable changelog
|
static String |
PN_ERROR
Deprecated.
The Throwable caught while processing the request.
|
static String |
PN_IS_CREATED
Deprecated.
Indicating whether request processing created new data.
|
static String |
PN_LOCATION
Deprecated.
externally mapped location url of the modified path
|
static String |
PN_PARENT_LOCATION
Deprecated.
externally mapped location url of the parent of the modified path
|
static String |
PN_PATH
Deprecated.
the path of the modified item.
|
static String |
PN_REFERER
Deprecated.
the referrer of the request
|
static String |
PN_STATUS_CODE
Deprecated.
status code.
|
static String |
PN_STATUS_MESSAGE
Deprecated.
some human readable status message
|
static String |
PN_TITLE
Deprecated.
some human readable title like: 200 Created /foo/bar
|
Constructor and Description |
---|
HtmlResponse()
Deprecated.
Creates a new html response with default settings, which is
null for almost all properties except the
isCreateRequest() which defaults to false . |
Modifier and Type | Method and Description |
---|---|
Throwable |
getError()
Deprecated.
Returns any recorded error or
null |
String |
getLocation()
Deprecated.
Returns the location of the modification.
|
String |
getParentLocation()
Deprecated.
Returns the parent location of the modification.
|
String |
getPath()
Deprecated.
Returns the absolute path of the item upon which the request operated.
|
Object |
getProperty(String name)
Deprecated.
Returns the generic response property with the given name and type or
null if no such property exists. |
<Type> Type |
getProperty(String name,
Class<Type> type)
Deprecated.
Returns the generic response property with the given name and type or
null if no such property exists or the property is not of
the requested type. |
String |
getReferer()
Deprecated.
Returns the referer as from the 'referer' request header.
|
int |
getStatusCode()
Deprecated.
Returns the status code of this instance.
|
String |
getStatusMessage()
Deprecated.
Get the status message
|
boolean |
isCreateRequest()
Deprecated.
Returns
true if this was a create request. |
boolean |
isSuccessful()
Deprecated.
|
void |
onChange(String type,
String... arguments)
Deprecated.
Records a generic change of the given
type . |
void |
onCopied(String srcPath,
String dstPath)
Deprecated.
Records a 'copied' change.
|
void |
onCreated(String path)
Deprecated.
Records a 'created' change
|
void |
onDeleted(String path)
Deprecated.
Records a 'deleted' change
|
void |
onModified(String path)
Deprecated.
Records a 'modified' change
|
void |
onMoved(String srcPath,
String dstPath)
Deprecated.
Records a 'moved' change.
|
void |
send(javax.servlet.http.HttpServletResponse response,
boolean setStatus)
Deprecated.
Writes the response to the given writer and replaces all ${var} patterns
by the value of the respective property.
|
void |
setCreateRequest(boolean isCreateRequest)
Deprecated.
Sets whether the request was a create request or not.
|
void |
setError(Throwable error)
Deprecated.
Set the error
|
void |
setLocation(String location)
Deprecated.
Set the location
|
void |
setParentLocation(String parentLocation)
Deprecated.
Set the parent location
|
void |
setPath(String path)
Deprecated.
Sets the absolute path of the item upon which the request operated.
|
void |
setProperty(String name,
Object value)
Deprecated.
Sets a generic response property with the given
|
void |
setReferer(String referer)
Deprecated.
Sets the referer property
|
void |
setStatus(int code,
String message)
Deprecated.
sets the response status code properties
|
void |
setTitle(String title)
Deprecated.
Sets the title of the response message
|
public static final String PN_TITLE
public static final String PN_STATUS_CODE
public static final String PN_STATUS_MESSAGE
public static final String PN_LOCATION
public static final String PN_PARENT_LOCATION
public static final String PN_PATH
public static final String PN_REFERER
public static final String PN_IS_CREATED
false
and may be changed by calling
the setCreateRequest(boolean)
method.public static final String PN_CHANGE_LOG
public static final String PN_ERROR
setError(Throwable)
method is called.public HtmlResponse()
null
for almost all properties except the
isCreateRequest()
which defaults to false
.public String getReferer()
public void setReferer(String referer)
referer
- The referrer to setpublic String getPath()
If the setPath(String)
method has not been called yet, this
method returns null
.
null
.public void setPath(String path)
path
- The pathpublic boolean isCreateRequest()
true
if this was a create request.
Before calling the setCreateRequest(boolean)
method, this method
always returns false
.
true
if this is a create requestpublic void setCreateRequest(boolean isCreateRequest)
isCreateRequest
- flag for the create requestpublic String getLocation()
public void setLocation(String location)
location
- The locationpublic String getParentLocation()
public void setParentLocation(String parentLocation)
parentLocation
- The parent locationpublic void setTitle(String title)
title
- the titlepublic void setStatus(int code, String message)
code
- the codemessage
- the messagepublic int getStatusCode()
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.public String getStatusMessage()
public Throwable getError()
null
null
public void setError(Throwable error)
error
- The errorpublic boolean isSuccessful()
true
if successfulpublic void onModified(String path)
path
- path of the item that was modifiedpublic void onCreated(String path)
path
- path of the item that was createdpublic void onDeleted(String path)
path
- path of the item that was deletedpublic void onMoved(String srcPath, String dstPath)
Note: the moved change only records the basic move command. the implied changes on the moved properties and sub nodes are not recorded.
srcPath
- source path of the node that was moveddstPath
- destination path of the node that was moved.public void onCopied(String srcPath, String dstPath)
Note: the copy change only records the basic copy command. the implied changes on the copied properties and sub nodes are not recorded.
srcPath
- source path of the node that was copieddstPath
- destination path of the node that was copied.public void onChange(String type, String... arguments)
type
.
The change is added to the internal list of changes with the syntax of a
method call, where the type
is the method name and the
arguments
are the string arguments to the method enclosed in
double quotes. For example, the the call
onChange("sameple", "arg1", "arg2");is aded as
sample("arg1", "arg2")to the internal list of changes.
type
- The type of the modificationarguments
- The arguments to the modificationspublic void setProperty(String name, Object value)
name
- name of the propertyvalue
- value of the propertypublic <Type> Type getProperty(String name, Class<Type> type)
null
if no such property exists or the property is not of
the requested type.Type
- The type to getname
- The property nametype
- The type to getnull
.public Object getProperty(String name)
null
if no such property exists.name
- The property namenull
.public void send(javax.servlet.http.HttpServletResponse response, boolean setStatus) throws IOException
response
- to send tosetStatus
- whether to set the status code on the responseIOException
- if an i/o exception occursCopyright © 2017 The Apache Software Foundation. All rights reserved.