UserMappingException class (Java programming language)

The Java™ user-mapping plug-in uses the UserMappingException class, which is a subclass of the java.lang.Exception class, to report errors.

Public methods

You can view the use of these functions in a sample Java plug-in that retrieves user mappings from an LDAP server. The files are in the sqllib/samples/federated/umplugin/ldap/ directory. The functions from this class are used in each of the sample Java files.

UserMappingException(int errorNumber)
The constructor that is used for instantiating the UserMappingException object that is used for reporting errors. The errorNumber parameter that is sent to the UserMappingException object defines the type of error that is reported.
int getErrorNumber()
Returns the error number of the exception.

The UserMappingRepositoryLDAP.java file contains this function for catching and reporting errors for testing an LDAP plugin.

String getErrorMessage()
Returns the error message of the exception.

The UserMappingRepositoryLDAP.java file contains a method for catching and reporting errors for testing an LDAP plugin.

Error messages

The following table lists error numbers, constant names, and error messages.
Table 1. Error numbers and messages
Error number Constant name Error message
1 INITIALIZE_ERROR The plug-in failed to initialize.
2 CONNECTION_ERROR Unable to connect to the repository.
3 AUTHENTICATION_ERROR Unable to authenticate with the repository.
4 LOOKUP_ERROR Lookup on the repository failed.
5 DECRYPTION_ERROR Decryption failed.
6 DISCONNECT_ERROR Unable to disconnect from the repository.
7 INVALID_PARAMETER_ERROR Invalid parameter.
8 UNAUTHORIZED_CALLER The caller is not authorized to call the plug-in.