Previous Topic: ExceptionsNext Topic: Custom Connector Code Upgrade Considerations


LDAP Exception Considerations

Consider the following LDAP exceptions when writing a custom connector. Most exceptions are from the org.apache.directory.shared.ldap.exception package of ApacheDS, but a few exceptions are defined in the CA IAM CS code. All the exceptions extend javax.naming.NamingException, but implement org.apache.directory.shared.ldap.exception.LdapException so a detailed LDAP code can be passed through.

Exceptions are serialized as part of the Service Oriented Architecture. Any exception that is not derived from org.apache.directory.shared.ldap.exception.LdapException or javax.naming.NamingException will be converted to a NamingException before leaving CA IAM CS.

Note: For more information on exceptions, see the Javadoc CA IdentityMinder bookshelf for either the ApacheDS (included in the SDK installer) or CA IAM CS .

Note: For more information on other implementing classes that are not listed, see org.apache.directory.shared.ldap.message.ResultCodeEnum and org.apache.directory.shared.ldap.exception.LdapException,

LdapNameAlreadyBoundException

Thrown when an object with the same name as the one you are trying to create on the endpoint system exists.

Result code: ResultCodeEnum.ENTRY_ALREADY_EXISTS.

LdapNameNotFoundException

Thrown when a DN is received which references an object found not to exist on the endpoint system.

Result code: ResultCodeEnum.NOSUCHOBJECT.

LdapServiceUnavailableException

Takes one of the return codes defined in ResultCodeEnum.SERVICEUNAVAILABLE_CODES. Call this exception when you are having communication exceptions with the endpoint system.

Important! This exception is important for the retry code at higher layers of the system.

You can use an instance of this exception to flag transient failures to the CA IAM CS framework by setting the result code of the exception to ResultCodeEnum.UNAVAILABLE. The resiliency support retries the operation which caused the failure.

LdapConfigurationException

Thrown when an error in the configuration of a connector or CA IAM CS is encountered. Try to use more specific exceptions. Avoid using this error code if possible, and provide details of the error in the error message.

Result code: ResultCodeEnum.OTHER

LdapNoPermissionException

Specifies that the requester does not have the right to carry out the requested operation.

Result code: ResultCodeEnum.INSUFFICIENTACCESSRIGHTS

LdapSizeLimitExceededException

Thrown when the number of results generated by a search exceeds the maximum number of results specified by either the client or the server, after results up to this limit have already been returned. So that handling size limits are not an issue, use sdk.com.ca.jcs.enumeration.RawNamingEnumeration or one of its derived classes.

Result code: ResultCodeEnum.SIZELIMITEXCEEDED

LdapTimeLimitExceededException

See LdapSizeLimitExceededException.

Result code: ResultCodeEnum.TIMELIMITEXCEEDED

LdapInvalidAttributesException

Takes one of the six result codes defined in ResultCodeEnum.ATTRIBUTE_CODES.

LdapInvalidAttributeValueException

Thrown when an invalid value is encountered for an attribute, but in many cases correct use of validators and converters removes the need to throw it.

Takes one of the following result codes:

LdapSchemaViolationException

Thrown when a request is received which attempts to bypass structural rules dictated by the endpoint system, such as creating an object under an inappropriate container.

Takes one of the following result codes:

LdapNamingException

Specifies a generic exception, to be avoided if at all possible.

LdapInvalidNameException

Result code: Not required