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 classErrorResponse.ErrorResponseTypeThis enum represents the different types of error response
-
Field Summary
-
Fields inherited from class org.apache.directory.api.ldap.model.message.AbstractMessage
controls
-
-
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 LdapApiServicegetCodecService()ResponsegetDecorated()Gets the Message this DsmlDecorator decorates.ErrorResponse.ErrorResponseTypegetErrorType()Gets the type of error responseStringgetMessage()Gets the messageintgetRequestID()Gets the request IDStringgetTypeDescr(ErrorResponse.ErrorResponseType type)Returns the String associated to the error response typevoidsetErrorType(ErrorResponse.ErrorResponseType errorType)Sets the type of error responsevoidsetMessage(String message)Sets the messagevoidsetRequestID(int requestID)Sets the request IDElementtoDsml(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
clone, finalize, 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 Element toDsml(Element root)
Converts the request/reponse to its XML representation in the DSMLv2 format- Specified by:
toDsmlin 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:
getDecoratedin interfaceDsmlDecorator<Response>- Returns:
- The decorated Message instance
-
-