Issue Details (XML | Word | Printable)

Key: DIRSERVER-453
Type: Improvement Improvement
Status: Closed Closed
Resolution: Invalid
Priority: Major Major
Assignee: Trustin Lee
Reporter: Trustin Lee
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Refactor ExceptionService and move integrity check code to Database.

Created: 16/Jun/05 10:35 AM   Updated: 10/Feb/06 12:43 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 25/Oct/05 05:34 PM


 Description  « Hide
The original duty of ExceptionService was to convert JNDI exceptions and other exceptions to LDAP exceptions, but now it is doing more than its duty; it is checking exsitance of entries, etc.

So my idea is to move those integrity check code to Database implementation (or its abstract parent?) We'll also need good documentation about how to implement Database.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alex Karasulu added a comment - 29/Aug/05 02:18 PM
Trustin I don't have a clear idea of how you intend to do this so I'm going to move this to the next release and assign it over to you.

Trustin Lee added a comment - 15/Sep/05 12:03 AM
As we talked about this long before, It'd like make ExceptionService only concentrate on converting NamingExceptions into LdapNamingExceptions, and move context partition integrity checks into DefaultContextPartitionNexus or ContextPartition implementations. What do you think?

Alex Karasulu added a comment - 15/Sep/05 12:34 AM
I'm a bit nervous about doing this. I think its because I feel that some checks are generic and should be made on all partition implementations. If we push all these down into the context partition then it will be specific to one implementation. This may not be the case with the nexus however.

Stefan Zoerner added a comment - 15/Sep/05 01:00 AM
As far as I understand the situation, Trustin would like to have an ExceptionService which only makes what its mission is. Alex point is, that he do not want to remove the critical checks (which do not naturally belong to the ExceptionService). How about separating this piece in two interceptors: The ExceptionService converts the exceptions, and AlexGenericChecksInterceptor (working title) gets the generic checks? Or is it not desired to have many interceptors for basic tasks, which should normally not be removed?

Trustin Lee added a comment - 15/Sep/05 01:02 AM
Current integrity check doesn't work under high concurrency as you know. I think it is the duty of ComtextPartition implementation to do that at least at the point we don't have any synchronization. We can synchronize all operations using an interceptor but this is too inefficient.

Trustin Lee added a comment - 15/Sep/05 01:16 AM
Hi Stefan. That's a great suggestion. :)

Alex Karasulu added a comment - 15/Sep/05 03:41 AM
Ok you guys know best on this one. Let's just try to make sure other partition implementations can get a benefit from some generic checks somehow. I think we talked about pushing this into nexus so that does in fact happen.

Trustin Lee added a comment - 15/Sep/05 08:53 AM
Let's extract integrity check code to IntegrityService or something similar just like Stefan suggested.

Trustin Lee added a comment - 25/Oct/05 05:34 PM
I've found our implementation (apacheds-core) throws an LdapNamingException with LDAP-specific error codes such as ALIASPROBLEM. I thought we can stop all classes from throwing LdapNamingException and make them throw NamingException instead, and then ExceptionService can convert them to corresponding LdapNamingExceptions 1:1. But it's not 1:1 right now. So I cannot divide ExceptionService into IntegrityService and ExceptionService logically.

I guess we need to standardize which type of exceptions we should throw for consistency. NamingException or LdapNamingException? I think LdapNamingException is the way to go.