Class ErrorResponse
- java.lang.Object
-
- org.apache.directory.api.ldap.model.message.AbstractMessage
-
- org.apache.directory.api.ldap.model.message.AbstractResponse
-
- org.apache.directory.api.dsmlv2.response.ErrorResponse
-
- All Implemented Interfaces:
DsmlDecorator<Response>
,Message
,Response
public class ErrorResponse extends AbstractResponse implements Response, DsmlDecorator<Response>
Class representing Error Response.
An Error Response has a requestID, a message, and a type which can be :- NOT_ATTEMPTED,
- COULD_NOT_CONNECT,
- CONNECTION_CLOSED,
- MALFORMED_REQUEST,
- GATEWAY_INTERNAL_ERROR,
- AUTHENTICATION_FAILED,
- UNRESOLVABLE_URI,
- OTHER
- Author:
- Apache Directory Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ErrorResponse.ErrorResponseType
This enum represents the different types of error response
-
Constructor Summary
Constructors Constructor Description ErrorResponse(int requestID, ErrorResponse.ErrorResponseType type, String message)
Creates a new instance of ErrorResponse.ErrorResponse(int id, MessageTypeEnum type)
Creates a new instance of ErrorResponse.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapApiService
getCodecService()
Response
getDecorated()
Gets the Message this DsmlDecorator decorates.ErrorResponse.ErrorResponseType
getErrorType()
Gets the type of error responseString
getMessage()
Gets the messageint
getRequestID()
Gets the request IDString
getTypeDescr(ErrorResponse.ErrorResponseType type)
Returns the String associated to the error response typevoid
setErrorType(ErrorResponse.ErrorResponseType errorType)
Sets the type of error responsevoid
setMessage(String message)
Sets the messagevoid
setRequestID(int requestID)
Sets the request IDorg.dom4j.Element
toDsml(org.dom4j.Element root)
Converts the request/reponse to its XML representation in the DSMLv2 format-
Methods inherited from class org.apache.directory.api.ldap.model.message.AbstractMessage
addAllControls, addControl, equals, get, getControl, getControls, getMessageId, getType, hasControl, hashCode, put, removeControl, setMessageId, toString
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
-
-
-
-
Constructor Detail
-
ErrorResponse
public ErrorResponse(int id, MessageTypeEnum type)
Creates a new instance of ErrorResponse.- Parameters:
id
- the response eliciting this Requesttype
- the message type of the response
-
ErrorResponse
public ErrorResponse(int requestID, ErrorResponse.ErrorResponseType type, String message)
Creates a new instance of ErrorResponse.- Parameters:
requestID
- the requestID of the responsetype
- the type of the responsemessage
- the associated message
-
-
Method Detail
-
toDsml
public org.dom4j.Element toDsml(org.dom4j.Element root)
Converts the request/reponse to its XML representation in the DSMLv2 format- Specified by:
toDsml
in interfaceDsmlDecorator<Response>
- Parameters:
root
- the root dom4j Element- Returns:
- the dom4j Element corresponding to the entry.
-
getTypeDescr
public String getTypeDescr(ErrorResponse.ErrorResponseType type)
Returns the String associated to the error response type- Parameters:
type
- the error response type- Returns:
- the corresponding String
-
getMessage
public String getMessage()
Gets the message- Returns:
- the message
-
setMessage
public void setMessage(String message)
Sets the message- Parameters:
message
- the message to set
-
getRequestID
public int getRequestID()
Gets the request ID- Returns:
- the request ID
-
setRequestID
public void setRequestID(int requestID)
Sets the request ID- Parameters:
requestID
- the request ID to set
-
getErrorType
public ErrorResponse.ErrorResponseType getErrorType()
Gets the type of error response- Returns:
- the type of error response
-
setErrorType
public void setErrorType(ErrorResponse.ErrorResponseType errorType)
Sets the type of error response- Parameters:
errorType
- the type of error response to set
-
getCodecService
public LdapApiService getCodecService()
- Returns:
- The LdapApiService instance
-
getDecorated
public Response getDecorated()
Gets the Message this DsmlDecorator decorates.- Specified by:
getDecorated
in interfaceDsmlDecorator<Response>
- Returns:
- The decorated Message instance
-
-