Package org.ldaptive
Class LdapException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.ldaptive.LdapException
-
- All Implemented Interfaces:
Serializable
,Message<ResponseControl>
,ResponseMessage
- Direct Known Subclasses:
ConnectionException
,OperationException
,PoolException
public class LdapException extends Exception implements ResponseMessage
Base exception for all ldap related exceptions. Provider specific exception can be found usingThrowable.getCause()
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private String
matchedDn
response matched DN.private int
messageId
Message ID.private String[]
referralURLs
referral URLs.private ResponseControl[]
responseControls
response controls.private ResultCode
resultCode
ldap result code.private static long
serialVersionUID
serialVersionUID.
-
Constructor Summary
Constructors Constructor Description LdapException(Exception e)
Creates a new ldap exception.LdapException(Exception e, ResultCode code)
Creates a new ldap exception.LdapException(Exception e, ResultCode code, String dn)
Creates a new ldap exception.LdapException(Exception e, ResultCode code, String dn, ResponseControl[] c)
Creates a new ldap exception.LdapException(Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls)
Creates a new ldap exception.LdapException(Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls, int id)
Creates a new ldap exception.LdapException(String msg)
Creates a new ldap exception.LdapException(String msg, Exception e)
Creates a new ldap exception.LdapException(String msg, Exception e, ResultCode code)
Creates a new ldap exception.LdapException(String msg, Exception e, ResultCode code, String dn)
Creates a new ldap exception.LdapException(String msg, Exception e, ResultCode code, String dn, ResponseControl[] c)
Creates a new ldap exception.LdapException(String msg, Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls)
Creates a new ldap exception.LdapException(String msg, Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls, int id)
Creates a new ldap exception.LdapException(String msg, ResultCode code)
Creates a new ldap exception.LdapException(String msg, ResultCode code, String dn)
Creates a new ldap exception.LdapException(String msg, ResultCode code, String dn, ResponseControl[] c)
Creates a new ldap exception.LdapException(String msg, ResultCode code, String dn, ResponseControl[] c, String[] urls)
Creates a new ldap exception.LdapException(String msg, ResultCode code, String dn, ResponseControl[] c, String[] urls, int id)
Creates a new ldap exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseControl
getControl(String oid)
Returns the first response control with the supplied OID for this response message.ResponseControl[]
getControls()
Returns the controls for this message.String
getMatchedDn()
Returns the matched DN produced by the ldap operation.int
getMessageId()
Returns the message ID for this response message.String[]
getReferralURLs()
Returns the referral URLs produced by the ldap operation.ResultCode
getResultCode()
Returns the ldap result code associated with this exception.String
toString()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
serialVersionUID.- See Also:
- Constant Field Values
-
resultCode
private final ResultCode resultCode
ldap result code.
-
matchedDn
private final String matchedDn
response matched DN.
-
responseControls
private final ResponseControl[] responseControls
response controls.
-
referralURLs
private final String[] referralURLs
referral URLs.
-
messageId
private final int messageId
Message ID.
-
-
Constructor Detail
-
LdapException
public LdapException(String msg)
Creates a new ldap exception.- Parameters:
msg
- describing this exception
-
LdapException
public LdapException(String msg, ResultCode code)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptioncode
- result code
-
LdapException
public LdapException(String msg, ResultCode code, String dn)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptioncode
- result codedn
- matched dn
-
LdapException
public LdapException(String msg, ResultCode code, String dn, ResponseControl[] c)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptioncode
- result codedn
- matched dnc
- response controls
-
LdapException
public LdapException(String msg, ResultCode code, String dn, ResponseControl[] c, String[] urls)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptioncode
- result codedn
- matched dnc
- response controlsurls
- referral urls
-
LdapException
public LdapException(String msg, ResultCode code, String dn, ResponseControl[] c, String[] urls, int id)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptioncode
- result codedn
- matched dnc
- response controlsurls
- referral urlsid
- message id
-
LdapException
public LdapException(Exception e)
Creates a new ldap exception.- Parameters:
e
- provider specific exception
-
LdapException
public LdapException(Exception e, ResultCode code)
Creates a new ldap exception.- Parameters:
e
- provider specific exceptioncode
- result code
-
LdapException
public LdapException(Exception e, ResultCode code, String dn)
Creates a new ldap exception.- Parameters:
e
- provider specific exceptioncode
- result codedn
- matched dn
-
LdapException
public LdapException(Exception e, ResultCode code, String dn, ResponseControl[] c)
Creates a new ldap exception.- Parameters:
e
- provider specific exceptioncode
- result codedn
- matched dnc
- response controls
-
LdapException
public LdapException(Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls)
Creates a new ldap exception.- Parameters:
e
- provider specific exceptioncode
- result codedn
- matched dnc
- response controlsurls
- referral urls
-
LdapException
public LdapException(Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls, int id)
Creates a new ldap exception.- Parameters:
e
- provider specific exceptioncode
- result codedn
- matched dnc
- response controlsurls
- referral urlsid
- message id
-
LdapException
public LdapException(String msg, Exception e)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptione
- provider specific exception
-
LdapException
public LdapException(String msg, Exception e, ResultCode code)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptione
- provider specific exceptioncode
- result code
-
LdapException
public LdapException(String msg, Exception e, ResultCode code, String dn)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptione
- provider specific exceptioncode
- result codedn
- matched dn
-
LdapException
public LdapException(String msg, Exception e, ResultCode code, String dn, ResponseControl[] c)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptione
- provider specific exceptioncode
- result codedn
- matched dnc
- response controls
-
LdapException
public LdapException(String msg, Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptione
- provider specific exceptioncode
- result codedn
- matched dnc
- response controlsurls
- referral urls
-
LdapException
public LdapException(String msg, Exception e, ResultCode code, String dn, ResponseControl[] c, String[] urls, int id)
Creates a new ldap exception.- Parameters:
msg
- describing this exceptione
- provider specific exceptioncode
- result codedn
- matched dnc
- response controlsurls
- referral urlsid
- message id
-
-
Method Detail
-
getResultCode
public ResultCode getResultCode()
Returns the ldap result code associated with this exception. May be null if the provider did not set this value or could not determine this value.- Returns:
- ldap result code
-
getMatchedDn
public String getMatchedDn()
Returns the matched DN produced by the ldap operation.- Returns:
- matched DN
-
getControls
public ResponseControl[] getControls()
Description copied from interface:Message
Returns the controls for this message.- Specified by:
getControls
in interfaceMessage<ResponseControl>
- Returns:
- controls
-
getControl
public ResponseControl getControl(String oid)
Description copied from interface:ResponseMessage
Returns the first response control with the supplied OID for this response message.- Specified by:
getControl
in interfaceResponseMessage
- Parameters:
oid
- of the response control to return- Returns:
- response control or null if control could not be found
-
getReferralURLs
public String[] getReferralURLs()
Returns the referral URLs produced by the ldap operation.- Returns:
- referral urls
-
getMessageId
public int getMessageId()
Description copied from interface:ResponseMessage
Returns the message ID for this response message.- Specified by:
getMessageId
in interfaceResponseMessage
- Returns:
- message id
-
-