Introduction
The server is using JNDI internally for manipulating data. It makes sense as a layer on top of the server, if someone want to use it embedded, but the JNDI API is not exactly the best fit for LDAP operations.
The idea is to simply redifine the JNDI structure to use what we really need, and nothing else.
JNDI API usage in ADS
This table list the JNDI classes and interface, exposing those which are used and those we are not.
Classes and interfaces
I/C |
JNDI class |
Used |
I/C |
ADS class |
Comment |
I |
Attribute |
|
I |
Not used yet |
|
I |
Attributes |
|
I |
Not used yet |
|
C |
BasicAttribute |
|
C |
Not used yet |
|
C |
BasicAttributes |
|
C |
Not used yet |
|
C |
BinaryRefAddr |
|
|
|
|
C |
Binding |
|
|
|
|
C |
CompositeName |
|
|
|
Used only in one test |
C |
CompoundName |
|
C |
LdapDN |
We should use LdapDN everywhere inside the server |
I |
Context |
|
I |
ServerContext |
It's all over the code. Do we have to define our own interface ? |
I |
Control |
|
I |
MutableControl (Should be ServerControl) |
We also have a Control class in codec which should be renamed |
C |
ControlFactory |
|
|
|
|
I |
DirContext |
|
|
|
|
C |
DirectoryManager |
|
|
|
Used in apacheds-core |
I |
DirObjectFactory |
|
|
|
|
I |
DirStateFactory |
|
|
|
Used in tests and in kerberos |
C |
DirStateFactory.Result |
|
|
|
Used in core and kerberos |
I |
EventContext |
|
|
|
|
I |
EventDirContext |
|
|
|
|
I |
ExtendedRequest |
|
|
|
|
I |
ExtendedResponse |
|
|
|
|
I |
HasControls |
|
|
|
Used in ChangeListener and PersistentSearchTest in server-unit |
C |
InitialContext |
|
|
|
|
I |
InitialContextFactory |
|
|
|
|
I |
InitialContextFactoryBuilder |
|
|
|
|
C |
InitialDirContext |
|
|
|
|
C |
InitialLdapContext |
|
|
|
|
I |
LdapContext |
|
|
|
|
C |
LinkRef |
|
|
|
|
C |
ModificationItem |
|
C |
ServerModification |
Not Implemented Yest |
I |
Name |
|
I |
ServerName |
We don't have an interface yet |
C |
NameClassPair |
|
|
|
Used in core-unit and in the JNDI layer |
I |
NameParser |
|
C |
LdapDNParser |
An implementation |
I |
NamespaceChangeListener |
|
|
|
|
I |
NamingEnumeration |
|
I |
ServerIterator |
To be defined |
C |
NamingEvent |
|
|
|
|
C |
NamingExceptionEvent |
|
|
|
|
I |
NamingListener |
|
|
|
|
C |
NamingManager |
|
|
|
|
I |
ObjectChangeListener |
|
|
|
|
I |
ObjectFactory |
|
|
|
|
I |
ObjectFactoryBuilder |
|
|
|
|
C |
RefAddr |
|
|
|
|
C |
Reference |
|
|
ServerReference |
|
I |
Referenceable |
|
|
|
|
I |
Resolver |
|
|
|
|
C |
ResolveResult |
|
|
|
|
C |
SearchControls |
|
|
ServerSearchControls |
|
C |
SearchResult |
|
|
ServerSearchResult |
|
I |
StateFactory |
|
|
|
|
C |
StringRefAddr |
|
|
|
|
I |
UnsolicitedNotification |
|
|
|
Only used in DisconnectNotificationCommandExecutor |
C |
UnsolicitedNotificationEvent |
|
|
|
Only used in DisconnectNotificationCommandExecutor |
I |
UnsolicitedNotificationListener |
|
|
|
Implemented by DisconnectNotificationCommandExecutor |
Exceptions
JNDI |
used |
ADS |
AttributeInUseException |
|
LdapAttributeInUseException |
AttributeModificationException |
never returned |
|
AuthenticationException |
|
LdapAuthenticationException |
AuthenticationNotSupportedException |
|
LdapAuthenticationNotSupportedException |
CannotProceedException |
|
|
CommunicationException |
|
|
ConfigurationException |
|
LdapConfigurationException |
ContextNotEmptyException |
|
LdapContextNotEmptyException |
InsufficientResourcesException |
|
|
InterruptedNamingException |
|
|
InvalidAttributeIdentifierException |
|
LdapInvalidAttributeIdentifierException |
InvalidAttributesException |
|
|
InvalidAttributeValueException |
|
LdapInvalidAttributeValueException |
InvalidNameException |
|
LdapInvalidNameException |
InvalidSearchControlsException |
|
|
InvalidSearchFilterException |
|
|
LdapReferralException |
|
LdapReferralException |
LimitExceededException |
|
|
LinkException |
|
|
LinkLoopException |
|
|
MalformedLinkException |
|
|
NameAlreadyBoundException |
|
LdapNameAlreadyBoundException |
NameNotFoundException |
|
LdapNameNotFoundException |
NamingException |
|
LdapNamingException |
NamingSecurityException |
|
|
NoInitialContextException |
|
|
NoPermissionException |
|
LdapNoPermissionException |
NoSuchAttributeException |
|
LdapNoSuchAttributeException |
NotContextException |
|
|
OperationNotSupportedException |
|
LdapOperationNotSupportedException |
PartialResultException |
|
|
ReferralException |
|
LdapReferralException |
SchemaViolationException |
|
LdapSchemaViolationException |
ServiceUnavailableException |
|
LdapServiceUnavailableException |
SizeLimitExceededException |
|
LdapSizeLimitExceededException |
TimeLimitExceededException |
|
LdapTimeLimitExceededException |
Define a JNDI Wrapper
We want to keep a wrapper around the server for users who want to embed the server. All the JNDI layer is buried into apacheds-core, in the org.apache.directory.server.core.jndi package.
We should just create a new project, which will cover this layer exclusively.