Harmeet,
I have reviewed your proposal. Here is my quick take on it, as a proposed
code change:
- AuthState +1
This just takes existing data from the handler, and encapsulates it as a
Java Bean.
- AuthService +1
This simply takes two methods from the handler, and separates them as an
interface.
- AuthServiceImpl conditional
You have eliminated the stateful problems, but it remains to be seen what
you do with this class. As I understand it, an instance of AuthService
would be passed to the NNTPHandler through its service specific
configuration object.
Apparently, Peter objects to exposing AuthService to other James components,
so if this is a Block in james-assembly.xml, he has stated that he intends
to veto it. I'm curious to see what other folks have to say. However, if
you hide the AuthService inside NNTPServer, e.g.,
NNTPServer() { ... authService = new AuthServiceImpl(); ... }
compose(...) { ... authService.compose(...); ... }
configure(...) { ... authService.configure(...); ... }
enableLogging(...) { super(logger); setupLogger(authService); ... }
or equivalent means, then that might address the objections that I have read
so far. All of this presumes, of course, that the code works, otherwise it
would need to be fixed.
However, before you invest much more into this effort, consider the
following.
As I understand it the primary purpose for the AuthService is that you want
to decouple handlers from repositories: (a) basically don't trust the
repository interface, and (b) you want to allow an LDAP or Radius
authentication server to be used. If someone deploying James has that need,
it can be addressed. In the meantime, you can easily isolate the
AuthService inside the NNTPServer, allowing NNTPHandler to remain entirely
unchanged, which is your primary goal.
One reason for limiting the investment of time and energy into AuthService
is that if JAAS ends up being used in v3, then it is likely that AuthService
would disappear again forever, since JAAS has its own means by which service
providers are installed.
Your thoughts, Kind Sir?
--- Noel
--
To unsubscribe, e-mail: <mailto:james-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@;jakarta.apache.org>