public class CommandError extends ResponseDataObject implements ErrorInterface
Constructor and Description |
---|
CommandError() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createErrorXml(java.lang.String commandName,
java.lang.String statusCode,
java.lang.String exception,
java.lang.String errorMessage,
java.lang.String response)
Creates an XML string error message, embedded in an XML string document named by the command
This is the XML that ResponseParser will turn into a CommandError object.
|
ErrorHelper.ErrorCode |
getApplicationErrorCode() |
java.lang.String |
getException() |
java.lang.String |
getLabel() |
java.lang.String |
getMessage() |
ServiceError |
getServiceError() |
java.util.List<java.lang.String> |
getSuggestions() |
static java.lang.String |
insertErrorXml(java.lang.String commandName,
java.lang.String statusCode,
java.lang.String exception,
java.lang.String pazpar2ErrorXml)
Embeds a Pazpar2 (or Pazpar2 client) error response document as a child element of
a command response document (like 'search' or 'show').
|
boolean |
isPazpar2Error() |
boolean |
isServiceError() |
boolean |
isServiceProxyError() |
void |
setApplicationErrorCode(ErrorHelper.ErrorCode code) |
void |
setErrorHelper(ErrorHelper errorHelper)
Sets the object that should be used to analyze the error
|
addElement, appendContent, getApplicationError, getAttribute, getBinary, getElements, getHasResults, getIntValue, getIsBinary, getOneElement, getOneValue, getProperty, getType, getValue, getValueArray, getXml, hasApplicationError, hasServiceError, setAttribute, setBinary, setType, setXml
public java.lang.String getLabel()
getLabel
in interface ErrorInterface
public java.lang.String getMessage()
getMessage
in interface ErrorInterface
public java.lang.String getException()
getException
in interface ErrorInterface
public java.util.List<java.lang.String> getSuggestions()
getSuggestions
in interface ErrorInterface
public static java.lang.String createErrorXml(java.lang.String commandName, java.lang.String statusCode, java.lang.String exception, java.lang.String errorMessage, java.lang.String response)
commandName
- exception
- errorMessage
- public static java.lang.String insertErrorXml(java.lang.String commandName, java.lang.String statusCode, java.lang.String exception, java.lang.String pazpar2ErrorXml)
commandName
- The name of the command during which's execution the error was encounteredexception
- The (possibly loosely defined) name of the exception that was thrownpazpar2ErrorXml
- The error document as created by Pazpar2, or the Service Proxy or
by the Pazpar2 client itself.public void setErrorHelper(ErrorHelper errorHelper)
setErrorHelper
in interface ErrorInterface
public void setApplicationErrorCode(ErrorHelper.ErrorCode code)
setApplicationErrorCode
in interface ErrorInterface
public ErrorHelper.ErrorCode getApplicationErrorCode()
getApplicationErrorCode
in interface ErrorInterface
public boolean isServiceError()
isServiceError
in interface ErrorInterface
public ServiceError getServiceError()
getServiceError
in interface ErrorInterface
getServiceError
in class ResponseDataObject
public boolean isServiceProxyError()
public boolean isPazpar2Error()