org.ldaptive
Class LdapException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by 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 using Throwable.getCause().

Version:
$Revision: 3120 $ $Date: 2015-10-01 11:50:02 -0400 (Thu, 01 Oct 2015) $
Author:
Middleware Services
See Also:
Serialized Form

Constructor Summary
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
 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
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 exception
code - result code

LdapException

public LdapException(String msg,
                     ResultCode code,
                     String dn)
Creates a new ldap exception.

Parameters:
msg - describing this exception
code - result code
dn - matched dn

LdapException

public LdapException(String msg,
                     ResultCode code,
                     String dn,
                     ResponseControl[] c)
Creates a new ldap exception.

Parameters:
msg - describing this exception
code - result code
dn - matched dn
c - response controls

LdapException

public LdapException(String msg,
                     ResultCode code,
                     String dn,
                     ResponseControl[] c,
                     String[] urls)
Creates a new ldap exception.

Parameters:
msg - describing this exception
code - result code
dn - matched dn
c - response controls
urls - 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 exception
code - result code
dn - matched dn
c - response controls
urls - referral urls
id - 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 exception
code - result code

LdapException

public LdapException(Exception e,
                     ResultCode code,
                     String dn)
Creates a new ldap exception.

Parameters:
e - provider specific exception
code - result code
dn - matched dn

LdapException

public LdapException(Exception e,
                     ResultCode code,
                     String dn,
                     ResponseControl[] c)
Creates a new ldap exception.

Parameters:
e - provider specific exception
code - result code
dn - matched dn
c - response controls

LdapException

public LdapException(Exception e,
                     ResultCode code,
                     String dn,
                     ResponseControl[] c,
                     String[] urls)
Creates a new ldap exception.

Parameters:
e - provider specific exception
code - result code
dn - matched dn
c - response controls
urls - 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 exception
code - result code
dn - matched dn
c - response controls
urls - referral urls
id - message id

LdapException

public LdapException(String msg,
                     Exception e)
Creates a new ldap exception.

Parameters:
msg - describing this exception
e - provider specific exception

LdapException

public LdapException(String msg,
                     Exception e,
                     ResultCode code)
Creates a new ldap exception.

Parameters:
msg - describing this exception
e - provider specific exception
code - result code

LdapException

public LdapException(String msg,
                     Exception e,
                     ResultCode code,
                     String dn)
Creates a new ldap exception.

Parameters:
msg - describing this exception
e - provider specific exception
code - result code
dn - matched dn

LdapException

public LdapException(String msg,
                     Exception e,
                     ResultCode code,
                     String dn,
                     ResponseControl[] c)
Creates a new ldap exception.

Parameters:
msg - describing this exception
e - provider specific exception
code - result code
dn - matched dn
c - 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 exception
e - provider specific exception
code - result code
dn - matched dn
c - response controls
urls - 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 exception
e - provider specific exception
code - result code
dn - matched dn
c - response controls
urls - referral urls
id - 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()
Returns the controls for this message.

Specified by:
getControls in interface Message<ResponseControl>
Returns:
controls

getControl

public ResponseControl getControl(String oid)
Returns the first response control with the supplied OID for this response message.

Specified by:
getControl in interface ResponseMessage
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()
Returns the message ID for this response message.

Specified by:
getMessageId in interface ResponseMessage
Returns:
message id

toString

public String toString()

Overrides:
toString in class Throwable


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.